aboutsummaryrefslogtreecommitdiff
path: root/gzlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'gzlib.c')
-rw-r--r--gzlib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gzlib.c b/gzlib.c
index 29fc448..9c103db 100644
--- a/gzlib.c
+++ b/gzlib.c
@@ -563,20 +563,20 @@ void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) {
563#endif 563#endif
564} 564}
565 565
566#ifndef INT_MAX
567/* portably return maximum value for an int (when limits.h presumed not 566/* portably return maximum value for an int (when limits.h presumed not
568 available) -- we need to do this to cover cases where 2's complement not 567 available) -- we need to do this to cover cases where 2's complement not
569 used, since C standard permits 1's complement and sign-bit representations, 568 used, since C standard permits 1's complement and sign-bit representations,
570 otherwise we could just use ((unsigned)-1) >> 1 */ 569 otherwise we could just use ((unsigned)-1) >> 1 */
571unsigned ZLIB_INTERNAL gz_intmax(void) { 570unsigned ZLIB_INTERNAL gz_intmax(void) {
572 unsigned p, q; 571#ifdef INT_MAX
573 572 return INT_MAX;
574 p = 1; 573#else
574 unsigned p = 1, q;
575 do { 575 do {
576 q = p; 576 q = p;
577 p <<= 1; 577 p <<= 1;
578 p++; 578 p++;
579 } while (p > q); 579 } while (p > q);
580 return q >> 1; 580 return q >> 1;
581}
582#endif 581#endif
582}