diff --git a/similar/main/iff.cpp b/similar/main/iff.cpp index cb9e22065..5d3598048 100644 --- a/similar/main/iff.cpp +++ b/similar/main/iff.cpp @@ -261,12 +261,11 @@ static int parse_body(PHYSFS_file *ifile,long len,iff_bitmap_header *bmheader) static int parse_delta(PHYSFS_file *ifile,long len,iff_bitmap_header *bmheader) { unsigned char *p=bmheader->raw_data; - int y; long chunk_end = PHYSFS_tell(ifile) + len; PHYSFSX_fseek(ifile, 4, SEEK_CUR); //longword, seems to be equal to 4. Don't know what it is - for (y=0;yh;y++) { + for (int y=0;yh;y++) { ubyte n_items; int cnt = bmheader->w; ubyte code; @@ -441,7 +440,7 @@ static int iff_parse_ilbm_pbm(PHYSFS_file *ifile,long form_type,iff_bitmap_heade //convert an ILBM file to a PBM file static int convert_ilbm_to_pbm(iff_bitmap_header *bmheader) { - int x,y,p; + int x,p; sbyte *new_data, *destptr, *rowptr; int bytes_per_row,byteofs; ubyte checkmask,newbyte,setbit; @@ -453,7 +452,7 @@ static int convert_ilbm_to_pbm(iff_bitmap_header *bmheader) bytes_per_row = 2*((bmheader->w+15)/16); - for (y=0;yh;y++) { + for (int y=0;yh;y++) { rowptr = (signed char *) &bmheader->raw_data[y * bytes_per_row * bmheader->nplanes]; @@ -488,14 +487,13 @@ static int convert_ilbm_to_pbm(iff_bitmap_header *bmheader) static int convert_rgb15(grs_bitmap *bm,iff_bitmap_header *bmheader) { - int x,y; palette_array_t::iterator palptr = begin(bmheader->palette); #if defined(DXX_BUILD_DESCENT_I) gr_init_bitmap (bm, bm->bm_type, 0, 0, bm->bm_w, bm->bm_h, bm->bm_rowsize, 0); - for (y=0; ybm_h; y++) { - for (x=0; xw; x++) + for (int y=0; ybm_h; y++) { + for (int x=0; xw; x++) gr_bm_pixel (bm, x, y, INDEX_TO_15BPP(bmheader->raw_data[y*bmheader->w+x])); } #elif defined(DXX_BUILD_DESCENT_II) @@ -505,9 +503,9 @@ static int convert_rgb15(grs_bitmap *bm,iff_bitmap_header *bmheader) return IFF_NO_MEM; unsigned newptr = 0; - for (y=0; ybm_h; y++) { + for (int y=0; ybm_h; y++) { - for (x=0; xw; x++) + for (int x=0; xw; x++) new_data[newptr++] = INDEX_TO_15BPP(bmheader->raw_data[y*bmheader->w+x]); } @@ -688,7 +686,7 @@ static int write_pal(PHYSFS_file *ofile,iff_bitmap_header *bitmap_header) static int rle_span(ubyte *dest,ubyte *src,int len) { - int n,lit_cnt,rep_cnt; + int lit_cnt,rep_cnt; ubyte last,*cnt_ptr,*dptr; cnt_ptr=0; @@ -697,7 +695,7 @@ static int rle_span(ubyte *dest,ubyte *src,int len) last=src[0]; lit_cnt=1; - for (n=1;nraw_data; ubyte tspan[80],new_span[80*2]; long save_pos; @@ -820,7 +818,7 @@ int write_tiny(PHYSFS_file *ofile,iff_bitmap_header *bitmap_header,int compressi PHYSFS_writeSBE16(ofile, new_w); PHYSFS_writeSBE16(ofile, new_h); - for (y=0;y