summaryrefslogtreecommitdiff
path: root/lib/util
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2023-04-20 10:44:41 +1200
committerAndrew Bartlett <abartlet@samba.org>2023-05-05 02:54:31 +0000
commit443d70ee58f3dec05ddede22c33fec0860f52864 (patch)
treeaf7e2d04a42c3af823204ee152acc5a4eade464e /lib/util
parentdd88d7a89f2896a4535fe61cce44076888cbaef6 (diff)
downloadsamba-443d70ee58f3dec05ddede22c33fec0860f52864.tar.gz
lib:util: Fix undefined bitshift
runtime error: left shift of 65535 by 16 places cannot be represented in type 'int' Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/util')
-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 26268ac93cd..e8664e95538 100644
--- a/lib/util/byteorder.h
+++ b/lib/util/byteorder.h
@@ -138,7 +138,7 @@ it also defines lots of intermediate macros, just ignore those :-)
/* 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 IREV(x) ((SREV((uint32_t)x)<<16) | (SREV(((uint32_t)x)>>16)))
#define BREV(x) ((IREV((uint64_t)x)<<32) | (IREV(((uint64_t)x)>>32)))
/****************************************************************************