Mercurial > hg > dmlib
changeset 2074:8cd012260976
Fix a bunch of warnings.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 10 Dec 2018 12:55:29 +0200 |
parents | 1ad8382e3670 |
children | 2ca6a13b091b |
files | tests/encbr1test.c |
diffstat | 1 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/encbr1test.c Wed Dec 05 17:43:08 2018 +0200 +++ b/tests/encbr1test.c Mon Dec 10 12:55:29 2018 +0200 @@ -35,7 +35,9 @@ if (count <= 0) return TRUE; + #if BR_DEBUG != 0 || defined(BR_WRITE) Uint8 tmp = count - 1; + #endif #if BR_DEBUG == 2 printf("L: %02x ", tmp); @@ -52,6 +54,8 @@ if (!dmf_write_byte(fp, tmp) || !dmf_write_str(fp, buf + offs, count)) return FALSE; + #else + (void) fp; #endif return TRUE; @@ -65,8 +69,10 @@ if (count <= 0) return TRUE; + #if BR_DEBUG != 0 || defined(BR_WRITE) Uint8 tmp = ((Uint8) count - 2) ^ 0xff; Uint8 data = buf[offs]; + #endif #if BR_DEBUG == 2 printf("R: %02x %02x [%" DM_PRIu_SIZE_T "]\n", tmp, data, count); @@ -74,10 +80,13 @@ mprintbyte(tmp); mprintbyte(data); #endif + #ifdef BR_WRITE if (!dmf_write_byte(fp, tmp) || !dmf_write_byte(fp, data)) return FALSE; + #else + (void) fp; #endif return TRUE; @@ -221,7 +230,7 @@ int cnt = 0; for (size_t xc = 0; xc < sizeof(test); xc++) { - if (cnt == 0) printf("%04x | ", xc); + if (cnt == 0) printf("%04" DM_PRIx_SIZE_T " | ", xc); printf("%02x ", *(test + xc)); if (cnt++ >= 15) { printf("\n"); cnt = 0; } }