pajoye Tue Feb 7 00:24:56 2006 UTC Modified files: /php-src/ext/standard crc32.c /php-src/ext/standard/tests/strings bug36306.phpt Log: - MFB: #36306, crc32() result differs on 32-bit and 64-bit platforms http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/crc32.c?r1=1.17&r2=1.18&diff_format=u Index: php-src/ext/standard/crc32.c diff -u php-src/ext/standard/crc32.c:1.17 php-src/ext/standard/crc32.c:1.18 --- php-src/ext/standard/crc32.c:1.17 Sun Jan 1 13:09:54 2006 +++ php-src/ext/standard/crc32.c Tue Feb 7 00:24:56 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: crc32.c,v 1.17 2006/01/01 13:09:54 sniper Exp $ */ +/* $Id: crc32.c,v 1.18 2006/02/07 00:24:56 pajoye Exp $ */ #include "php.h" #include "basic_functions.h" @@ -38,7 +38,7 @@ for (len += nr; nr--; ++p) { CRC32(crc, *p); } - RETVAL_LONG(~crc); + RETVAL_LONG(~ (long) crc); } /* }}} */ http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/strings/bug36306.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/standard/tests/strings/bug36306.phpt diff -u /dev/null php-src/ext/standard/tests/strings/bug36306.phpt:1.2 --- /dev/null Tue Feb 7 00:24:56 2006 +++ php-src/ext/standard/tests/strings/bug36306.phpt Tue Feb 7 00:24:56 2006 @@ -0,0 +1,8 @@ +--TEST-- +Bug #36306 crc32() 64bit +--FILE-- +<?php +echo crc32("platform independant") . "\n"; +?> +--EXPECT-- +-858128794
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php