changeset 2304:5e939ba7a5a4

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 30 Nov 2020 04:42:06 +0200
parents ef4bfa756b6c
children 09ece63b8e02
files mapstats.c
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mapstats.c	Mon Nov 02 10:26:51 2020 +0200
+++ b/mapstats.c	Mon Nov 30 04:42:06 2020 +0200
@@ -22,7 +22,7 @@
 #define SET_MAX_FILES (512)
 
 char    *srcFilenames[SET_MAX_FILES],
-        *destFilename = NULL;
+        *dstFilename = NULL;
 int     nsrcFilenames = 0;
 
 BOOL    optUseOldFormat = FALSE,
@@ -92,8 +92,8 @@
         break;
 
     case 5:
-        destFilename = optArg;
-        THMSG(2, "Output file set to '%s'.\n", destFilename);
+        dstFilename = optArg;
+        THMSG(2, "Output file set to '%s'.\n", dstFilename);
         break;
 
     case 6:
@@ -208,7 +208,6 @@
 {
     FILE *outFile;
     MapBlock *map;
-    unsigned char *d;
     unsigned int statTotal, statUnknown;
     MapPieceStat statPieces[nmapPieces];
 
@@ -251,7 +250,7 @@
 
         for (int y = 0; y < map->height; y++)
         {
-            d = map->data + (map->scansize * y);
+            unsigned char *d = map->data + (map->scansize * y);
             for (int x = 0; x < map->width; x++)
             {
                 int c;
@@ -287,13 +286,13 @@
     }
 
     // Open output file
-    if (destFilename == NULL)
+    if (dstFilename == NULL)
         outFile = stdout;
     else
-    if ((outFile = fopen(destFilename, "wb")) == NULL)
+    if ((outFile = fopen(dstFilename, "wb")) == NULL)
     {
         THERR("Error opening output file '%s'!\n",
-            destFilename);
+            dstFilename);
         exit(1);
     }