# HG changeset patch # User Matti Hamalainen # Date 1567500846 -10800 # Node ID dc79c64f158ceef4002da11a0ff7437b7a44768c # Parent f367677a5b21bbbfe082062e8f4bb6db2e5ec41b Constify. diff -r f367677a5b21 -r dc79c64f158c tools/lib64gfx.c --- a/tools/lib64gfx.c Tue Sep 03 10:44:22 2019 +0300 +++ b/tools/lib64gfx.c Tue Sep 03 11:54:06 2019 +0300 @@ -306,12 +306,12 @@ int dmC64ConvertCSDataToImage(DMImage *img, - int xoffs, int yoffs, const Uint8 *buf, - int width, int height, BOOL multicolor, - int *colors) + const int xoffs, const int yoffs, const Uint8 *buf, + const int width, const int height, const BOOL multicolor, + const int *colors) { int yc, widthpx = width * 8; - Uint8 *dp; + Uint8 *dpp; if (img == NULL) return DMERR_NULLPTR; @@ -321,14 +321,14 @@ yoffs > img->height - height) return DMERR_INVALID_ARGS; - dp = img->data + (yoffs * img->pitch) + xoffs; + dpp = img->data + (yoffs * img->pitch) + xoffs; if (multicolor) { for (yc = 0; yc < height; yc++) { const int offs = yc * width; - Uint8 *d = dp; + Uint8 *dp = dpp; for (int xc = 0; xc < widthpx / 2; xc++) { @@ -336,11 +336,11 @@ const int v = 6 - ((xc * 2) & 6); const Uint8 c = colors[(b >> v) & 3]; - *d++ = c; - *d++ = c; + *dp++ = c; + *dp++ = c; } - dp += img->pitch; + dpp += img->pitch; } } else @@ -348,7 +348,7 @@ for (yc = 0; yc < height; yc++) { const int offs = yc * width; - Uint8 *d = dp; + Uint8 *dp = dpp; for (int xc = 0; xc < widthpx; xc++) { @@ -356,10 +356,10 @@ const int v = 7 - (xc & 7); const Uint8 c = colors[(b >> v) & 1]; - *d++ = c; + *dp++ = c; } - dp += img->pitch; + dpp += img->pitch; } } diff -r f367677a5b21 -r dc79c64f158c tools/lib64gfx.h --- a/tools/lib64gfx.h Tue Sep 03 10:44:22 2019 +0300 +++ b/tools/lib64gfx.h Tue Sep 03 11:54:06 2019 +0300 @@ -388,7 +388,10 @@ // Encoding and decoding of formats and images -int dmC64ConvertCSDataToImage(DMImage *img, int xoffs, int yoffs, const Uint8 *inBuf, int width, int height, BOOL multicolor, int *colors); +int dmC64ConvertCSDataToImage(DMImage *img, + const int xoffs, const int yoffs, const Uint8 *buf, + const int width, const int height, const BOOL multicolor, + const int *colors); int dmC64ImageGetNumBlocks(const DMC64ImageFormat *fmt);