]> git.itanic.dy.fi Git - sdl-planets/commitdiff
quadtree: Fix compiler warnings
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Fri, 24 Dec 2010 20:23:23 +0000 (22:23 +0200)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Fri, 24 Dec 2010 20:23:23 +0000 (22:23 +0200)
quadtree.c:370: warning: unused variable ‘ret’

Trivial remove

quadtree.c: In function ‘quadtree_find_nearest’:
quadtree.c:369: warning: ‘distance’ may be used uninitialized in this function

This variable will not be used uninitialized, but the compiler warning
is trivial to fix with simply initializing the variable with zero.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
quadtree.c

index 5e57afd245cb8acddfe984226fa4ae452adf854f..9cc6821ed561acf9997d34e6b3cc994c1dbca675 100644 (file)
@@ -366,8 +366,8 @@ static struct quadtree *quadtree_find_nearest(struct quadtree *tree,
 {
        struct vector tmp;
        struct quadtree *nearest, *node;
-       double distance, dist;
-       int ret, i, directions;
+       double distance = 0, dist;
+       int i, directions;
 
        if (!is_within(pos, corner)) {
                if (debug) {