Re: cvs: php-src /ext/bz2 bz2.c

From: Date: Fri, 10 Jun 2005 15:47:11 +0000
Subject: Re: cvs: php-src /ext/bz2 bz2.c
References: 1 2  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-32214@lists.php.net to get a copy of this message
Stefan Esser wrote:
Hi Ilia, it is me again
-        size = (bzs.total_out_hi32 << 32) + bzs.total_out_lo32;
+        size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
while this maybe silence the compiler I do not see how this can be mathematically the same ;) Stefan
That's actually the correct implementation of the code... bz2 works by setting hi32 + 1 when lo32 overflows. So 1 in hi32 == INT_MAX, which means total size is hi32 * INT_MAX + lo32. The documentation claimed it was hi32 << 32, but that's not really the case. Ilia

« previous php.cvs (#32214) next »