changeset 1058:e51ec592bfb6

Rename a macro.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 01 Mar 2015 23:28:40 +0200
parents eb2d14546a0e
children df35244490e8
files src/dmzlib.c
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/dmzlib.c	Sun Mar 01 23:15:20 2015 +0200
+++ b/src/dmzlib.c	Sun Mar 01 23:28:40 2015 +0200
@@ -13,7 +13,7 @@
 
 
 #define DM_ZLIB_TMPBUF_SIZE (16 * 1024)
-#define DMSTBI_ASSERT(x) // dummy
+#define DMZLIB_ASSERT(x) //do { printf("%s: %d\n", # x, x); } while (0) // dummy
 
 
 // @TODO: should statically initialize these for optimal thread safety
@@ -61,6 +61,7 @@
 {
     dmFree(dm_zdefault_length);
     dm_zdefault_length = NULL;
+
     dmFree(dm_zdefault_distance);
     dm_zdefault_distance = NULL;
 }
@@ -81,7 +82,7 @@
 // e.g. 11 bits, bit reverse and shift away 5
 static inline int dmBitReverseN(int v, const int bits)
 {
-    DMSTBI_ASSERT(bits <= 16);
+    DMZLIB_ASSERT(bits <= 16);
     return dmBitReverse16(v) >> (16 - bits);
 }
 
@@ -166,7 +167,7 @@
 {
     do
     {
-        DMSTBI_ASSERT(ctx->codeBuffer < (1U << ctx->numBits));
+        DMZLIB_ASSERT(ctx->codeBuffer < (1U << ctx->numBits));
         ctx->codeBuffer |= dmZGet8(ctx) << ctx->numBits;
         ctx->numBits += 8;
     }
@@ -211,7 +212,7 @@
 
     // code size is s, so:
     b = (k >> (16 - s)) - huff->firstCode[s] + huff->firstSymbol[s];
-    DMSTBI_ASSERT(huff->size[b] == s);
+    DMZLIB_ASSERT(huff->size[b] == s);
 
     ctx->codeBuffer >>= s;
     ctx->numBits -= s;
@@ -409,7 +410,7 @@
         if ((ret = dmZLibHuffmanDecode(ctx, &z_codelength, &c)) != DMERR_OK)
             return ret;
 
-        DMSTBI_ASSERT(c >= 0 && c < DM_ZLIB_NCODELENGTH_SIZES);
+        DMZLIB_ASSERT(c >= 0 && c < DM_ZLIB_NCODELENGTH_SIZES);
 
         if (c < 16)
             codeLengths[n++] = (Uint8) c;
@@ -468,7 +469,7 @@
         ctx->codeBuffer >>= 8;
         ctx->numBits -= 8;
     }
-    DMSTBI_ASSERT(ctx->numBits == 0);
+    DMZLIB_ASSERT(ctx->numBits == 0);
 
     // now fill header the normal way
     while (k < 4)