Skip to content

Commit 0e2038d

Browse files
committed
Fix Clang compilation.
1 parent a44718d commit 0e2038d

File tree

21 files changed

+46
-36
lines changed

21 files changed

+46
-36
lines changed

src/apps/ch10_area_lights/ch10_area_lights/CameraSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void OrbitalCamera::setRatio(float aAspectRatio)
2323
#else
2424
mCamera.setupPerspectiveProjection({
2525
.mAspectRatio = aAspectRatio,
26-
.mVerticalFov = math::Radian{math::pi<float>/2.f},
26+
.mVerticalFov = math::Radian<float>{math::pi<float>/2.f},
2727
.mNearZ = -0.1f,
2828
.mFarZ = -20.f }
2929
);

src/apps/ch10_area_lights/ch10_area_lights/log/Logging-init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void ad_rtr_ch10_loggerinitialization()
3838
//
3939
#else
4040

41-
namespace ad::renderer {
41+
namespace ad {
4242

4343

4444
std::tuple<std::shared_ptr<spdlog::logger>>

src/apps/ch10_ltc/ch10_ltc/CameraSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void OrbitalCamera::setRatio(float aAspectRatio)
2020
//);
2121
mCamera.setupPerspectiveProjection({
2222
.mAspectRatio = aAspectRatio,
23-
.mVerticalFov = math::Radian{math::pi<float>/2.f},
23+
.mVerticalFov = math::Radian<float>{math::pi<float>/2.f},
2424
.mNearZ = -0.1f,
2525
.mFarZ = -20.f }
2626
);

src/apps/ch10_ltc/ch10_ltc/Scene.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ void Scene::render(math::Size<2, int> aRenderResolution)
413413

414414
std::string to_string(Scene::FrameControl::AppMode aValue)
415415
{
416-
#define STR(enumerator) case Scene::FrameControl::AppMode::##enumerator: return #enumerator
416+
#define STR(enumerator) case Scene::FrameControl::AppMode::enumerator: return #enumerator
417417
switch (aValue)
418418
{
419419
STR(Fig2);
@@ -428,7 +428,7 @@ std::string to_string(Scene::FrameControl::AppMode aValue)
428428

429429
std::string to_string(Scene::FigureControl::Letter aValue)
430430
{
431-
#define STR(enumerator) case Scene::FigureControl::##enumerator: return #enumerator
431+
#define STR(enumerator) case Scene::FigureControl::enumerator: return #enumerator
432432
switch (aValue)
433433
{
434434
STR(a);

src/apps/ch10_ltc/ch10_ltc/log/Logging-init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ LoggerInitialization::LoggerInitialization()
2222
const LoggerInitialization LoggerInitialization::gInitialized;
2323

2424

25-
} // namespace ad::renderer
25+
} // namespace ad
2626

2727

2828
void ad_rtr_ch10_loggerinitialization()
@@ -38,7 +38,7 @@ void ad_rtr_ch10_loggerinitialization()
3838
//
3939
#else
4040

41-
namespace ad::renderer {
41+
namespace ad {
4242

4343

4444
std::tuple<std::shared_ptr<spdlog::logger>>

src/apps/ch11_ssao/ch11_ssao/FrameGraph.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "FrameGraph.h"
22

3+
#include "log/Logging.h"
34
#include "SetupDrawing.h"
45
#include "UniformSetterWitness.h"
56

@@ -94,7 +95,7 @@ DESCRIBE(FrameGraph::BlurControl)
9495

9596
std::string to_string(TextureStore::Name aName)
9697
{
97-
#define STR(enumerator) case TextureStore::##enumerator: return #enumerator
98+
#define STR(enumerator) case TextureStore::enumerator: return #enumerator
9899
switch (aName)
99100
{
100101
STR(DepthMap);
@@ -769,6 +770,9 @@ void FrameGraph::appendUi()
769770
case FrameGraph::SsaoMethod::OrientedHemishphere:
770771
describe(witness, mHemisphereSsaoControl);
771772
break;
773+
default:
774+
ADLOG(warn)("Unhandled SSAO method value: {}.", (unsigned int)mSsaoMethod);
775+
break;
772776
}
773777

774778
ImGui::SeparatorText("AO Blur");

src/apps/ch11_ssao/ch11_ssao/SetupDrawing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ graphics::VertexArrayObject prepareVAO(const renderer::IntrospectProgram & aProg
103103
assert(elementSize <= 16);
104104
const GLsizeiptr bufferSize = elementSize * aMesh.mVertexCount;
105105
scenic::BufferView dummyBufferView{
106-
.mGLBuffer = accessor.mBuffer,
106+
.mGLBuffer = {accessor.mBuffer},
107107
.mStride = elementSize,
108108
.mInstanceDivisor = 0, // All attributes from a Naive MeshPart are per vertex
109109
.mOffset = 0,
@@ -206,6 +206,6 @@ void setTextures(const IntrospectProgram & aProgram,
206206
}
207207
}
208208
}
209-
#endif 0
209+
#endif
210210

211211
} // namespace ad

src/apps/ch11_ssao/ch11_ssao/log/Logging-init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void ad_rtr_ch10_loggerinitialization()
3939
//
4040
#else
4141

42-
namespace ad::renderer {
42+
namespace ad {
4343

4444

4545
std::tuple<std::shared_ptr<spdlog::logger>>

src/apps/ch11_ssao/ch11_ssao/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ int main(int argc, const char* argv[])
7777
if (resetStatus == GL_GUILTY_CONTEXT_RESET)
7878
{
7979
ADLOG_THROW(critical, "OpenGL: Guilty context reset (likely caused by the application).");
80-
terminate();
80+
std::terminate();
8181
}
8282
else if (resetStatus == GL_INNOCENT_CONTEXT_RESET)
8383
{
8484
ADLOG_THROW(critical, "OpenGL: Innocent context reset (external cause).");
85-
terminate();
85+
std::terminate();
8686
}
8787
else if (resetStatus == GL_UNKNOWN_CONTEXT_RESET)
8888
{
8989
ADLOG_THROW(critical, "OpenGL: Unknown context reset (cause undetermined).");
90-
terminate();
90+
std::terminate();
9191
}
9292
}
9393
}

src/libs/engine/engine/files/Loader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace {
2525

2626

2727
// TODO: move that to a low level utils lib (handy)
28-
constexpr std::uint32_t makeFourCC(char a, char b, char c, char d)
28+
[[maybe_unused]] constexpr std::uint32_t makeFourCC(char a, char b, char c, char d)
2929
{
3030
return (std::uint32_t)a
3131
| ((std::uint32_t)b << 8)

0 commit comments

Comments
 (0)