changeset 1447:de5f7e31a8bf

Rename labels.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 10 May 2018 05:15:25 +0300
parents 948b32bd67ef
children 50402c225ef4
files tools/lib64gfx.c
diffstat 1 files changed, 9 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64gfx.c	Thu May 10 04:57:48 2018 +0300
+++ b/tools/lib64gfx.c	Thu May 10 05:15:25 2018 +0300
@@ -1278,7 +1278,7 @@
         return dmError(DMERR_MALLOC,
             "Could not allocate %d bytes of memory for C64 image encoding buffer.\n",
             allocated);
-        goto error;
+        goto err;
     }
 
     // Perform encoding
@@ -1294,7 +1294,7 @@
 
         // Check operation validity
         if ((res = dmC64SanityCheckEncDecOp(i, op, img)) != DMERR_OK)
-            goto error;
+            goto err;
 
         // Check size
         if (!dmC64GetOpSize(op, fmt, &size))
@@ -1303,7 +1303,7 @@
                 "Decode op SIZE out of bounds, op #%d type=%d, offs=%d ($%04x), "
                 "bank=%d, size=%d ($%04x) vs. allocated %d ($%04x)\n",
                 i, op->type, op->offs, op->offs, op->bank, size, size, op->size, op->size);
-            goto error;
+            goto err;
         }
 
         // Do we need to reallocate some more space?
@@ -1320,7 +1320,7 @@
                 res = dmError(DMERR_MALLOC,
                     "Could not re-allocate %d bytes of memory for C64 image encoding buffer.\n",
                     allocated);
-                goto error;
+                goto err;
             }
         }
 
@@ -1341,7 +1341,7 @@
                         "DT_EXTRA_DATA block is NULL in ",
                         "op #%d, offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n",
                         i, op->offs, op->offs, op->bank, size, size, *plen, *plen);
-                    goto error;
+                    goto err;
                 }
                 if (size > img->extraDataSizes[op->bank])
                 {
@@ -1349,7 +1349,7 @@
                         "DT_EXTRA_DATA size mismatch %d <> %d in ",
                         "op #%d, offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n",
                         op->size, img->extraDataSizes[op->bank], i, op->offs, op->offs, op->bank, size, size, *plen, *plen);
-                    goto error;
+                    goto err;
                 }
                 memcpy(dst, img->extraData[op->bank], size);
                 break;
@@ -1368,7 +1368,7 @@
                             "Unhandled DT_COLOR_REG mode %d in ",
                             "op #%d, offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n",
                             op->size, i, op->offs, op->offs, op->bank, size, size, *plen, *plen);
-                        goto error;
+                        goto err;
                 }
                 break;
 
@@ -1379,7 +1379,7 @@
                         "Encode op is a function, but function ptr is NULL: "
                         "op #%d, offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n",
                         i, op->offs, op->offs, op->bank, size, size, *plen, *plen);
-                    goto error;
+                    goto err;
                 }
                 /*
                 if (!op->encfunction(op, buf, len))
@@ -1398,13 +1398,8 @@
     buf[0] = DM_GET_ADDR_LO(fmt->addr);
     buf[1] = DM_GET_ADDR_HI(fmt->addr);
 
+err:
     *pbuf = buf;
-    return DMERR_OK;
-
-error:
-    dmFree(buf);
-    *pbuf = NULL;
-    *plen = 0;
     return res;
 }