diff map2ppm.c @ 1771:72adabd8e746

More cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 27 Oct 2017 05:10:08 +0300
parents cc59f80b0e78
children 79dd960610cb
line wrap: on
line diff
--- a/map2ppm.c	Fri Oct 27 04:35:51 2017 +0300
+++ b/map2ppm.c	Fri Oct 27 05:10:08 2017 +0300
@@ -145,7 +145,7 @@
 
 int writeImageData(MapBlock *map, void *cbdata, BOOL (*writeRowCB)(void *, uint8_t *, size_t), int scale)
 {
-    int x, y, yscale, xscale, res = 0;
+    int res = 0;
     uint8_t *row = NULL;
 
     // Allocate memory for row buffer
@@ -155,11 +155,11 @@
         goto done;
     }
 
-    for (y = 0; y < map->height; y++)
+    for (int y = 0; y < map->height; y++)
     {
         uint8_t *ptr = row;
 
-        for (x = 0; x < map->width; x++)
+        for (int x = 0; x < map->width; x++)
         {
             int qr, qg, qb, c;
             qr = 255; qg = qb = 0;
@@ -202,7 +202,7 @@
                 }
             }
 
-            for (xscale = 0; xscale < scale; xscale++)
+            for (int xscale = 0; xscale < scale; xscale++)
             {
                 *ptr++ = qr;
                 *ptr++ = qg;
@@ -210,7 +210,7 @@
             }
         }
 
-        for (yscale = 0; yscale < scale; yscale++)
+        for (int yscale = 0; yscale < scale; yscale++)
         {
             if (!writeRowCB(cbdata, row, map->width * 3 * scale))
             {
@@ -407,6 +407,5 @@
 
     mapBlockFree(map);
 
-    exit(ret);
     return ret;
 }