aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/zlib/gzlib.c
diff options
context:
space:
mode:
authorrobot-contrib <robot-contrib@yandex-team.com>2024-01-24 12:39:37 +0300
committerrobot-contrib <robot-contrib@yandex-team.com>2024-01-24 13:35:32 +0300
commit85d05c2270ed38dc8fb5862e28aec27223691f5f (patch)
tree3c41fe8a7ac10f060c78118a6b0c43daefb40060 /contrib/libs/zlib/gzlib.c
parent132096b5614049a5d9d4cceb0f9fd15053ff350b (diff)
downloadydb-85d05c2270ed38dc8fb5862e28aec27223691f5f.tar.gz
Update contrib/libs/zlib to 1.3.1
Diffstat (limited to 'contrib/libs/zlib/gzlib.c')
-rw-r--r--contrib/libs/zlib/gzlib.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/libs/zlib/gzlib.c b/contrib/libs/zlib/gzlib.c
index 29fc4486fb..983153cc8e 100644
--- a/contrib/libs/zlib/gzlib.c
+++ b/contrib/libs/zlib/gzlib.c
@@ -1,5 +1,5 @@
/* gzlib.c -- zlib functions common to reading and writing gzip files
- * Copyright (C) 2004-2019 Mark Adler
+ * Copyright (C) 2004-2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -563,20 +563,20 @@ void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) {
#endif
}
-#ifndef INT_MAX
/* portably return maximum value for an int (when limits.h presumed not
available) -- we need to do this to cover cases where 2's complement not
used, since C standard permits 1's complement and sign-bit representations,
otherwise we could just use ((unsigned)-1) >> 1 */
unsigned ZLIB_INTERNAL gz_intmax(void) {
- unsigned p, q;
-
- p = 1;
+#ifdef INT_MAX
+ return INT_MAX;
+#else
+ unsigned p = 1, q;
do {
q = p;
p <<= 1;
p++;
} while (p > q);
return q >> 1;
-}
#endif
+}