changeset 2534:76b67c40fbf5

Rename "exit" label to "out".
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 26 Dec 2023 02:31:17 +0200
parents 84abab47bb82
children 52d1a0ff9c77
files src/combine.c src/diffmap.c src/mkcitymap.c src/mkloc.c src/patchmap.c src/stitchmap.c
diffstat 6 files changed, 51 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/src/combine.c	Sat Dec 16 15:34:15 2023 +0200
+++ b/src/combine.c	Tue Dec 26 02:31:17 2023 +0200
@@ -237,12 +237,12 @@
     // Parse arguments
     if (!th_args_process(argc, argv, optList, optListN,
         argHandleOpt, argHandleFile, OPTH_BAILOUT))
-        goto exit;
+        goto out;
 
     if (nsrcFiles < 1)
     {
         THERR("Nothing to do. (try --help)\n");
-        goto exit;
+        goto out;
     }
 
 
@@ -255,7 +255,7 @@
         {
             THERR("Error reading input file '%s'!\n",
                 file->filename);
-            goto exit;
+            goto out;
         }
 
         mapBlockClean(file->blk, (unsigned char *) " ", 1);
@@ -268,7 +268,7 @@
     if (nsrcFiles <= 0)
     {
         THERR("No maps, nothing to do.\n");
-        goto exit;
+        goto out;
     }
 
 
@@ -316,7 +316,7 @@
     if ((worldMap = mapBlockAlloc(worldW, worldH)) == NULL)
     {
         THERR("Error allocating world map!\n");
-        goto exit;
+        goto out;
     }
 
 
@@ -337,7 +337,7 @@
         {
             THERR("Mapblock #%d ['%s' @ %d,%d] placement failed!\n",
                 i, file->filename, file->blk->xc, file->blk->yc);
-            goto exit;
+            goto out;
         }
     }
 
@@ -356,7 +356,7 @@
         if ((tmpFile = fopen(dstFile, "wb")) == NULL)
         {
             THERR("Error opening output file '%s'!\n", dstFile);
-            goto exit;
+            goto out;
         }
 
         if (optInputIsDiff)
@@ -369,7 +369,7 @@
         THERR("No map generated?\n");
     }
 
-exit:
+out:
     mapBlockFree(worldMap);
 
     if (tmpFile != NULL)
--- a/src/diffmap.c	Sat Dec 16 15:34:15 2023 +0200
+++ b/src/diffmap.c	Tue Dec 26 02:31:17 2023 +0200
@@ -197,14 +197,14 @@
         argHandleOpt, argHandleFile, true))
     {
         res = 1;
-        goto exit;
+        goto out;
     }
 
     if (srcFilename1 == NULL || srcFilename2 == NULL)
     {
         THERR("Nothing to do. (try --help)\n");
         res = 1;
-        goto exit;
+        goto out;
     }
 
     // Read mapfiles
@@ -212,7 +212,7 @@
         (srcMap2 = mapBlockParseFile(srcFilename2, false)) == NULL)
     {
         res = 2;
-        goto exit;
+        goto out;
     }
 
     // Compute and output data
@@ -222,7 +222,7 @@
     {
         THERR("Could not create diff between inputs!\n");
         res = 3;
-        goto exit;
+        goto out;
     }
     THMSG(1, "%" PRIu_SIZE_T " differences.\n", count);
 
@@ -241,7 +241,7 @@
             THERR("Error opening output file '%s'!\n",
                 destFilename);
             res = 6;
-            goto exit;
+            goto out;
         }
 
         fprintf(outFile, DIFF_MAGIC "%d\n", DIFF_VERSION);
@@ -251,11 +251,11 @@
     else
     {
         THMSG(2, "Not outputting diff as no changes were found.\n");
-        goto exit;
+        goto out;
     }
 
 
-exit:
+out:
     if (outFile != NULL)
         fclose(outFile);
 
