diff tools/lib64fmts.c @ 1697:1036b0dcccb5

Refactor DMGrowBuf so that there can be buffers that grow "backwards". This also removes some support functions like the buffer state push/pop.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 05 Jun 2018 12:55:17 +0300
parents e7990551c6d6
children a0986cfd6f9d
line wrap: on
line diff
--- a/tools/lib64fmts.c	Tue Jun 05 11:36:55 2018 +0300
+++ b/tools/lib64fmts.c	Tue Jun 05 12:55:17 2018 +0300
@@ -146,7 +146,7 @@
     dmGenericRLEAnalyze(tmp.data, tmp.len, &cfg);
 
     // Add the header bits
-    if (!dmGrowBufPut(buf, magicID, strlen(magicID)) ||
+    if (!dmGrowBufPut(buf, (Uint8 *) magicID, strlen(magicID)) ||
         !dmGrowBufPutU8(buf, cfg.rleMarkerB))
     {
         res = DMERR_MALLOC;
@@ -248,7 +248,7 @@
     dmGenericRLEAnalyze(tmp.data, tmp.len, &cfg);
 
     // Add the header bits
-    if (!dmGrowBufPut(buf, fmtBDP5MagicID, strlen(fmtBDP5MagicID)) ||
+    if (!dmGrowBufPut(buf, (Uint8 *) fmtBDP5MagicID, strlen(fmtBDP5MagicID)) ||
         !dmGrowBufPutU8(buf, cfg.rleMarkerB) ||
         !dmGrowBufPutU8(buf, cfg.rleMarkerW))
     {
@@ -612,7 +612,7 @@
 static int fmtEncodeFunPaint2Unpacked(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt)
 {
     // Add the header bits
-    if (!dmGrowBufPut(buf, fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) ||
+    if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) ||
         !dmGrowBufPutU8(buf, 0))
         return DMERR_MALLOC;
 
@@ -639,7 +639,7 @@
     dmGenericRLEAnalyze(tmp.data, tmp.len, &cfg);
 
     // Add the header bits
-    if (!dmGrowBufPut(buf, fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) ||
+    if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) ||
         !dmGrowBufPutU8(buf, cfg.rleMarkerB))
     {
         res = DMERR_MALLOC;