# HG changeset patch # User Matti Hamalainen # Date 1526376955 -10800 # Node ID b2fe49401465959ad6861e812610588c3eb4f044 # Parent 70b04c16aa40ee04350b3ad518727a095cf7f9cc Cleanup. diff -r 70b04c16aa40 -r b2fe49401465 tools/libgfx.c --- a/tools/libgfx.c Tue May 15 12:30:29 2018 +0300 +++ b/tools/libgfx.c Tue May 15 12:35:55 2018 +0300 @@ -1603,8 +1603,7 @@ void dmDecodeBitPlane(Uint8 *dp, Uint8 *src, const int width, const int nplane) { - int xc; - for (xc = 0; xc < width; xc++) + for (int xc = 0; xc < width; xc++) { const Uint8 data = (src[xc / 8] >> (7 - (xc & 7))) & 1; dp[xc] |= (data << nplane); @@ -1640,13 +1639,12 @@ // Decode the chunk for (yc = 0; yc < img->height; yc++) { - int plane; const int nplanes = iff->bmhd.nplanes; Uint8 *dp = img->data + (yc * img->pitch); dmMemset(dp, 0, img->pitch); - for (plane = 0; plane < nplanes; plane++) + for (int plane = 0; plane < nplanes; plane++) { // Decompress or read data if (!dmIFFReadOneRow(fp, iff, buf, bufLen)) @@ -1666,8 +1664,6 @@ // Read mask data if (iff->bmhd.masking == IFF_MASK_HAS_MASK) { - int xc; - // Decompress or read data if (!dmIFFReadOneRow(fp, iff, buf, bufLen)) { @@ -1677,7 +1673,7 @@ } // Decode mask - for (xc = 0; xc < img->width; xc++) + for (int xc = 0; xc < img->width; xc++) { const Uint8 data = (buf[xc / 8] >> (7 - (xc & 7))) & 1;