@@ 7464-7477 (lines=14) @@ | ||
7461 | * @param int $pos |
|
7462 | * @return int |
|
7463 | */ |
|
7464 | public static function getInt4d($data, $pos) |
|
7465 | { |
|
7466 | // FIX: represent numbers correctly on 64-bit system |
|
7467 | // http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334 |
|
7468 | // Hacked by Andreas Rehm 2006 to ensure correct result of the <<24 block on 32 and 64bit systems |
|
7469 | $_or_24 = ord($data[$pos + 3]); |
|
7470 | if ($_or_24 >= 128) { |
|
7471 | // negative number |
|
7472 | $_ord_24 = -abs((256 - $_or_24) << 24); |
|
7473 | } else { |
|
7474 | $_ord_24 = ($_or_24 & 127) << 24; |
|
7475 | } |
|
7476 | ||
7477 | return ord($data[$pos]) | (ord($data[$pos + 1]) << 8) | (ord($data[$pos + 2]) << 16) | $_ord_24; |
|
7478 | } |
|
7479 | ||
7480 | private function parseRichText($is = '') |
@@ 304-317 (lines=14) @@ | ||
301 | * @param int $pos |
|
302 | * @return int |
|
303 | */ |
|
304 | private static function getInt4d($data, $pos) |
|
305 | { |
|
306 | // FIX: represent numbers correctly on 64-bit system |
|
307 | // http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334 |
|
308 | // Hacked by Andreas Rehm 2006 to ensure correct result of the <<24 block on 32 and 64bit systems |
|
309 | $_or_24 = ord($data[$pos + 3]); |
|
310 | if ($_or_24 >= 128) { |
|
311 | // negative number |
|
312 | $_ord_24 = -abs((256 - $_or_24) << 24); |
|
313 | } else { |
|
314 | $_ord_24 = ($_or_24 & 127) << 24; |
|
315 | } |
|
316 | ||
317 | return ord($data[$pos]) | (ord($data[$pos + 1]) << 8) | (ord($data[$pos + 2]) << 16) | $_ord_24; |
|
318 | } |
|
319 | } |
|
320 |