nbis: fix rest of warnings reported by gcc

https://bugs.freedesktop.org/show_bug.cgi?id=56439
This commit is contained in:
Vasily Khoruzhick 2012-10-26 16:40:53 +03:00 committed by Bastien Nocera
parent 5d32102efe
commit 1cfd14b7fe
4 changed files with 14 additions and 23 deletions

View file

@ -86,7 +86,7 @@ int block_offsets(int **optr, int *ow, int *oh,
int *blkoffs, bx, by, bw, bh, bi, bsize; int *blkoffs, bx, by, bw, bh, bi, bsize;
int blkrow_start, blkrow_size, offset; int blkrow_start, blkrow_size, offset;
int lastbw, lastbh; int lastbw, lastbh;
int pad2, pw, ph; int pad2, pw;
/* Test if unpadded image is smaller than a single block */ /* Test if unpadded image is smaller than a single block */
if((iw < blocksize) || (ih < blocksize)){ if((iw < blocksize) || (ih < blocksize)){
@ -99,7 +99,6 @@ int block_offsets(int **optr, int *ow, int *oh,
/* Compute padded width and height of image */ /* Compute padded width and height of image */
pad2 = pad<<1; pad2 = pad<<1;
pw = iw + pad2; pw = iw + pad2;
ph = ih + pad2;
/* Compute the number of columns and rows of blocks in the image. */ /* Compute the number of columns and rows of blocks in the image. */
/* Take the ceiling to account for "leftovers" at the right and */ /* Take the ceiling to account for "leftovers" at the right and */

View file

@ -385,12 +385,12 @@ int get_minutiae(MINUTIAE **ominutiae, int **oquality_map,
const int id, const double ppmm, const LFSPARMS *lfsparms) const int id, const double ppmm, const LFSPARMS *lfsparms)
{ {
int ret; int ret;
MINUTIAE *minutiae; MINUTIAE *minutiae = NULL;
int *direction_map, *low_contrast_map, *low_flow_map; int *direction_map = NULL, *low_contrast_map = NULL, *low_flow_map = NULL;
int *high_curve_map, *quality_map; int *high_curve_map = NULL, *quality_map = NULL;
int map_w, map_h; int map_w = 0, map_h = 0;
unsigned char *bdata; unsigned char *bdata = NULL;
int bw, bh; int bw = 0, bh = 0;
/* If input image is not 8-bit grayscale ... */ /* If input image is not 8-bit grayscale ... */
if(id != 8){ if(id != 8){

View file

@ -782,7 +782,6 @@ int process_loop(MINUTIAE *minutiae,
unsigned char *bdata, const int iw, const int ih, unsigned char *bdata, const int iw, const int ih,
const LFSPARMS *lfsparms) const LFSPARMS *lfsparms)
{ {
int halfway;
int idir, type, appearing; int idir, type, appearing;
double min_dist, max_dist; double min_dist, max_dist;
int min_fr, max_fr, min_to, max_to; int min_fr, max_fr, min_to, max_to;
@ -800,9 +799,6 @@ int process_loop(MINUTIAE *minutiae,
/* Get pixel value of feature's interior. */ /* Get pixel value of feature's interior. */
feature_pix = *(bdata + (contour_y[0] * iw) + contour_x[0]); feature_pix = *(bdata + (contour_y[0] * iw) + contour_x[0]);
/* Compute half the perimeter of the loop. */
halfway = ncontour>>1;
/* Get the aspect dimensions of the loop in units of */ /* Get the aspect dimensions of the loop in units of */
/* squared distance. */ /* squared distance. */
get_loop_aspect(&min_fr, &min_to, &min_dist, get_loop_aspect(&min_fr, &min_to, &min_dist,
@ -940,7 +936,6 @@ int process_loop_V2(MINUTIAE *minutiae,
unsigned char *bdata, const int iw, const int ih, unsigned char *bdata, const int iw, const int ih,
int *plow_flow_map, const LFSPARMS *lfsparms) int *plow_flow_map, const LFSPARMS *lfsparms)
{ {
int halfway;
int idir, type, appearing; int idir, type, appearing;
double min_dist, max_dist; double min_dist, max_dist;
int min_fr, max_fr, min_to, max_to; int min_fr, max_fr, min_to, max_to;
@ -960,9 +955,6 @@ int process_loop_V2(MINUTIAE *minutiae,
/* Get pixel value of feature's interior. */ /* Get pixel value of feature's interior. */
feature_pix = *(bdata + (contour_y[0] * iw) + contour_x[0]); feature_pix = *(bdata + (contour_y[0] * iw) + contour_x[0]);
/* Compute half the perimeter of the loop. */
halfway = ncontour>>1;
/* Get the aspect dimensions of the loop in units of */ /* Get the aspect dimensions of the loop in units of */
/* squared distance. */ /* squared distance. */
get_loop_aspect(&min_fr, &min_to, &min_dist, get_loop_aspect(&min_fr, &min_to, &min_dist,

View file

@ -565,7 +565,7 @@ static int ridge_count(const int first, const int second, MINUTIAE *minutiae,
MINUTIA *minutia1, *minutia2; MINUTIA *minutia1, *minutia2;
int i, ret, found; int i, ret, found;
int *xlist, *ylist, num; int *xlist, *ylist, num;
int ridge_count, ridge_start, ridge_end; int ridge_cnt, ridge_start, ridge_end;
int prevpix, curpix; int prevpix, curpix;
minutia1 = minutiae->list[first]; minutia1 = minutiae->list[first];
@ -614,7 +614,7 @@ static int ridge_count(const int first, const int second, MINUTIAE *minutiae,
} }
/* Ready to count ridges, so initialize counter to 0. */ /* Ready to count ridges, so initialize counter to 0. */
ridge_count = 0; ridge_cnt = 0;
print2log("RIDGE COUNT: %d,%d to %d,%d ", minutia1->x, minutia1->y, print2log("RIDGE COUNT: %d,%d to %d,%d ", minutia1->x, minutia1->y,
minutia2->x, minutia2->y); minutia2->x, minutia2->y);
@ -630,7 +630,7 @@ static int ridge_count(const int first, const int second, MINUTIAE *minutiae,
print2log("\n"); print2log("\n");
/* Return number of ridges counted to this point. */ /* Return number of ridges counted to this point. */
return(ridge_count); return(ridge_cnt);
} }
/* Otherwise, we found a new ridge start transition, so store */ /* Otherwise, we found a new ridge start transition, so store */
/* its location (the location of the 1 in 0-to-1 transition). */ /* its location (the location of the 1 in 0-to-1 transition). */
@ -647,7 +647,7 @@ static int ridge_count(const int first, const int second, MINUTIAE *minutiae,
print2log("\n"); print2log("\n");
/* Return number of ridges counted to this point. */ /* Return number of ridges counted to this point. */
return(ridge_count); return(ridge_cnt);
} }
/* Otherwise, we found a new ridge end transition, so store */ /* Otherwise, we found a new ridge end transition, so store */
/* its location (the location of the 0 in 1-to-0 transition). */ /* its location (the location of the 0 in 1-to-0 transition). */
@ -680,7 +680,7 @@ static int ridge_count(const int first, const int second, MINUTIAE *minutiae,
if(ret){ if(ret){
/* Then assume we have found a valid ridge crossing and bump */ /* Then assume we have found a valid ridge crossing and bump */
/* the ridge counter. */ /* the ridge counter. */
ridge_count++; ridge_cnt++;
} }
/* Otherwise, ignore the current ridge start and end transitions */ /* Otherwise, ignore the current ridge start and end transitions */
@ -694,7 +694,7 @@ static int ridge_count(const int first, const int second, MINUTIAE *minutiae,
print2log("\n"); print2log("\n");
/* Return the number of ridges counted. */ /* Return the number of ridges counted. */
return(ridge_count); return(ridge_cnt);
} }
/************************************************************************* /*************************************************************************
@ -719,7 +719,7 @@ static int count_minutia_ridges(const int first, MINUTIAE *minutiae,
unsigned char *bdata, const int iw, const int ih, unsigned char *bdata, const int iw, const int ih,
const LFSPARMS *lfsparms) const LFSPARMS *lfsparms)
{ {
int i, ret, *nbr_list, *nbr_nridges, nnbrs; int i, ret, *nbr_list = NULL, *nbr_nridges, nnbrs;
/* Find up to the maximum number of qualifying neighbors. */ /* Find up to the maximum number of qualifying neighbors. */
if((ret = find_neighbors(&nbr_list, &nnbrs, lfsparms->max_nbrs, if((ret = find_neighbors(&nbr_list, &nnbrs, lfsparms->max_nbrs,