diff src/dmres.c @ 995:aeafd6d44465

Move and rename a constant define.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 01 Mar 2015 02:39:18 +0200
parents 5bcd219ddde3
children ffd1ca99e456
line wrap: on
line diff
--- 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;