summaryrefslogtreecommitdiff
path: root/x11.h
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-14 22:59:17 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-10-02 22:14:45 -0700
commit4ba266b7b08cf5914b5ec6912763d319f57f00bc (patch)
tree3d96bd414a5a9ac076bb77a6a1728069dc2a9c7b /x11.h
parent5ec0ba545da0a9e52e2c6a473dbbc81b4a6f7f96 (diff)
downloadxscope-4ba266b7b08cf5914b5ec6912763d319f57f00bc.tar.gz
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>
Diffstat (limited to 'x11.h')
-rw-r--r--x11.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/x11.h b/x11.h
index ed0f3d6..a3c8cb9 100644
--- a/x11.h
+++ b/x11.h
@@ -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