diff --git a/src/bin/jp2/convert.c b/src/bin/jp2/convert.c index 1e578c07..72babbaa 100644 --- a/src/bin/jp2/convert.c +++ b/src/bin/jp2/convert.c @@ -573,7 +573,8 @@ opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters) unsigned char *table_R, *table_G, *table_B; unsigned int j, PAD = 0; - int x, y, index; + unsigned int x, y; + int index; int gray_scale = 1; int has_color; DWORD W, H; @@ -732,10 +733,10 @@ opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters) index = 0; - for(y = 0; y < (int)H; y++) + for(y = 0; y < H; y++) { unsigned char *scanline = RGB + (3 * (unsigned int)W + PAD) * ((unsigned int)H - 1 - (unsigned int)y); - for(x = 0; x < (int)W; x++) + for(x = 0; x < W; x++) { unsigned char *pixel = &scanline[3 * x]; image->comps[0].data[index] = pixel[2]; /* R */ @@ -862,8 +863,8 @@ opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters) { unsigned char *pix, *beyond; int *gray, *red, *green, *blue; - unsigned int x, y, max; - int i, c, c1; + unsigned int max; + int c, c1; unsigned char uc; if (Info_h.biClrUsed == 0) @@ -3126,15 +3127,15 @@ static int imagetoraw_common(opj_image_t * image, const char *outfile, OPJ_BOOL { if(image->comps[compno].sgnd == 1) { - union { signed short val; signed char vals[2]; } uc; + union { signed short val; signed char vals[2]; } uc16; mask = (1 << image->comps[compno].prec) - 1; ptr = image->comps[compno].data; for (line = 0; line < h; line++) { for(row = 0; row < w; row++) { curr = *ptr; if(curr > 32767 ) curr = 32767; else if( curr < -32768) curr = -32768; - uc.val = (signed short)(curr & mask); - res = fwrite(uc.vals, 1, 2, rawFile); + uc16.val = (signed short)(curr & mask); + res = fwrite(uc16.vals, 1, 2, rawFile); if( res < 2 ) { fprintf(stderr, "failed to write 2 byte for %s\n", outfile); goto fin; @@ -3145,15 +3146,15 @@ static int imagetoraw_common(opj_image_t * image, const char *outfile, OPJ_BOOL } else if(image->comps[compno].sgnd == 0) { - union { unsigned short val; unsigned char vals[2]; } uc; + union { unsigned short val; unsigned char vals[2]; } uc16; mask = (1 << image->comps[compno].prec) - 1; ptr = image->comps[compno].data; for (line = 0; line < h; line++) { for(row = 0; row < w; row++) { curr = *ptr; if(curr > 65536 ) curr = 65536; else if( curr < 0) curr = 0; - uc.val = (unsigned short)(curr & mask); - res = fwrite(uc.vals, 1, 2, rawFile); + uc16.val = (unsigned short)(curr & mask); + res = fwrite(uc16.vals, 1, 2, rawFile); if( res < 2 ) { fprintf(stderr, "failed to write 2 byte for %s\n", outfile); goto fin; diff --git a/src/bin/jp2/opj_compress.c b/src/bin/jp2/opj_compress.c index e42e88df..ffb76349 100644 --- a/src/bin/jp2/opj_compress.c +++ b/src/bin/jp2/opj_compress.c @@ -935,7 +935,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param float *lCurrentDoublePtr; float *lSpace; int *l_int_ptr; - int lNbComp = 0, lTotalComp, lMctComp, i; + int lNbComp = 0, lTotalComp, lMctComp, i2; size_t lStrLen, lStrFread; /* Open file */ @@ -972,14 +972,14 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param lTotalComp = lMctComp + lNbComp; lSpace = (float *) malloc((size_t)lTotalComp * sizeof(float)); lCurrentDoublePtr = lSpace; - for (i=0;ifirst; while( msg){ - if( isJPPstream){ + if( isjppstream){ if((msg->class_id == TILE_HEADER_MSG) && msg->csn == csn && last_tileID < msg->in_class_id) last_tileID = msg->in_class_id; } diff --git a/tests/compare_images.c b/tests/compare_images.c index fba89710..5dfd69d1 100644 --- a/tests/compare_images.c +++ b/tests/compare_images.c @@ -729,14 +729,14 @@ int main(int argc, char **argv) if ( (inParam.tabMSEvalues != NULL) && (inParam.tabPEAKvalues != NULL)) { - int it_comp; + int it_comp2; printf(" MSE values = ["); - for (it_comp = 0; it_comp < inParam.nbcomp; it_comp++) - printf(" %f ", inParam.tabMSEvalues[it_comp]); + for (it_comp2 = 0; it_comp2 < inParam.nbcomp; it_comp2++) + printf(" %f ", inParam.tabMSEvalues[it_comp2]); printf("]\n"); printf(" PEAK values = ["); - for (it_comp = 0; it_comp < inParam.nbcomp; it_comp++) - printf(" %f ", inParam.tabPEAKvalues[it_comp]); + for (it_comp2 = 0; it_comp2 < inParam.nbcomp; it_comp2++) + printf(" %f ", inParam.tabPEAKvalues[it_comp2]); printf("]\n"); printf(" Non-regression test = %d\n", inParam.nr_flag); }