Fix clang warnings (#922).

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12668 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2013-04-17 12:09:04 +00:00
parent 23814a3145
commit 5648939d8f
4 changed files with 7 additions and 5 deletions

View File

@ -175,7 +175,9 @@ void SlipStream::createMesh(const video::SMaterial &material)
// Loop through all given radius to determine the number // Loop through all given radius to determine the number
// of segments to create. // of segments to create.
unsigned int num_circles=0; unsigned int num_circles=0;
while(radius[num_circles]) num_circles++; while(radius[num_circles]>0.0f) num_circles++;
assert(num_circles > 0);
// Length is distance of last circle to distance of first circle: // Length is distance of last circle to distance of first circle:
m_length = distance[num_circles-1] - distance[0]; m_length = distance[num_circles-1] - distance[0];

View File

@ -176,13 +176,15 @@ void History::Save()
} }
World *world = World::getWorld(); World *world = World::getWorld();
int num_karts = world->getNumKarts(); const int num_karts = world->getNumKarts();
fprintf(fd, "Version: %s\n", STK_VERSION); fprintf(fd, "Version: %s\n", STK_VERSION);
fprintf(fd, "numkarts: %d\n", num_karts); fprintf(fd, "numkarts: %d\n", num_karts);
fprintf(fd, "numplayers: %d\n", race_manager->getNumPlayers()); fprintf(fd, "numplayers: %d\n", race_manager->getNumPlayers());
fprintf(fd, "difficulty: %d\n", race_manager->getDifficulty()); fprintf(fd, "difficulty: %d\n", race_manager->getDifficulty());
fprintf(fd, "track: %s\n", world->getTrack()->getIdent().c_str()); fprintf(fd, "track: %s\n", world->getTrack()->getIdent().c_str());
assert(num_karts > 0);
int k; int k;
for(k=0; k<num_karts; k++) for(k=0; k<num_karts; k++)
{ {

View File

@ -154,7 +154,7 @@ bool CheckLine::isTriggered(const Vec3 &old_pos, const Vec3 &new_pos,
{ {
core::vector2df p=new_pos.toIrrVector2d(); core::vector2df p=new_pos.toIrrVector2d();
bool sign = m_line.getPointOrientation(p)>=0; bool sign = m_line.getPointOrientation(p)>=0;
bool result=sign!=m_previous_sign[indx]; bool result;
// If the sign has changed, i.e. the infinite line was crossed somewhere, // If the sign has changed, i.e. the infinite line was crossed somewhere,
// check if the finite line was actually crossed: // check if the finite line was actually crossed:
if(sign!=m_previous_sign[indx] && if(sign!=m_previous_sign[indx] &&

View File

@ -728,7 +728,6 @@ void QuadGraph::determineDirection(unsigned int current,
if(fabsf(rel_angle)<max_straight_angle) if(fabsf(rel_angle)<max_straight_angle)
rel_angle = 0; rel_angle = 0;
int prev = next; // is now n+1
next = getNode(next).getSuccessor(0); // next is now n+2 next = getNode(next).getSuccessor(0); // next is now n+2
// If the direction is still the same during a lap the last node // If the direction is still the same during a lap the last node
@ -752,7 +751,6 @@ void QuadGraph::determineDirection(unsigned int current,
break; break;
rel_angle = new_rel_angle; rel_angle = new_rel_angle;
prev = next;
next = getNode(next).getSuccessor(0); next = getNode(next).getSuccessor(0);
} // while(1) } // while(1)