Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/zlib/compress.c

Issue 2084863002: Update Zlib to version 1.2.8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/zlib/adler32.c ('k') | third_party/zlib/contrib/minizip/crypt.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* compress.c -- compress a memory buffer 1 /* compress.c -- compress a memory buffer
2 * Copyright (C) 1995-2005 Jean-loup Gailly. 2 * Copyright (C) 1995-2005 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h 3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */ 4 */
5 5
6 /* @(#) $Id$ */ 6 /* @(#) $Id$ */
7 7
8 #define ZLIB_INTERNAL 8 #define ZLIB_INTERNAL
9 #include "zlib.h" 9 #include "zlib.h"
10 10
(...skipping 11 matching lines...) Expand all
22 int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) 22 int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
23 Bytef *dest; 23 Bytef *dest;
24 uLongf *destLen; 24 uLongf *destLen;
25 const Bytef *source; 25 const Bytef *source;
26 uLong sourceLen; 26 uLong sourceLen;
27 int level; 27 int level;
28 { 28 {
29 z_stream stream; 29 z_stream stream;
30 int err; 30 int err;
31 31
32 stream.next_in = (Bytef*)source; 32 stream.next_in = (z_const Bytef *)source;
33 stream.avail_in = (uInt)sourceLen; 33 stream.avail_in = (uInt)sourceLen;
34 #ifdef MAXSEG_64K 34 #ifdef MAXSEG_64K
35 /* Check for source > 64K on 16-bit machine: */ 35 /* Check for source > 64K on 16-bit machine: */
36 if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 36 if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
37 #endif 37 #endif
38 stream.next_out = dest; 38 stream.next_out = dest;
39 stream.avail_out = (uInt)*destLen; 39 stream.avail_out = (uInt)*destLen;
40 if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 40 if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
41 41
42 stream.zalloc = (alloc_func)0; 42 stream.zalloc = (alloc_func)0;
(...skipping 28 matching lines...) Expand all
71 /* =========================================================================== 71 /* ===========================================================================
72 If the default memLevel or windowBits for deflateInit() is changed, then 72 If the default memLevel or windowBits for deflateInit() is changed, then
73 this function needs to be updated. 73 this function needs to be updated.
74 */ 74 */
75 uLong ZEXPORT compressBound (sourceLen) 75 uLong ZEXPORT compressBound (sourceLen)
76 uLong sourceLen; 76 uLong sourceLen;
77 { 77 {
78 return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 78 return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
79 (sourceLen >> 25) + 13; 79 (sourceLen >> 25) + 13;
80 } 80 }
OLDNEW
« no previous file with comments | « third_party/zlib/adler32.c ('k') | third_party/zlib/contrib/minizip/crypt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698