From 97de0cbc349e0e0fb1ae64efb9833a9a1b3774cd Mon Sep 17 00:00:00 2001 From: Nado Date: Thu, 12 Nov 2015 22:07:59 +0100 Subject: [PATCH 1/2] Fixing clang only warnings --- lib/irrlicht/CMakeLists.txt | 10 ++++++++-- src/race/history.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/irrlicht/CMakeLists.txt b/lib/irrlicht/CMakeLists.txt index b03051e2c..b13308798 100644 --- a/lib/irrlicht/CMakeLists.txt +++ b/lib/irrlicht/CMakeLists.txt @@ -25,8 +25,14 @@ elseif(MINGW) add_definitions(-D_IRR_STATIC_LIB_) add_definitions(-D_CRT_SECURE_NO_WARNINGS) # Shut up about unsafe stuff else() - set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wall -pipe -O3 -fno-exceptions -fstrict-aliasing -fexpensive-optimizations -I/usr/X11R6/include") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pipe -O3 -fno-exceptions -fstrict-aliasing -fexpensive-optimizations -I/usr/X11R6/include") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pipe -O3 -fno-exceptions -fstrict-aliasing -I/usr/X11R6/include") + set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wall -pipe -O3 -fno-exceptions -fstrict-aliasing -I/usr/X11R6/include") + if(CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexpensive-optimizations") + endif() + if(CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexpensive-optimizations") + endif() endif() # Xrandr diff --git a/src/race/history.cpp b/src/race/history.cpp index e3a512a9b..8d8a060c1 100644 --- a/src/race/history.cpp +++ b/src/race/history.cpp @@ -275,7 +275,7 @@ void History::Load() // Optional (not supported in older history files): include reverse fgets(s, 1023, fd); char r; - if (!sscanf(s, "reverse: %c", &r) != 1) + if (sscanf(s, "reverse: %c", &r) == 1) { fgets(s, 1023, fd); race_manager->setReverseTrack(r == 'y'); From d66a70b2508f41a95f76d50c8382c16a2c283d94 Mon Sep 17 00:00:00 2001 From: Nado Date: Fri, 13 Nov 2015 12:07:37 +0100 Subject: [PATCH 2/2] Fixing some -Wunused-variable --- lib/irrlicht/source/Irrlicht/CParticleMeshEmitter.cpp | 2 +- lib/irrlicht/source/Irrlicht/CParticleMeshEmitter.h | 1 - lib/irrlicht/source/Irrlicht/CParticlePointEmitter.cpp | 2 +- lib/irrlicht/source/Irrlicht/CParticlePointEmitter.h | 1 - src/graphics/post_processing.cpp | 4 ---- src/physics/btKart.cpp | 5 ----- src/scriptengine/script_challenges.cpp | 2 -- 7 files changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/irrlicht/source/Irrlicht/CParticleMeshEmitter.cpp b/lib/irrlicht/source/Irrlicht/CParticleMeshEmitter.cpp index 74d5af18d..e77267151 100644 --- a/lib/irrlicht/source/Irrlicht/CParticleMeshEmitter.cpp +++ b/lib/irrlicht/source/Irrlicht/CParticleMeshEmitter.cpp @@ -27,7 +27,7 @@ CParticleMeshEmitter::CParticleMeshEmitter( MinParticlesPerSecond(minParticlesPerSecond), MaxParticlesPerSecond(maxParticlesPerSecond), MinStartColor(minStartColor), MaxStartColor(maxStartColor), MinLifeTime(lifeTimeMin), MaxLifeTime(lifeTimeMax), - Time(0), Emitted(0), MaxAngleDegrees(maxAngleDegrees), + Time(0), MaxAngleDegrees(maxAngleDegrees), EveryMeshVertex(everyMeshVertex), UseNormalDirection(useNormalDirection) { #ifdef _DEBUG diff --git a/lib/irrlicht/source/Irrlicht/CParticleMeshEmitter.h b/lib/irrlicht/source/Irrlicht/CParticleMeshEmitter.h index af0003116..c1eae3799 100644 --- a/lib/irrlicht/source/Irrlicht/CParticleMeshEmitter.h +++ b/lib/irrlicht/source/Irrlicht/CParticleMeshEmitter.h @@ -145,7 +145,6 @@ private: u32 MinLifeTime, MaxLifeTime; u32 Time; - u32 Emitted; s32 MaxAngleDegrees; bool EveryMeshVertex; diff --git a/lib/irrlicht/source/Irrlicht/CParticlePointEmitter.cpp b/lib/irrlicht/source/Irrlicht/CParticlePointEmitter.cpp index 34dc51d73..76027c3bb 100644 --- a/lib/irrlicht/source/Irrlicht/CParticlePointEmitter.cpp +++ b/lib/irrlicht/source/Irrlicht/CParticlePointEmitter.cpp @@ -25,7 +25,7 @@ CParticlePointEmitter::CParticlePointEmitter( MaxParticlesPerSecond(maxParticlesPerSecond), MinStartColor(minStartColor), MaxStartColor(maxStartColor), MinLifeTime(lifeTimeMin), MaxLifeTime(lifeTimeMax), - MaxAngleDegrees(maxAngleDegrees), Time(0), Emitted(0) + MaxAngleDegrees(maxAngleDegrees), Time(0) { #ifdef _DEBUG setDebugName("CParticlePointEmitter"); diff --git a/lib/irrlicht/source/Irrlicht/CParticlePointEmitter.h b/lib/irrlicht/source/Irrlicht/CParticlePointEmitter.h index c83232cf5..08ba404b4 100644 --- a/lib/irrlicht/source/Irrlicht/CParticlePointEmitter.h +++ b/lib/irrlicht/source/Irrlicht/CParticlePointEmitter.h @@ -112,7 +112,6 @@ private: s32 MaxAngleDegrees; u32 Time; - u32 Emitted; }; } // end namespace scene diff --git a/src/graphics/post_processing.cpp b/src/graphics/post_processing.cpp index 6a3d0bdde..ac726ffbc 100644 --- a/src/graphics/post_processing.cpp +++ b/src/graphics/post_processing.cpp @@ -1248,8 +1248,6 @@ void PostProcessing::renderHorizontalBlur(const FrameBuffer &in_fbo, { assert(in_fbo.getWidth() == auxiliary.getWidth() && in_fbo.getHeight() == auxiliary.getHeight()); - float inv_width = 1.0f / in_fbo.getWidth(); - float inv_height = 1.0f / in_fbo.getHeight(); auxiliary.bind(); Gaussian6HBlurShader::getInstance()->render(in_fbo, in_fbo.getWidth(), @@ -1268,8 +1266,6 @@ void PostProcessing::renderGaussian17TapBlur(const FrameBuffer &in_fbo, in_fbo.getHeight() == auxiliary.getHeight()); if (CVS->supportsComputeShadersFiltering()) glMemoryBarrier(GL_FRAMEBUFFER_BARRIER_BIT); - float inv_width = 1.0f / in_fbo.getWidth(); - float inv_height = 1.0f / in_fbo.getHeight(); { if (!CVS->supportsComputeShadersFiltering()) { diff --git a/src/physics/btKart.cpp b/src/physics/btKart.cpp index 20b15d3e9..ed2b39baf 100644 --- a/src/physics/btKart.cpp +++ b/src/physics/btKart.cpp @@ -538,12 +538,7 @@ void btKart::updateVehicle( btScalar step ) btScalar proj = fwd.dot(wheel.m_raycastInfo.m_contactNormalWS); fwd -= wheel.m_raycastInfo.m_contactNormalWS * proj; - - btScalar proj2 = fwd.dot(vel); - - } - } // If configured, add a force to keep karts on the track diff --git a/src/scriptengine/script_challenges.cpp b/src/scriptengine/script_challenges.cpp index 43e90d0e8..21fb5911e 100644 --- a/src/scriptengine/script_challenges.cpp +++ b/src/scriptengine/script_challenges.cpp @@ -66,7 +66,6 @@ namespace Scripting int getChallengeRequiredPoints(std::string* challenge_name) { - ::Track* track = World::getWorld()->getTrack(); const ChallengeData* challenge = unlock_manager->getChallengeData(*challenge_name); if (challenge == NULL) { @@ -81,7 +80,6 @@ namespace Scripting bool isChallengeUnlocked(std::string* challenge_name) { - ::Track* track = World::getWorld()->getTrack(); const ChallengeData* challenge = unlock_manager->getChallengeData(*challenge_name); if (challenge == NULL) {