# HG changeset patch # User Matti Hamalainen # Date 1425247325 -7200 # Node ID 5006cfe66250e54b7c52f58f99b4f048f29fa5fc # Parent df35244490e89e470be86d510b4527f7b6eb4111 Rename constants. diff -r df35244490e8 -r 5006cfe66250 src/dmzlib.c --- a/src/dmzlib.c Mon Mar 02 00:01:14 2015 +0200 +++ b/src/dmzlib.c Mon Mar 02 00:02:05 2015 +0200 @@ -137,10 +137,10 @@ Uint16 fastv = (Uint16) ((s << 9) | i); ctx->size[c] = (Uint8) s; ctx->value[c] = (Uint16) i; - if (s <= STBI__ZFAST_BITS) + if (s <= DM_ZLIB_HFAST_BITS) { - int k = dmBitReverseN(next_code[s], s); - while (k < STBI__ZFAST_SIZE) + int k = dmBitReverseN(nextCode[s], s); + while (k < DM_ZLIB_HFAST_SIZE) { ctx->fast[k] = fastv; k += (1 << s); @@ -198,7 +198,7 @@ // not resolved by fast table, so compute it the slow way // use jpeg approach, which requires MSbits at top k = dmBitReverse16(ctx->codeBuffer); - for (s = STBI__ZFAST_BITS + 1; ; s++) + for (s = DM_ZLIB_HFAST_BITS + 1; ; s++) { if (k < huff->maxCode[s]) break; @@ -228,7 +228,7 @@ if (ctx->numBits < 16) dmZFillBits(ctx); - b = huff->fast[ctx->codeBuffer & STBI__ZFAST_MASK]; + b = huff->fast[ctx->codeBuffer & DM_ZLIB_HFAST_MASK]; if (b) { int s = b >> 9; diff -r df35244490e8 -r 5006cfe66250 src/dmzlib.h --- a/src/dmzlib.h Mon Mar 02 00:01:14 2015 +0200 +++ b/src/dmzlib.h Mon Mar 02 00:02:05 2015 +0200 @@ -14,14 +14,14 @@ #endif -#define STBI__ZFAST_BITS 9 // accelerate all cases in default tables -#define STBI__ZFAST_SIZE (1 << STBI__ZFAST_BITS) -#define STBI__ZFAST_MASK (STBI__ZFAST_SIZE - 1) +#define DM_ZLIB_HFAST_BITS 9 // accelerate all cases in default tables +#define DM_ZLIB_HFAST_SIZE (1 << DM_ZLIB_HFAST_BITS) +#define DM_ZLIB_HFAST_MASK (DM_ZLIB_HFAST_SIZE - 1) typedef struct { - Uint16 fast[STBI__ZFAST_SIZE]; + Uint16 fast[DM_ZLIB_HFAST_SIZE]; Uint16 firstCode[16]; int maxCode[17]; Uint16 firstSymbol[16];