diff tools/lib64gfx.c @ 2114:27cf33c3a646

Return actual error code from enc and dec functions instead of just BOOL.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 26 May 2019 02:43:08 +0300
parents 3fcf1c3a3287
children 51b8826bd4c1
line wrap: on
line diff
--- a/tools/lib64gfx.c	Sun May 26 01:16:57 2019 +0300
+++ b/tools/lib64gfx.c	Sun May 26 02:43:08 2019 +0300
@@ -1056,9 +1056,9 @@
 
             case DO_FUNC:
                 if (op->decFunction != NULL &&
-                    !op->decFunction(op, img, buf, fmt->format))
+                    (res = op->decFunction(op, img, buf, fmt->format)) != DMERR_OK)
                 {
-                    return dmError(DMERR_INTERNAL,
+                    return dmError(res,
                         "Decode op custom function failed: 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);
@@ -1236,9 +1236,9 @@
 
             case DO_FUNC:
                 if (op->encFunction != NULL &&
-                    !op->encFunction(op, buf, img, fmt->format))
+                    (res = op->encFunction(op, buf, img, fmt->format)) != DMERR_OK)
                 {
-                    res = dmError(DMERR_INTERNAL,
+                    dmErrorMsg(
                         "Encode op custom function failed: 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);