diff tools/lib64gfx.c @ 1922:3c6f638ce402

Remove the useless distinction of DO_ENC_FUNC and DO_DEC_FUNC, as the function pointers are separate anyway. Thus we now only have DO_FUNC.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 28 Jun 2018 01:24:07 +0300
parents f0225a52afce
children 42cd527a01b9
line wrap: on
line diff
--- a/tools/lib64gfx.c	Wed Jun 27 19:13:36 2018 +0300
+++ b/tools/lib64gfx.c	Thu Jun 28 01:24:07 2018 +0300
@@ -751,8 +751,7 @@
             break;
 
         // Just list the allowed ops here
-        case DO_DEC_FUNC:
-        case DO_ENC_FUNC:
+        case DO_FUNC:
         case DO_CHAR_CFG:
         case DO_LAST:
             break;
@@ -1014,15 +1013,9 @@
                 }
                 break;
 
-            case DO_DEC_FUNC:
-                if (op->decFunction == NULL)
-                {
-                    return dmError(DMERR_INTERNAL,
-                        "Decode 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, buf->len, buf->len);
-                }
-                if (!op->decFunction(img, op, buf, fmt))
+            case DO_FUNC:
+                if (op->decFunction != NULL &&
+                    !op->decFunction(img, op, buf, fmt))
                 {
                     return dmError(DMERR_INTERNAL,
                         "Decode op custom function failed: op #%d, "
@@ -1187,16 +1180,9 @@
                 }
                 break;
 
-            case DO_ENC_FUNC:
-                if (op->encFunction == NULL)
-                {
-                    res = dmError(DMERR_INTERNAL,
-                        "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, buf->len, buf->len);
-                    goto err;
-                }
-                if (!op->encFunction(op, buf, img, fmt))
+            case DO_FUNC:
+                if (op->encFunction != NULL &&
+                    !op->encFunction(op, buf, img, fmt))
                 {
                     res = dmError(DMERR_INTERNAL,
                         "Encode op custom function failed: op #%d, "