From 2d065031e4f2010b41e64fed1d9c7f9a4b3e5091 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 13 Aug 2013 14:17:09 -0700 Subject: [PATCH] * decompress.c: Minor simplifications. (Fzlib_decompress_region): Don't bother verifying that avail_out <= UINT_MAX, as that was confusing. Mention the restriction in a comment instead. Prefer 'int' to 'ptrdiff_t' when 'int' is wide enough. --- src/ChangeLog | 8 ++++++++ src/decompress.c | 8 +++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 0c0583684dc..d89f702a2aa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2013-08-13 Paul Eggert + + * decompress.c: Minor simplifications. + (Fzlib_decompress_region): Don't bother verifying + that avail_out <= UINT_MAX, as that was confusing. + Mention the restriction in a comment instead. + Prefer 'int' to 'ptrdiff_t' when 'int' is wide enough. + 2013-08-13 Jan Djärv * nsmenu.m (x_activate_menubar): Check for OSX >= 10.5 diff --git a/src/decompress.c b/src/decompress.c index 452a9210402..c54a34e050e 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -183,12 +183,10 @@ This function can be called only in unibyte buffers. */) { /* Maximum number of bytes that one 'inflate' call should read and write. Do not make avail_out too large, as that might unduly delay C-g. - In any case zlib requires that these values not exceed UINT_MAX. */ + zlib requires that avail_in and avail_out not exceed UINT_MAX. */ ptrdiff_t avail_in = min (iend - pos_byte, UINT_MAX); - enum { avail_out = 1 << 14 }; - verify (avail_out <= UINT_MAX); - - ptrdiff_t decompressed; + int avail_out = 16 * 1024; + int decompressed; if (GAP_SIZE < avail_out) make_gap (avail_out - GAP_SIZE); -- 2.39.2