Mercurial > hg > dmlib
diff src/dmzlib.c @ 1167:848a88ce7a57
Use dmMemset().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 05 Mar 2015 07:37:35 +0200 |
parents | d0898867ec4c |
children | 749f8f808531 |
line wrap: on
line diff
--- a/src/dmzlib.c Thu Mar 05 07:36:51 2015 +0200 +++ b/src/dmzlib.c Thu Mar 05 07:37:35 2015 +0200 @@ -92,8 +92,8 @@ int i, k = 0; int code, nextCode[16], sizes[17]; - memset(sizes, 0, sizeof(sizes)); - memset(ctx->fast, 0, sizeof(ctx->fast)); + dmMemset(sizes, 0, sizeof(sizes)); + dmMemset(ctx->fast, 0, sizeof(ctx->fast)); for (i = 0; i < num; i++) sizes[sizelist[i]]++; @@ -407,7 +407,7 @@ // Get lengths table (uninitialized entries should be set to 0) codeLengths[256] = 0; - memset(codeLengthSizes, 0, sizeof(codeLengthSizes)); + dmMemset(codeLengthSizes, 0, sizeof(codeLengthSizes)); for (i = 0; i < hclen; i++) { int s = dmZReceive(ctx, 3); @@ -442,20 +442,20 @@ return dmErrorDBG(DMERR_INVALID_DATA, "Invalid bit length repeat.\n"); } - memset(codeLengths + n, codeLengths[n - 1], bv); + dmMemset(codeLengths + n, codeLengths[n - 1], bv); n += bv; } else if (c == 17) { int bv = dmZReceive(ctx, 3) + 3; - memset(codeLengths + n, 0, bv); + dmMemset(codeLengths + n, 0, bv); n += bv; } else { int bv = dmZReceive(ctx, 7) + 11; - memset(codeLengths + n, 0, bv); + dmMemset(codeLengths + n, 0, bv); n += bv; } } @@ -554,7 +554,7 @@ if (ctx == NULL) return DMERR_NULLPTR; - memset(ctx, 0, sizeof(DMZLibContext)); + dmMemset(ctx, 0, sizeof(DMZLibContext)); return DMERR_OK; } @@ -563,7 +563,7 @@ { if (ctx != NULL) { - memset(ctx, 0, sizeof(DMZLibContext)); + dmMemset(ctx, 0, sizeof(DMZLibContext)); } }