diff options
author | doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-23 20:27:57 +0000 |
---|---|---|
committer | doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-23 20:27:57 +0000 |
commit | 4b57a6efa731c121cc077711e6e48c98d0b1f73d (patch) | |
tree | c0867a0d04452190fa29a7e38ad632c37d5221cd /zlib/deflate.c | |
parent | 24d47446c33b2de5227bb7147b76b95a6bb90789 (diff) | |
download | gcc-4b57a6efa731c121cc077711e6e48c98d0b1f73d.tar.gz |
2015-11-23 Matthias Klose <doko@ubuntu.com>
* Imported zlib 1.2.8; merged local changes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230774 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'zlib/deflate.c')
-rw-r--r-- | zlib/deflate.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/zlib/deflate.c b/zlib/deflate.c index 99184ff0cef..03e76ab7932 100644 --- a/zlib/deflate.c +++ b/zlib/deflate.c @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler + * Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.7 Copyright 1995-2012 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -305,7 +305,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || s->pending_buf == Z_NULL) { s->status = FINISH_STATE; - strm->msg = (char*)ERR_MSG(Z_MEM_ERROR); + strm->msg = ERR_MSG(Z_MEM_ERROR); deflateEnd (strm); return Z_MEM_ERROR; } @@ -329,7 +329,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) uInt str, n; int wrap; unsigned avail; - unsigned char *next; + z_const unsigned char *next; if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL) return Z_STREAM_ERROR; @@ -359,7 +359,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) avail = strm->avail_in; next = strm->next_in; strm->avail_in = dictLength; - strm->next_in = (Bytef *)dictionary; + strm->next_in = (z_const Bytef *)dictionary; fill_window(s); while (s->lookahead >= MIN_MATCH) { str = s->strstart; @@ -513,6 +513,8 @@ int ZEXPORT deflateParams(strm, level, strategy) strm->total_in != 0) { /* Flush the last buffer: */ err = deflate(strm, Z_BLOCK); + if (err == Z_BUF_ERROR && s->pending == 0) + err = Z_OK; } if (s->level != level) { s->level = level; |