Mercurial > hg > dmlib
diff tests/encbr1test.c @ 2586:9807ae37ad69
Require stdbool.h, we require C11 now.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 08 Dec 2022 15:59:22 +0200 |
parents | 8cd012260976 |
children |
line wrap: on
line diff
--- a/tests/encbr1test.c Thu Dec 08 15:56:36 2022 +0200 +++ b/tests/encbr1test.c Thu Dec 08 15:59:22 2022 +0200 @@ -28,12 +28,12 @@ #endif -BOOL dmIFFEncodeByteRun1LIT(DMResource *fp, +bool dmIFFEncodeByteRun1LIT(DMResource *fp, const Uint8 *buf, const size_t offs, const size_t count) { if (count <= 0) - return TRUE; + return true; #if BR_DEBUG != 0 || defined(BR_WRITE) Uint8 tmp = count - 1; @@ -53,21 +53,21 @@ #ifdef BR_WRITE if (!dmf_write_byte(fp, tmp) || !dmf_write_str(fp, buf + offs, count)) - return FALSE; + return false; #else (void) fp; #endif - return TRUE; + return true; } -BOOL dmIFFEncodeByteRun1RLE(DMResource *fp, +bool dmIFFEncodeByteRun1RLE(DMResource *fp, const Uint8 *buf, const size_t offs, const size_t count) { if (count <= 0) - return TRUE; + return true; #if BR_DEBUG != 0 || defined(BR_WRITE) Uint8 tmp = ((Uint8) count - 2) ^ 0xff; @@ -84,20 +84,20 @@ #ifdef BR_WRITE if (!dmf_write_byte(fp, tmp) || !dmf_write_byte(fp, data)) - return FALSE; + return false; #else (void) fp; #endif - return TRUE; + return true; } -BOOL dmIFFEncodeByteRun1Row(DMResource *fp, const Uint8 *buf, const size_t bufLen) +bool dmIFFEncodeByteRun1Row(DMResource *fp, const Uint8 *buf, const size_t bufLen) { int prev = -1, mode = DMODE_LIT; size_t offs, l_offs, r_offs; - BOOL ret = TRUE; + bool ret = true; #if BR_DEBUG == 1 mcount = 0; @@ -106,7 +106,7 @@ for (offs = l_offs = r_offs = 0; offs < bufLen; offs++) { Uint8 data = buf[offs]; - BOOL flush = FALSE; + bool flush = false; int pmode = mode; if (data == prev) @@ -144,7 +144,7 @@ if ((pmode == DMODE_RLE && offs - r_offs >= 128) || (pmode == DMODE_LIT && offs - l_offs >= 128)) { - flush = TRUE; + flush = true; #if BR_DEBUG == 2 printf(" <LEN FLUSH>"); #endif @@ -154,7 +154,7 @@ if (offs == bufLen - 1) { offs++; - flush = TRUE; + flush = true; pmode = mode; #if BR_DEBUG == 2 printf(" <FINAL FLUSH>");