From 34eafa499e8f98e589bb1534ea6f24d23cd56846 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Fri, 24 Dec 2010 22:23:23 +0200 Subject: [PATCH] quadtree: Fix compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- quadtree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quadtree.c b/quadtree.c index 5e57afd..9cc6821 100644 --- a/quadtree.c +++ b/quadtree.c @@ -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) { -- 2.44.0