diff --git a/libs/bluegl/tests/OpenGLSupport.cpp b/libs/bluegl/tests/OpenGLSupport.cpp index c0aa2c6627..f5a3e7bbc7 100644 --- a/libs/bluegl/tests/OpenGLSupport.cpp +++ b/libs/bluegl/tests/OpenGLSupport.cpp @@ -44,9 +44,9 @@ namespace gl { // This mutex protect g_library_refcount below. static std::mutex g_library_mutex; -static uint32_t g_library_refcount = 0; #ifdef __APPLE__ +static uint32_t g_library_refcount = 0; // Function pointer types for CGL functions typedef CGLError (*CGL_CHOOSE_PIXEL_FORMAT_PROC)(const CGLPixelFormatAttribute*, CGLPixelFormatObj*, GLint*); @@ -270,6 +270,8 @@ struct GLXLocalContext { GLXPbuffer buffer; }; +static uint32_t g_library_refcount = 0; + bool loadLibraries() { std::lock_guard lock(g_library_mutex); g_library_refcount++; diff --git a/libs/filaflat/src/ShaderBuilder.cpp b/libs/filaflat/src/ShaderBuilder.cpp index 7076f0841f..2b7f15c80a 100644 --- a/libs/filaflat/src/ShaderBuilder.cpp +++ b/libs/filaflat/src/ShaderBuilder.cpp @@ -43,8 +43,7 @@ void ShaderBuilder::announce(size_t size) { } void ShaderBuilder::append(const char* data, size_t size) noexcept { - size_t available = mCapacity - mCursor; - assert(size <= available); + assert(size <= (mCapacity - mCursor)); memcpy(mShader + mCursor, data, size); mCursor += size; } diff --git a/libs/ibl/src/CubemapIBL.cpp b/libs/ibl/src/CubemapIBL.cpp index 72cf709ce1..2e61c2e171 100644 --- a/libs/ibl/src/CubemapIBL.cpp +++ b/libs/ibl/src/CubemapIBL.cpp @@ -360,7 +360,6 @@ void CubemapIBL::roughnessFilter(JobSystem& js, Cubemap& dst, const std::vector< const float NoH2 = NoH * NoH; const float NoV = dot(N, V); #else - const float NoV = 1; const float NoH = H.z; const float NoH2 = H.z * H.z; const float NoL = 2 * NoH2 - 1; @@ -547,7 +546,7 @@ void CubemapIBL::diffuseIrradiance(JobSystem& js, Cubemap& dst, const std::vecto cache.reserve(maxNumSamples); // precompute everything that only depends on the sample # - for (size_t sampleIndex = 0, sample = 0 ; sampleIndex < maxNumSamples; sampleIndex++) { + for (size_t sampleIndex = 0; sampleIndex < maxNumSamples; sampleIndex++) { // get Hammersley distribution for the half-sphere const float2 u = hammersley(uint32_t(sampleIndex), inumSamples); const float3 L = hemisphereCosSample(u); diff --git a/libs/ibl/src/CubemapUtils.cpp b/libs/ibl/src/CubemapUtils.cpp index 97746f5597..2555c422b0 100644 --- a/libs/ibl/src/CubemapUtils.cpp +++ b/libs/ibl/src/CubemapUtils.cpp @@ -56,7 +56,6 @@ void CubemapUtils::clamp(Image& src) { void CubemapUtils::equirectangularToCubemap(JobSystem& js, Cubemap& dst, const Image& src) { const size_t width = src.getWidth(); const size_t height = src.getHeight(); - const float r = width * 0.5 * M_1_PI; auto toRectilinear = [width, height](float3 s) -> float2 { float xf = std::atan2(s.x, s.z) * M_1_PI; // range [-1.0, 1.0] diff --git a/libs/image/src/KtxBundle.cpp b/libs/image/src/KtxBundle.cpp index ab7266b605..fbb8f74ffa 100644 --- a/libs/image/src/KtxBundle.cpp +++ b/libs/image/src/KtxBundle.cpp @@ -321,7 +321,6 @@ bool KtxBundle::allocateBlob(KtxBlobIndex index, uint32_t size) { return false; } uint32_t flatIndex = flatten(this, index); - uint32_t blobSize = mBlobs->sizes[flatIndex]; mBlobs->resize(flatIndex, size); return true; } diff --git a/libs/imageio/src/BlockCompression.cpp b/libs/imageio/src/BlockCompression.cpp index 1782a2e5dc..f4e0e17f0f 100644 --- a/libs/imageio/src/BlockCompression.cpp +++ b/libs/imageio/src/BlockCompression.cpp @@ -18,6 +18,7 @@ #include +#include #include #include diff --git a/libs/imageio/src/ImageEncoder.cpp b/libs/imageio/src/ImageEncoder.cpp index 33985708cd..0abae40a61 100644 --- a/libs/imageio/src/ImageEncoder.cpp +++ b/libs/imageio/src/ImageEncoder.cpp @@ -280,8 +280,8 @@ PNGEncoder* PNGEncoder::create(std::ostream& stream, PixelFormat format) { } PNGEncoder::PNGEncoder(std::ostream& stream, PixelFormat format) - : mStream(stream), mStreamStartPos(stream.tellp()), mFormat(format), - mPNG(png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr)) { + : mPNG(png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr)), + mStream(stream), mStreamStartPos(stream.tellp()), mFormat(format) { } PNGEncoder::~PNGEncoder() { @@ -738,7 +738,7 @@ EXREncoder* EXREncoder::create(std::ostream& stream, const std::string& compress EXREncoder::EXREncoder(std::ostream& stream, const std::string& compression, const std::string& destName) : mStream(stream), mStreamStartPos(stream.tellp()), - mCompression(compression), mDestName(destName) { + mDestName(destName), mCompression(compression) { } static int toEXRCompression(const std::string& c) { diff --git a/libs/math/tests/test_mat.cpp b/libs/math/tests/test_mat.cpp index 282e8e7cdf..cfafe3cee1 100644 --- a/libs/math/tests/test_mat.cpp +++ b/libs/math/tests/test_mat.cpp @@ -32,7 +32,6 @@ protected: }; TEST_F(MatTest, Basics) { - mat4 m0; EXPECT_EQ(sizeof(mat4), sizeof(double)*16); } @@ -72,8 +71,6 @@ TEST_F(MatTest, Constructors) { EXPECT_EQ(m1, m2); EXPECT_EQ(m2, m3); EXPECT_EQ(m3, m1); - - mat4 m4(double4(1), double4(2), double4(3), double4(4)); } TEST_F(MatTest, ArithmeticOps) { @@ -169,7 +166,6 @@ protected: }; TEST_F(Mat3Test, Basics) { - mat3 m0; EXPECT_EQ(sizeof(mat3), sizeof(double)*9); } @@ -276,7 +272,6 @@ protected: }; TEST_F(Mat2Test, Basics) { - mat2 m0; EXPECT_EQ(sizeof(mat2), sizeof(double)*4); } @@ -622,7 +617,6 @@ TYPED_TEST(MatTestT, EulerZYX_33) { TYPED_TEST(MatTestT, ToQuaternionPostTranslation) { typedef filament::math::details::TMat44 M44T; - typedef filament::math::details::TVec4 V4T; typedef filament::math::details::TVec3 V3T; typedef filament::math::details::TQuaternion QuatT; diff --git a/libs/utils/src/JobSystem.cpp b/libs/utils/src/JobSystem.cpp index f71db1e4e3..713996457d 100644 --- a/libs/utils/src/JobSystem.cpp +++ b/libs/utils/src/JobSystem.cpp @@ -306,7 +306,6 @@ void JobSystem::finish(Job* job) noexcept { bool notify = false; // terminate this job and notify its parent - auto& jobPool = mJobPool; Job* const storage = mJobStorageBase; do { // std::memory_order_release here is needed to synchronize with JobSystem::wait()