summaryrefslogtreecommitdiff
path: root/win32/zlib/compress.c
diff options
context:
space:
mode:
authorSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2014-02-15 23:13:33 +0000
committerSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2014-02-15 23:13:33 +0000
commit02c4d998f4fc2c9ac27fa5db6a35ee68c848b24d (patch)
treec7a6df9d6a0bfcb618eca56813d18c9d01f98f68 /win32/zlib/compress.c
parenta1d083bf2b5fb01bf0a4a94ad7bd2751f6e4fe34 (diff)
downloadpcsxr-02c4d998f4fc2c9ac27fa5db6a35ee68c848b24d.tar.gz
Patch 15812 (Cyrez);
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@89133 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'win32/zlib/compress.c')
-rwxr-xr-xwin32/zlib/compress.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/win32/zlib/compress.c b/win32/zlib/compress.c
index 814bd9d6..302cae54 100755
--- a/win32/zlib/compress.c
+++ b/win32/zlib/compress.c
@@ -1,10 +1,11 @@
/* compress.c -- compress a memory buffer
- * Copyright (C) 1995-2002 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
+ * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
+#define ZLIB_INTERNAL
#include "zlib.h"
/* ===========================================================================
@@ -18,17 +19,13 @@
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
-int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
- Bytef *dest;
- uLongf *destLen;
- const Bytef *source;
- uLong sourceLen;
- int level;
+int ZEXPORT compress2 (Bytef *dest, uLongf *destLen, const Bytef *source,
+ uLong sourceLen, int level)
{
z_stream stream;
int err;
- stream.next_in = (Bytef*)source;
+ stream.next_in = (z_const Bytef *)source;
stream.avail_in = (uInt)sourceLen;
#ifdef MAXSEG_64K
/* Check for source > 64K on 16-bit machine: */
@@ -58,11 +55,18 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
/* ===========================================================================
*/
-int ZEXPORT compress (dest, destLen, source, sourceLen)
- Bytef *dest;
- uLongf *destLen;
- const Bytef *source;
- uLong sourceLen;
+int ZEXPORT compress (Bytef *dest, uLongf *destLen, const Bytef *source,
+ uLong sourceLen)
{
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
}
+
+/* ===========================================================================
+ If the default memLevel or windowBits for deflateInit() is changed, then
+ this function needs to be updated.
+ */
+uLong ZEXPORT compressBound (uLong sourceLen)
+{
+ return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
+ (sourceLen >> 25) + 13;
+}