changeset 2324:dc79c64f158c

Constify.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 03 Sep 2019 11:54:06 +0300
parents f367677a5b21
children ddd29161d258
files tools/lib64gfx.c tools/lib64gfx.h
diffstat 2 files changed, 16 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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;
         }
     }
 
--- 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);