@@ 6589-6602 (lines=14) @@ | ||
6586 | * @param int $pos |
|
6587 | * @return int |
|
6588 | */ |
|
6589 | public static function _GetInt4d($data, $pos) |
|
6590 | { |
|
6591 | // FIX: represent numbers correctly on 64-bit system |
|
6592 | // http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334 |
|
6593 | // Hacked by Andreas Rehm 2006 to ensure correct result of the <<24 block on 32 and 64bit systems |
|
6594 | $_or_24 = ord($data[$pos + 3]); |
|
6595 | if ($_or_24 >= 128) { |
|
6596 | // negative number |
|
6597 | $_ord_24 = -abs((256 - $_or_24) << 24); |
|
6598 | } else { |
|
6599 | $_ord_24 = ($_or_24 & 127) << 24; |
|
6600 | } |
|
6601 | return ord($data[$pos]) | (ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) << 16) | $_ord_24; |
|
6602 | } |
|
6603 | ||
6604 | ||
6605 | /** |
@@ 302-315 (lines=14) @@ | ||
299 | * @param int $pos |
|
300 | * @return int |
|
301 | */ |
|
302 | private static function _GetInt4d($data, $pos) |
|
303 | { |
|
304 | // FIX: represent numbers correctly on 64-bit system |
|
305 | // http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334 |
|
306 | // Hacked by Andreas Rehm 2006 to ensure correct result of the <<24 block on 32 and 64bit systems |
|
307 | $_or_24 = ord($data[$pos + 3]); |
|
308 | if ($_or_24 >= 128) { |
|
309 | // negative number |
|
310 | $_ord_24 = -abs((256 - $_or_24) << 24); |
|
311 | } else { |
|
312 | $_ord_24 = ($_or_24 & 127) << 24; |
|
313 | } |
|
314 | return ord($data[$pos]) | (ord($data[$pos + 1]) << 8) | (ord($data[$pos + 2]) << 16) | $_ord_24; |
|
315 | } |
|
316 | ||
317 | } |
|
318 |