diff --git a/CMakeLists.txt b/CMakeLists.txt index c7864f0f686c1699be91c34e36f87f8862edf9aa..943f8913738c2b6ed06f8aa3e795c017f7001978 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -860,7 +860,7 @@ add_executable (pbrt::pspec ALIAS pspec) target_compile_definitions (pspec PRIVATE ${PBRT_DEFINITIONS}) target_compile_options (pspec PRIVATE ${PBRT_CXX_FLAGS}) target_include_directories (pspec PRIVATE src src/ext) -target_link_libraries (pspec PRIVATE ${ALL_PBRT_LIBS}) +target_link_libraries (pspec PRIVATE ${ALL_PBRT_LIBS} pbrt_warnings) add_sanitizers (pspec) diff --git a/src/pbrt/samplers_test.cpp b/src/pbrt/samplers_test.cpp index e3fa2f96d6f428437b076b04021b9f4b9ad1a534..140cc7a73b05f386118872d11c09ccf8536c673b 100644 --- a/src/pbrt/samplers_test.cpp +++ b/src/pbrt/samplers_test.cpp @@ -76,7 +76,7 @@ static void checkElementary(const char *name, std::vector samples, // in each dimension. int nx = 1 << i, ny = 1 << (logSamples - i); - std::vector count(1 << logSamples, 0); + std::vector count(size_t(1 << logSamples), 0); for (const Point2f &s : samples) { // Map the sample to an interval Float x = nx * s.x, y = ny * s.y; diff --git a/src/pbrt/util/lowdiscrepancy.h b/src/pbrt/util/lowdiscrepancy.h index 261aa71cf3ae4bd21e6a22e3940d94b2697d4b19..76cb4c8ac5a18874e90860c9c2f5ee71e2c4ab20 100644 --- a/src/pbrt/util/lowdiscrepancy.h +++ b/src/pbrt/util/lowdiscrepancy.h @@ -240,7 +240,7 @@ struct OwenScrambler { for (int b = 1; b < 32; ++b) { // Apply Owen scrambling to binary digit _b_ in _v_ uint32_t mask = (~0u) << (32 - b); - if (MixBits((v & mask) ^ seed) & (1u << b)) + if ((uint32_t)MixBits((v & mask) ^ seed) & (1u << b)) v ^= 1u << (31 - b); } return v; diff --git a/src/pbrt/util/math.h b/src/pbrt/util/math.h index ac6f7c2d991b0433be425e42f839428729bde6f6..c603d7f939df54488ecf8b1996ab240981eb7ac2 100644 --- a/src/pbrt/util/math.h +++ b/src/pbrt/util/math.h @@ -243,9 +243,9 @@ PBRT_CPU_GPU inline Float Lerp(Float x, Float a, Float b) { template PBRT_CPU_GPU inline constexpr T Clamp(T val, U low, V high) { if (val < low) - return low; + return T(low); else if (val > high) - return high; + return T(high); else return val; } diff --git a/src/pbrt/util/progressreporter.h b/src/pbrt/util/progressreporter.h index 84c1876f2af1cfdd2a361fca063a50d47ab428b6..83d432eab8e9acd1061a061361e0787c797c8933 100644 --- a/src/pbrt/util/progressreporter.h +++ b/src/pbrt/util/progressreporter.h @@ -71,7 +71,7 @@ class ProgressReporter { #ifdef PBRT_BUILD_GPU_RENDERER std::vector gpuEvents; - std::atomic gpuEventsLaunchedOffset; + std::atomic gpuEventsLaunchedOffset; int gpuEventsFinishedOffset; #endif };