changeset 2198:c26a51ea70be

Replace label 'error' with 'exit'.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 13 Jun 2019 23:58:46 +0300
parents 23dd0e0fe25d
children f331cc750b37
files tools/gfxconv.c
diffstat 1 files changed, 17 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/tools/gfxconv.c	Thu Jun 13 22:10:02 2019 +0300
+++ b/tools/gfxconv.c	Thu Jun 13 23:58:46 2019 +0300
@@ -1976,7 +1976,7 @@
         {
             dmErrorMsg("Standard input cannot be used without specifying input format.\n");
             dmErrorMsg("Perhaps you should try using --help\n");
-            goto error;
+            goto exit;
         }
         inFile = stdin;
         optInFilename = "stdin";
@@ -1987,7 +1987,7 @@
         res = dmGetErrno();
         dmErrorMsg("Error opening input file '%s', %d: %s\n",
               optInFilename, res, dmErrorStr(res));
-        goto error;
+        goto exit;
     }
 
     // Determine output format, if not specified
@@ -2014,7 +2014,7 @@
     if ((res = dmReadDataFile(inFile, NULL, &dataBufOrig, &dataSizeOrig)) != DMERR_OK)
     {
         dmErrorMsg("Could not read input: %s.\n", dmErrorStr(res));
-        goto error;
+        goto exit;
     }
 
     fclose(inFile);
@@ -2024,7 +2024,7 @@
     {
         dmErrorMsg("Input skip value %d (0x%x) is larger than input size %" DM_PRIu_SIZE_T ".\n",
             optInSkip, optInSkip, dataSizeOrig);
-        goto error;
+        goto exit;
     }
 
     if (optInSkipNeg)
@@ -2083,7 +2083,7 @@
         if (res != DMERR_OK && (forced != NULL || optInType == FFMT_BITMAP))
         {
             dmErrorMsg("Could not decode input image: %s.\n", dmErrorStr(res));
-            goto error;
+            goto exit;
         }
     }
 
@@ -2103,7 +2103,7 @@
     if (optInType == FFMT_AUTO)
     {
         dmErrorMsg("No input format specified, and could not be determined automatically.\n");
-        goto error;
+        goto exit;
     }
 
     if (dmGetConvFormat(optInType, optInFormat, &inFormat) &&
@@ -2148,7 +2148,7 @@
             if (optOutFilename == NULL)
             {
                 dmErrorMsg("Output filename not set, required for bitmap formats.\n");
-                goto error;
+                goto exit;
             }
 
             switch (optOutType)
@@ -2174,7 +2174,7 @@
                         {
                             dmErrorMsg("Could not read character ROM from '%s'.\n",
                                 optCharROMFilename);
-                            goto error;
+                            goto exit;
                         }
                     }
 
@@ -2184,7 +2184,7 @@
                     if (res != DMERR_OK || outImage == NULL)
                     {
                         dmErrorMsg("Error in bitmap to image conversion.\n");
-                        goto error;
+                        goto exit;
                     }
 
                     switch (optOutType)
@@ -2207,7 +2207,7 @@
                         &dmC64ImageFormats[optOutFormat], inC64Fmt)) != DMERR_OK)
                     {
                         dmErrorMsg("Error in bitmap format conversion.\n");
-                        goto error;
+                        goto exit;
                     }
                     if (dmVerbosity >= 2)
                     {
@@ -2231,13 +2231,13 @@
                 if (optOutFilename == NULL)
                 {
                     dmErrorMsg("Output filename not set, required for image formats.\n");
-                    goto error;
+                    goto exit;
                 }
 
                 if ((res = dmf_open_memio(NULL, optInFilename, dataBuf, dataSize, &fp)) != DMERR_OK)
                 {
                     dmErrorMsg("Could not create MemIO handle for input.\n");
-                    goto error;
+                    goto exit;
                 }
 
                 // Read input
@@ -2249,7 +2249,7 @@
                 dmf_close(fp);
 
                 if (res != DMERR_OK || inImage == NULL)
-                    goto error;
+                    goto exit;
 
                 switch (optOutType)
                 {
@@ -2275,7 +2275,7 @@
                                 dmC64ImageFree(tmpC64Image);
                                 dmErrorMsg("Error in image to bitmap conversion: %s\n",
                                     dmErrorStr(res));
-                                goto error;
+                                goto exit;
                             }
 
                             if ((res = dmConvertC64Bitmap(&outC64Image, tmpC64Image,
@@ -2284,7 +2284,7 @@
                                 dmC64ImageFree(tmpC64Image);
                                 dmErrorMsg("Error in bitmap format conversion: %s\n",
                                     dmErrorStr(res));
-                                goto error;
+                                goto exit;
                             }
 
                             res = dmWriteBitmap(optOutFilename, outC64Image, &dmC64ImageFormats[optOutFormat]);
@@ -2306,7 +2306,8 @@
             break;
     }
 
-error:
+exit:
+    // Cleanup
     dmFree(convFormatList);
     dmFree(dataBufOrig);
     dmC64ImageFree(inC64Image);