--- a/src/mkcitymap.c	Sat Dec 16 15:34:15 2023 +0200
+++ b/src/mkcitymap.c	Tue Dec 26 02:31:17 2023 +0200
@@ -388,7 +388,7 @@
     if (optMapFilename == NULL || optLocFilename == NULL)
     {
         THERR("You need to specify at least map and loc filenames. (try --help)\n");
-        goto exit;
+        goto out;
     }
 
     // Parse location file
@@ -397,11 +397,11 @@
     {
         THERR("Could not open location file '%s' for reading.\n",
             info.filename);
-        goto exit;
+        goto out;
     }
 
     if (!locParseLocStream(inFile, &info, &locations, info.xoffs, info.yoffs))
-        goto exit;
+        goto out;
 
 
     // Open mapfile
@@ -409,7 +409,7 @@
     {
         THERR("Error parsing/opening mapfile '%s'.\n",
             optMapFilename);
-        goto exit;
+        goto out;
     }
 
     if (optDestFilename == NULL)
@@ -419,7 +419,7 @@
     {
         THERR("Error opening output file '%s'!\n",
             optDestFilename);
-        goto exit;
+        goto out;
     }
 
     // Output data
@@ -428,7 +428,7 @@
     outputHTMLFooter(outFile, &locations);
 
 
-exit:
+out:
     // Close input and output files
     if (outFile != NULL && outFile != stdout)
         fclose(outFile);
--- a/src/mkloc.c	Sat Dec 16 15:34:15 2023 +0200
+++ b/src/mkloc.c	Tue Dec 26 02:31:17 2023 +0200
@@ -1154,31 +1154,31 @@
     // Parse arguments
     if (!th_args_process(argc, argv, optList, optListN,
         argHandleOpt, NULL, OPTH_BAILOUT))
-        goto exit;
+        goto out;
 
     // Check the mode and arguments
     if (optInFilename == NULL && optGetUpdateLoc && optOutput == OUTFMT_LOCFILE)
     {
         THERR("Map file required for location update mode!\n");
-        goto exit;
+        goto out;
     }
 
     if (optOutput == OUTFMT_LOCFILE && noptLocFiles < 0 && !optGetUpdateLoc)
     {
         THERR("Location file or location update mode required for location file output!\n");
-        goto exit;
+        goto out;
     }
 
     if ((optOutput == OUTFMT_SCRIPT || optOutput == OUTFMT_MAPLOC) && noptLocFiles < 0)
     {
         THERR("Location file required for script or MapLoc HTML output!\n");
-        goto exit;
+        goto out;
     }
 
     if (optInFilename == NULL && optOutput == OUTFMT_MAP)
     {
         THERR("Mapfile required for map generation.\n");
-        goto exit;
+        goto out;
     }
 
     // Read initial map
@@ -1189,7 +1189,7 @@
         if (worldMap == NULL)
         {
             THERR("World map could not be loaded!\n");
-            goto exit;
+            goto out;
         }
 
         THMSG(2, "Initial dimensions (%d x %d)\n", worldMap->width, worldMap->height);
@@ -1205,7 +1205,7 @@
         {
             THERR("Required continent name not set for #%d '%s'.\n",
                 i, f->filename);
-            goto exit;
+            goto out;
         }
 
         THMSG(2, "Reading location info '%s'\n", f->filename);
@@ -1213,11 +1213,11 @@
         {
             THERR("Could not open location file '%s' for reading.\n",
                 f->filename);
-            goto exit;
+            goto out;
         }
 
         if (!locParseLocStream(inFile, f, &worldLoc, f->xoffs, f->yoffs))
-            goto exit;
+            goto out;
 
         fclose(inFile);
     }
@@ -1248,7 +1248,7 @@
     {
         THERR("Error opening output file '%s'!\n",
             optOutFilename);
-        goto exit;
+        goto out;
     }
 
     // Output results
@@ -1294,7 +1294,7 @@
             break;
     }
 
-exit:
+out:
     if (outFile != NULL)
         fclose(outFile);
 
