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;
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 */
{
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)
{
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;
}
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;
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 */
lTotalComp = lMctComp + lNbComp;
lSpace = (float *) malloc((size_t)lTotalComp * sizeof(float));
lCurrentDoublePtr = lSpace;
- for (i=0;i<lMctComp;++i) {
+ for (i2=0;i2<lMctComp;++i2) {
lStrLen = strlen(lCurrentPtr) + 1;
*lCurrentDoublePtr++ = (float) atof(lCurrentPtr);
lCurrentPtr += lStrLen;
}
l_int_ptr = (int*) lCurrentDoublePtr;
- for (i=0;i<lNbComp;++i) {
+ for (i2=0;i2<lNbComp;++i2) {
lStrLen = strlen(lCurrentPtr) + 1;
*l_int_ptr++ = atoi(lCurrentPtr);
lCurrentPtr += lStrLen;
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);
}