ID:               36306
 Updated by:       [EMAIL PROTECTED]
 Reported By:      anight at eyelinkmedia dot com
-Status:           Open
+Status:           Closed
 Bug Type:         Feature/Change Request
 Operating System: independant
 PHP Version:      4.4.2
-Assigned To:      
+Assigned To:      pajoye
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2006-02-06 18:34:27] anight at eyelinkmedia dot com

Description:
------------
I noticed that crc32() function result is represented differently on
32-bit and 64-bit platforms. The problem is whithin crc32.c file,

  unsigned int crc = ~0;

After actual crc32 calculations result is inverted and then casted to
"long":

    RETVAL_LONG(~crc);

Proposed patch:

    RETVAL_LONG(~ (long) crc);

I tested it successfully on 64-bit linux and macosx, it works well.

Reproduce code:
---------------
<? echo crc32("platform independant") . "\n"; ?>


Expected result:
----------------
I expect to see value -858128794 both on 32-bit and 64-bit platform.


Actual result:
--------------
On 64-bit platform i see 3436838502
On 32-bit -858128794



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=36306&edit=1

Reply via email to