From: Michael Urman Date: Wed, 9 Jan 2002 08:15:57 +0000 (-0000) Subject: Fix one line odd error: missing initialization of step. X-Git-Tag: v0.1.0~97 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04b27087a966b5f56cf0023ebbc392005d7385bc;p=yasm Fix one line odd error: missing initialization of step. svn path=/trunk/yasm/; revision=442 --- diff --git a/libyasm/linemgr.c b/libyasm/linemgr.c index 00d14ef1..d4f24479 100644 --- a/libyasm/linemgr.c +++ b/libyasm/linemgr.c @@ -141,7 +141,7 @@ void line_lookup(unsigned long lindex, const char **filename, unsigned long *line) { line_index_mapping *mapping/*, *mapping2*/; - int vindex, step; + unsigned long vindex, step; assert(lindex <= line_index); @@ -150,6 +150,7 @@ line_lookup(unsigned long lindex, const char **filename, unsigned long *line) mapping = line_index_map->vector; vindex = 0; /* start step as the greatest power of 2 <= size */ + step = 1; while (step*2<=line_index_map->size) step*=2; while (step>0) { if (vindex+step < line_index_map->size diff --git a/src/globals.c b/src/globals.c index 00d14ef1..d4f24479 100644 --- a/src/globals.c +++ b/src/globals.c @@ -141,7 +141,7 @@ void line_lookup(unsigned long lindex, const char **filename, unsigned long *line) { line_index_mapping *mapping/*, *mapping2*/; - int vindex, step; + unsigned long vindex, step; assert(lindex <= line_index); @@ -150,6 +150,7 @@ line_lookup(unsigned long lindex, const char **filename, unsigned long *line) mapping = line_index_map->vector; vindex = 0; /* start step as the greatest power of 2 <= size */ + step = 1; while (step*2<=line_index_map->size) step*=2; while (step>0) { if (vindex+step < line_index_map->size diff --git a/src/linemgr.c b/src/linemgr.c index 00d14ef1..d4f24479 100644 --- a/src/linemgr.c +++ b/src/linemgr.c @@ -141,7 +141,7 @@ void line_lookup(unsigned long lindex, const char **filename, unsigned long *line) { line_index_mapping *mapping/*, *mapping2*/; - int vindex, step; + unsigned long vindex, step; assert(lindex <= line_index); @@ -150,6 +150,7 @@ line_lookup(unsigned long lindex, const char **filename, unsigned long *line) mapping = line_index_map->vector; vindex = 0; /* start step as the greatest power of 2 <= size */ + step = 1; while (step*2<=line_index_map->size) step*=2; while (step>0) { if (vindex+step < line_index_map->size