diff tools/lib64fmts.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 88d37ec1b4d6
line wrap: on
line diff
--- a/tools/lib64fmts.c	Sun May 26 01:16:57 2019 +0300
+++ b/tools/lib64fmts.c	Sun May 26 02:43:08 2019 +0300
@@ -47,7 +47,7 @@
 }
 
 
-static BOOL fmtEncodeMicroIllustrator(const DMC64EncDecOp *op, DMGrowBuf *buf,
+static int fmtEncodeMicroIllustrator(const DMC64EncDecOp *op, DMGrowBuf *buf,
     const DMC64Image *img, const DMC64ImageCommonFormat *fmt)
 {
     (void) op;
@@ -57,7 +57,7 @@
     memcpy(buf->data + 2, fmtMicroIllustratorMagicID_1, sizeof(fmtMicroIllustratorMagicID_1));
     memcpy(buf->data + 9, fmtMicroIllustratorMagicID_2, sizeof(fmtMicroIllustratorMagicID_2));
 
-    return TRUE;
+    return DMERR_OK;
 }
 
 
@@ -242,7 +242,7 @@
 }
 
 
-static BOOL fmtDrazLaceGetLaceType(const DMC64EncDecOp *op, DMC64Image *img,
+static int fmtDrazLaceGetLaceType(const DMC64EncDecOp *op, DMC64Image *img,
     const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt)
 {
     (void) fmt;
@@ -252,16 +252,16 @@
     else
         img->laceType = D64_ILACE_RES;
 
-    return TRUE;
+    return DMERR_OK;
 }
 
 
-static BOOL fmtDrazLaceSetLaceType(const DMC64EncDecOp *op, DMGrowBuf *buf,
+static int fmtDrazLaceSetLaceType(const DMC64EncDecOp *op, DMGrowBuf *buf,
     const DMC64Image *img, const DMC64ImageCommonFormat *fmt)
 {
     (void) fmt;
     buf->data[op->offs] = (img->laceType == D64_ILACE_RES) ? 1 : 0;
-    return TRUE;
+    return DMERR_OK;
 }
 
 
@@ -364,16 +364,18 @@
 }
 
 
-static BOOL fmtEncodeGunPaint(const DMC64EncDecOp *op, DMGrowBuf *buf,
+static int fmtEncodeGunPaint(const DMC64EncDecOp *op, DMGrowBuf *buf,
     const DMC64Image *img, const DMC64ImageCommonFormat *fmt)
 {
     (void) op;
     (void) img;
     (void) fmt;
+
     // Here we assume that the op triggering this function is
     // at the end of the oplist, so the memory is allocated,
     memcpy(buf->data + fmtGunPaintMagicOffs + 2, fmtGunPaintMagicID, fmtGunPaintMagicLen);
-    return TRUE;
+
+    return DMERR_OK;
 }
 
 
@@ -577,14 +579,14 @@
 }
 
 
-static BOOL fmtTruePaintGetLaceType(const DMC64EncDecOp *op, DMC64Image *img,
+static int fmtTruePaintGetLaceType(const DMC64EncDecOp *op, DMC64Image *img,
     const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt)
 {
     (void) op;
     (void) buf;
     (void) fmt;
     img->laceType = D64_ILACE_RES;
-    return TRUE;
+    return DMERR_OK;
 }
 
 
@@ -961,14 +963,14 @@
 }
 
 
-static BOOL fmtECIGetLaceType(const DMC64EncDecOp *op, DMC64Image *img,
+static int fmtECIGetLaceType(const DMC64EncDecOp *op, DMC64Image *img,
     const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt)
 {
     (void) op;
     (void) buf;
     (void) fmt;
     img->laceType = D64_ILACE_COLOR;
-    return TRUE;
+    return DMERR_OK;
 }