Skip to content

Commit

Permalink
Merge branch 'issue7'
Browse files Browse the repository at this point in the history
  • Loading branch information
bkw committed Oct 3, 2009
2 parents 59ccf09 + 901a55c commit a56f3e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
15 changes: 3 additions & 12 deletions amqp_wire.inc
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,6 @@ class AMQPReader

$this->bitcount = $this->bits = 0;

if(((int)4294967296)!=0)
$this->is64bits = true;
else
$this->is64bits = false;

if(!function_exists("bcmul"))
throw new Exception("'bc math' module required");
}
Expand Down Expand Up @@ -325,18 +320,14 @@ class AMQPReader
* On 32 bit systems it will return signed int value in
* -2^31...+2^31 range.
*
* Callers MUST check for negative return values.
*
* Use with caution!
*/
public function read_php_int()
{
list(,$res) = unpack('N', $this->rawread(4));
if($this->is64bits)
{
$sres = sprintf ( "%u", $res );
return (int)$sres;
} else {
return $res;
}
return $res;
}

// PHP does not have unsigned 32 bit int,
Expand Down
5 changes: 1 addition & 4 deletions tests/all_tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
require_once(SIMPLE_TEST . 'unit_tester.php');
require_once(SIMPLE_TEST . 'reporter.php');

if(((int)4294967296)!=0)
$arch_bits = "64bit";
else
$arch_bits = "32bit";
$arch_bits = (PHP_INT_SIZE*8)."bit";

$test = &new TestSuite("PHP-AMQP tests ($arch_bits)");
$test->addTestFile('wire_format_test.php');
Expand Down

0 comments on commit a56f3e3

Please sign in to comment.