diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-14 22:59:17 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-09-06 23:22:20 -0700 |
commit | e62d90d6cd02fc0099dd85854d9845124d68a7e7 (patch) | |
tree | ce38766da90c9a6d35cf6afa85b5e8100afec145 | |
parent | 1228a0a4309ac441cb955bb9157d7941c2806fcd (diff) |
ILong: shift each byte individually, then OR them together
instead of shifting the whole word as each byte is loaded into place
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | x11.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -547,8 +547,8 @@ ILong(const unsigned char buf[]) { /* check for byte-swapping */ if (littleEndian) - return ((((((buf[3] << 8) | buf[2]) << 8) | buf[1]) << 8) | buf[0]); - return ((((((buf[0] << 8) | buf[1]) << 8) | buf[2]) << 8) | buf[3]); + return ((buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]); + return ((buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]); } static inline uint16_t |