mirror of https://github.com/madler/zlib
Use a uniform approach for the largest value of an unsigned type.
This commit is contained in:
parent
f3fcb92cf6
commit
b7fbee2156
|
@ -28,7 +28,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
|
|||
{
|
||||
z_stream stream;
|
||||
int err;
|
||||
const uInt max = (uInt)0 - 1;
|
||||
const uInt max = (uInt)-1;
|
||||
uLong left;
|
||||
|
||||
left = *destLen;
|
||||
|
|
|
@ -1555,7 +1555,7 @@ unsigned long ZEXPORT inflateCodesUsed(strm)
|
|||
z_streamp strm;
|
||||
{
|
||||
struct inflate_state FAR *state;
|
||||
if (inflateStateCheck(strm)) return (unsigned long)0 - 1;
|
||||
if (inflateStateCheck(strm)) return (unsigned long)-1;
|
||||
state = (struct inflate_state FAR *)strm->state;
|
||||
return (unsigned long)(state->next - state->codes);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue