zlib1.2.3

Martin Buchholz martinrb at google.com
Mon Aug 24 21:34:09 UTC 2009


On Mon, Aug 24, 2009 at 14:21, Xueming Shen<Xueming.Shen at sun.com> wrote:
> Martin Buchholz wrote:

> Re:
> "I don't see why the rest of the jdk has to be changed,
> or why a completely unmodified zlib cannot be used"
>
> Current CRC32 and pack/zip.c expect a 32bit unsigned uint from zlib crc32().
> If we keep the new crc32 as
> "unsigned long", which is 64-bit on 64-bit platform, we have to do something
> such as cast and testing.

I imagine that the only issue with having unsigned long be 64-bit is that
crc32.c will compute a 32-bit integer, it will get widened to 64-bit,
and then narrowed back to 32-bit, which is allowed in C and harmless
(although there might be a warning),
but not in Java, where you have to explicitly cast to throw away the
top 32 bits.

Martin



More information about the core-libs-dev mailing list