Merge pull request #2380 from nado/clang-fix

Fixes few warnings at compilation
This commit is contained in:
Deve 2015-11-17 15:23:55 +01:00
commit a69eb99094
9 changed files with 11 additions and 18 deletions

View File

@ -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

View File

@ -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

View File

@ -145,7 +145,6 @@ private:
u32 MinLifeTime, MaxLifeTime;
u32 Time;
u32 Emitted;
s32 MaxAngleDegrees;
bool EveryMeshVertex;

View File

@ -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");

View File

@ -112,7 +112,6 @@ private:
s32 MaxAngleDegrees;
u32 Time;
u32 Emitted;
};
} // end namespace scene

View File

@ -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())
{

View File

@ -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

View File

@ -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');

View File

@ -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)
{