# HG changeset patch # User Matti Hamalainen # Date 1425170358 -7200 # Node ID aeafd6d444655087dc9222594ac7663681cf678c # Parent e8de4fbc03b6b9f40a5cac7f1194c3ab4bd465a0 Move and rename a constant define. diff -r e8de4fbc03b6 -r aeafd6d44465 src/dmpack.h --- a/src/dmpack.h Sat Feb 28 15:59:39 2015 +0200 +++ b/src/dmpack.h Sun Mar 01 02:39:18 2015 +0200 @@ -11,7 +11,6 @@ #define DPACK_IDENT "TNSPDPCK" // Magic ident #define DPACK_VERSION (0x0120) // Version -#define DPACK_TMPSIZE (128 * 1024) typedef struct _DMPackEntry diff -r e8de4fbc03b6 -r aeafd6d44465 src/dmres.c --- a/src/dmres.c Sat Feb 28 15:59:39 2015 +0200 +++ b/src/dmres.c Sun Mar 01 02:39:18 2015 +0200 @@ -334,6 +334,8 @@ #ifdef DM_USE_ZLIB +#define DMRES_TMPBUF_SIZE (128 * 1024) + static int dm_pack_decompress(DMResource *handle, DMPackEntry *node) { int res = DMERR_OK, cres, cdataLeft; @@ -341,7 +343,7 @@ Uint8 * cbuffer = NULL; // Allocate a structures and buffers - cbuffer = (Uint8 *) dmMalloc(DPACK_TMPSIZE); + cbuffer = (Uint8 *) dmMalloc(DMRES_TMPBUF_SIZE); if (cbuffer == NULL) { res = DMERR_MALLOC; @@ -379,7 +381,7 @@ { cstream.avail_in = fread( cbuffer, sizeof(Uint8), - (cdataLeft >= DPACK_TMPSIZE) ? DPACK_TMPSIZE : cdataLeft, + (cdataLeft >= DMRES_TMPBUF_SIZE) ? DMRES_TMPBUF_SIZE : cdataLeft, handle->lib->packFile->file); cdataLeft -= cstream.avail_in;