(PHP) fixes getting indirect table, also fixes getInt method on 32bit machine.

This commit is contained in:
Shuhei Tanuma
2015-12-17 11:35:31 +09:00
parent b974e95ce4
commit c9198dbbb8
8 changed files with 36 additions and 6 deletions

View File

@@ -399,8 +399,13 @@ class ByteBuffer
$sign = $index + (ByteBuffer::isLittleEndian() ? 3 : 0);
$issigned = isset($this->_buffer[$sign]) && ord($this->_buffer[$sign]) & 0x80;
// 4294967296 = 1 << 32 = Maximum unsigned 32-bit int
return $issigned ? $result - 4294967296 : $result;
if (PHP_INT_SIZE > 4) {
// 4294967296 = 1 << 32 = Maximum unsigned 32-bit int
return $issigned ? $result - 4294967296 : $result;
} else {
// 32bit / Windows treated number as signed integer.
return $result;
}
}
/**