@@ 7553-7566 (lines=14) @@ | ||
7550 | * @param int $pos |
|
7551 | * @return int |
|
7552 | */ |
|
7553 | public static function getInt4d($data, $pos) |
|
7554 | { |
|
7555 | // FIX: represent numbers correctly on 64-bit system |
|
7556 | // http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334 |
|
7557 | // Hacked by Andreas Rehm 2006 to ensure correct result of the <<24 block on 32 and 64bit systems |
|
7558 | $_or_24 = ord($data[$pos + 3]); |
|
7559 | if ($_or_24 >= 128) { |
|
7560 | // negative number |
|
7561 | $_ord_24 = -abs((256 - $_or_24) << 24); |
|
7562 | } else { |
|
7563 | $_ord_24 = ($_or_24 & 127) << 24; |
|
7564 | } |
|
7565 | return ord($data[$pos]) | (ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) << 16) | $_ord_24; |
|
7566 | } |
|
7567 | ||
7568 | ||
7569 | private function parseRichText($is = '') |
@@ 306-319 (lines=14) @@ | ||
303 | * @param int $pos |
|
304 | * @return int |
|
305 | */ |
|
306 | private static function getInt4d($data, $pos) |
|
307 | { |
|
308 | // FIX: represent numbers correctly on 64-bit system |
|
309 | // http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334 |
|
310 | // Hacked by Andreas Rehm 2006 to ensure correct result of the <<24 block on 32 and 64bit systems |
|
311 | $_or_24 = ord($data[$pos + 3]); |
|
312 | if ($_or_24 >= 128) { |
|
313 | // negative number |
|
314 | $_ord_24 = -abs((256 - $_or_24) << 24); |
|
315 | } else { |
|
316 | $_ord_24 = ($_or_24 & 127) << 24; |
|
317 | } |
|
318 | return ord($data[$pos]) | (ord($data[$pos + 1]) << 8) | (ord($data[$pos + 2]) << 16) | $_ord_24; |
|
319 | } |
|
320 | } |
|
321 |