--- a/src/patchmap.c	Sat Dec 16 15:34:15 2023 +0200
+++ b/src/patchmap.c	Tue Dec 26 02:31:17 2023 +0200
@@ -106,14 +106,14 @@
         argHandleOpt, argHandleFile, OPTH_BAILOUT))
     {
         res = 1;
-        goto exit;
+        goto out;
     }
 
     if (mapFilename == NULL || patchFilename == NULL)
     {
         THERR("Nothing to do. (try --help)\n");
         res = 1;
-        goto exit;
+        goto out;
     }
 
     // Read map and patch file
@@ -121,7 +121,7 @@
         (patch = mapBlockParseFile(patchFilename, true)) == NULL)
     {
         res = 2;
-        goto exit;
+        goto out;
     }
 
     // Check map and diff sizes
@@ -132,7 +132,7 @@
             patch->width, patch->height);
 
         res = 2;
-        goto exit;
+        goto out;
     }
 
     // Generate
@@ -157,7 +157,7 @@
                 THERR("[%d,%d] invalid symbol index %d (%d) in patch\n",
                     xc+1, yc+1, *sp, i);
                 res = 7;
-                goto exit;
+                goto out;
             }
 
             if (*sp < 64)
@@ -182,12 +182,12 @@
         THERR("Error opening output file '%s'!\n",
             destFilename);
         res = 6;
-        goto exit;
+        goto out;
     }
 
     mapBlockPrint(outFile, map);
 
-exit:
+out:
     if (outFile != NULL)
         fclose(outFile);
 
--- a/src/stitchmap.c	Sat Dec 16 15:34:15 2023 +0200
+++ b/src/stitchmap.c	Tue Dec 26 02:31:17 2023 +0200
@@ -430,14 +430,14 @@
         argHandleOpt, argHandleFile, OPTH_BAILOUT))
     {
         res = 1;
-        goto exit;
+        goto out;
     }
 
     if (nsrcFiles < 1)
     {
         THERR("Nothing to do. (try --help)\n");
         res = 1;
-        goto exit;
+        goto out;
     }
 
     // Read initial map
@@ -456,7 +456,7 @@
         {
             THERR("Initial map could not be loaded!\n");
             res = 1;
-            goto exit;
+            goto out;
         }
     }
 
@@ -484,7 +484,7 @@
             THERR("Error opening input file '%s'!\n",
                 srcFiles[i]);
             res = 16;
-            goto exit;
+            goto out;
         }
 
         while (!feof(tmpFile))
@@ -506,7 +506,7 @@
                         fclose(tmpFile);
                         THERR("Could not allocate/extend mapblock pointer structure (#%d)\n", nmapBlocks);
                         res = 18;
-                        goto exit;
+                        goto out;
                     }
 
                     mapBlockClean(tmp, (unsigned char *) optCleanChars, strlen(optCleanChars));
@@ -524,7 +524,7 @@
     {
         THERR("No mapblocks, nothing to do.\n");
         res = 11;
-        goto exit;
+        goto out;
     }
 
 
@@ -580,7 +580,7 @@
     {
         THERR("Error allocating world map!\n");
         res = 4;
-        goto exit;
+        goto out;
     }
 
     // Place optional initial map
@@ -590,7 +590,7 @@
         {
             THERR("Initial map mapBlockPut() failed!\n");
             res = 9;
-            goto exit;
+            goto out;
         }
     }
     else
@@ -600,7 +600,7 @@
         {
             THERR("Initial map mapBlockPut() failed!\n");
             res = 9;
-            goto exit;
+            goto out;
         }
         mapBlocks[i]->mark = true;
     }
@@ -645,7 +645,7 @@
                         THERR("mapBlockPut(%d, %d, %d) failed!\n",
                             offsetX, offsetY, i);
                         res = 9;
-                        goto exit;
+                        goto out;
                     }
                     tmp->mark = true;
 
@@ -692,7 +692,7 @@
             THERR("Error opening output file '%s'!\n",
                 destFile);
             res = 1;
-            goto exit;
+            goto out;
         }
 
         mapBlockPrint(tmpFile, worldMap);
@@ -724,7 +724,7 @@
         res = 6;
     }
 
-exit:
+out:
     mapBlockFree(worldMap);
     mapBlockFree(initialMap);