summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2014-09-17 15:19:46 +0200
committerWim Taymans <wtaymans@redhat.com>2014-09-17 15:19:46 +0200
commit42a1f65a23f5f51ace2b125741890723bede9606 (patch)
treeb347c7e6d67e088d8e8774283ac4926908c40d57
parenta64ab90b1ab04ceb310e2f079b350d39cc93435d (diff)
utils: convert to uin32 before doing |
In ORC_READ_UINT32_LE, convert each byte to uint32 before or-ing them together. This avoids | with signed ints.
-rw-r--r--orc/orcutils.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/orc/orcutils.h b/orc/orcutils.h
index c10b1c2..31420f3 100644
--- a/orc/orcutils.h
+++ b/orc/orcutils.h
@@ -139,11 +139,10 @@ typedef unsigned int orc_bool;
#endif
#define ORC_READ_UINT32_LE(ptr) \
- ((orc_uint32)( \
- ((orc_uint8 *)(ptr))[0] | \
- (((orc_uint8 *)(ptr))[1]<<8) | \
- (((orc_uint8 *)(ptr))[2]<<16) | \
- (((orc_uint8 *)(ptr))[3]<<24)))
+ (((orc_uint32)((orc_uint8 *)(ptr))[0]) | \
+ ((orc_uint32)(((orc_uint8 *)(ptr))[1])<<8) | \
+ ((orc_uint32)(((orc_uint8 *)(ptr))[2])<<16) | \
+ ((orc_uint32)(((orc_uint8 *)(ptr))[3])<<24))
#define ORC_WRITE_UINT32_LE(ptr,val) \
do { \