summaryrefslogtreecommitdiff
path: root/lib/util/byteorder.h
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2015-06-17 11:01:10 +1200
committerAndrew Bartlett <abartlet@samba.org>2015-06-24 06:04:10 +0200
commitc3cf81324744737e9a9e8d8d7435d39bf95034f3 (patch)
treecd1b5ddcd97a00a1b4fb9879144afee28e73d9bc /lib/util/byteorder.h
parentfa4f4fed2ea20166f48fc40b895ef57aa608ace9 (diff)
downloadsamba-c3cf81324744737e9a9e8d8d7435d39bf95034f3.tar.gz
Byte order reversal shouldn't assume size_t is 64 bit.
This fixes compilation on 32 bit i386 with -WError. ../lib/crypto/aes_gcm_128.c:213:2: error: right shift count >= width of type [-Werror] ../lib/crypto/aes_gcm_128.c:213:2: error: left shift count >= width of type [-Werror] Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/util/byteorder.h')
-rw-r--r--lib/util/byteorder.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/util/byteorder.h b/lib/util/byteorder.h
index 297be52ec3b..77afba58cbd 100644
--- a/lib/util/byteorder.h
+++ b/lib/util/byteorder.h
@@ -164,7 +164,7 @@ static __inline__ void st_le32(uint32_t *addr, const uint32_t val)
/* now the reverse routines - these are used in nmb packets (mostly) */
#define SREV(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF))
#define IREV(x) ((SREV(x)<<16) | (SREV((x)>>16)))
-#define BREV(x) ((IREV(x)<<32) | (IREV((x)>>32)))
+#define BREV(x) ((IREV((uint64_t)x)<<32) | (IREV(((uint64_t)x)>>32)))
#define RSVAL(buf,pos) SREV(SVAL(buf,pos))
#define RSVALS(buf,pos) SREV(SVALS(buf,pos))