summaryrefslogtreecommitdiff
path: root/uncompr.c
diff options
context:
space:
mode:
authorMika Lindqvist <postmaster@raasu.org>2017-11-12 22:53:50 +0200
committerHans Kristian Rosbach <hk-github@circlestorm.org>2018-02-16 15:48:06 +0100
commitcd3f3d6e68770584d24d6ab1092fd939525926aa (patch)
tree37551cf71ec0c2ad3a68b853a252dadfc4ee0dba /uncompr.c
parent5b2db1e2b18e6e7864fb81f26518ae7735d688ab (diff)
[compat] Use unsigned long for size parameters of compress/compressBound/uncompress
Diffstat (limited to 'uncompr.c')
-rw-r--r--uncompr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/uncompr.c b/uncompr.c
index f9dc95a..68a29cf 100644
--- a/uncompr.c
+++ b/uncompr.c
@@ -8,8 +8,10 @@
#define ZLIB_INTERNAL
#ifdef ZLIB_COMPAT
# include "zlib.h"
+# define z_size_t unsigned long
#else
# include "zlib-ng.h"
+# define z_size_t size_t
#endif
/* ===========================================================================
@@ -28,11 +30,11 @@
Z_DATA_ERROR if the input data was corrupted, including if the input data is
an incomplete zlib stream.
*/
-int ZEXPORT PREFIX(uncompress2)(unsigned char *dest, size_t *destLen, const unsigned char *source, size_t *sourceLen) {
+int ZEXPORT PREFIX(uncompress2)(unsigned char *dest, z_size_t *destLen, const unsigned char *source, z_size_t *sourceLen) {
PREFIX3(stream) stream;
int err;
const unsigned int max = (unsigned int)-1;
- size_t len, left;
+ z_size_t len, left;
unsigned char buf[1]; /* for detection of incomplete stream when *destLen == 0 */
len = *sourceLen;
@@ -82,7 +84,7 @@ int ZEXPORT PREFIX(uncompress2)(unsigned char *dest, size_t *destLen, const unsi
err;
}
-int ZEXPORT PREFIX(uncompress)(unsigned char *dest, size_t *destLen, const unsigned char *source, size_t sourceLen)
+int ZEXPORT PREFIX(uncompress)(unsigned char *dest, z_size_t *destLen, const unsigned char *source, z_size_t sourceLen)
{
return PREFIX(uncompress2)(dest, destLen, source, &sourceLen);
}