# HG changeset patch # User Matti Hamalainen # Date 1425007927 -7200 # Node ID 14b82bd5a408141569195005c1d7a5979d697d85 # Parent b522067e2beb7252a502888649b1ead13dcf6bff Rename some functions. diff -r b522067e2beb -r 14b82bd5a408 src/dmzlib.c --- a/src/dmzlib.c Fri Feb 27 05:27:43 2015 +0200 +++ b/src/dmzlib.c Fri Feb 27 05:32:07 2015 +0200 @@ -133,7 +133,7 @@ } -static void stbi__fill_bits(DMZLibContext * ctx) +static void dmZFillBits(DMZLibContext * ctx) { do { @@ -150,7 +150,7 @@ unsigned int val; if (ctx->numBits < n) - stbi__fill_bits(ctx); + dmZFillBits(ctx); val = ctx->codeBuffer & ((1 << n) - 1); ctx->codeBuffer >>= n; @@ -160,7 +160,7 @@ } -static int stbi__zhuffman_decode_slowpath(DMZLibContext * ctx, DMZHuffmanContext * huff, int *val) +static int dmZLibHuffmanDecodeSlow(DMZLibContext * ctx, DMZHuffmanContext * huff, int *val) { int b, s, k; *val = 0; @@ -192,11 +192,11 @@ } -static inline int stbi__zhuffman_decode(DMZLibContext * ctx, DMZHuffmanContext * huff, int *val) +static inline int dmZLibHuffmanDecode(DMZLibContext * ctx, DMZHuffmanContext * huff, int *val) { int b; if (ctx->numBits < 16) - stbi__fill_bits(ctx); + dmZFillBits(ctx); b = huff->fast[ctx->codeBuffer & STBI__ZFAST_MASK]; if (b) @@ -208,11 +208,11 @@ return DMERR_OK; } - return stbi__zhuffman_decode_slowpath(ctx, huff, val); + return dmZLibHuffmanDecodeSlow(ctx, huff, val); } -static int stbi__zexpand(DMZLibContext * ctx, Uint8 *zout, size_t n) +static int dmZLibExpand(DMZLibContext * ctx, Uint8 *zout, size_t n) { Uint8 *newBuf; size_t cur, limit; @@ -225,7 +225,7 @@ "Output buffer limit hit, and is not expandable.\n"); } - cur = ctx->zout - ctx->zoutStart; + cur = ctx->zout - ctx->zoutStart; limit = ctx->zoutEnd - ctx->zoutStart; while (cur + n > limit) @@ -278,14 +278,14 @@ for (;;) { int z, ret; - if ((ret = stbi__zhuffman_decode(a, &a->zlength, &z)) != DMERR_OK) + if ((ret = dmZLibHuffmanDecode(a, &a->zlength, &z)) != DMERR_OK) return ret; if (z < 256) { if (zout >= a->zoutEnd) { - if ((ret = stbi__zexpand(a, zout, 1)) != DMERR_OK) + if ((ret = dmZLibExpand(a, zout, 1)) != DMERR_OK) return ret; zout = a->zout; @@ -307,7 +307,7 @@ if (stbi__zlength_extra[z]) len += dmZReceive(a, stbi__zlength_extra[z]); - if ((ret = stbi__zhuffman_decode(a, &a->zdistance, &z)) != DMERR_OK) + if ((ret = dmZLibHuffmanDecode(a, &a->zdistance, &z)) != DMERR_OK) return ret; dist = stbi__zdist_base[z]; @@ -322,7 +322,7 @@ if (zout + len > a->zoutEnd) { - if (!stbi__zexpand(a, zout, len)) + if (!dmZLibExpand(a, zout, len)) return 0; zout = a->zout; } @@ -375,7 +375,7 @@ while (n < hlit + hdist) { int c; - if ((ret = stbi__zhuffman_decode(a, &z_codelength, &c)) != DMERR_OK) + if ((ret = dmZLibHuffmanDecode(a, &z_codelength, &c)) != DMERR_OK) return ret; DMSTBI_ASSERT(c >= 0 && c < 19); @@ -458,7 +458,7 @@ } if (ctx->zout + len > ctx->zoutEnd && - (ret = stbi__zexpand(ctx, ctx->zout, len)) != DMERR_OK) + (ret = dmZLibExpand(ctx, ctx->zout, len)) != DMERR_OK) { return dmError(DMERR_DATA_ERROR, "Failed to decompress enough data: %d, %s\n",