]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib:util: Use PULL_LE_(U16|U32) for SVAL and IVAL
authorAndreas Schneider <asn@samba.org>
Fri, 21 Dec 2018 08:48:29 +0000 (09:48 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 21 Feb 2020 02:09:33 +0000 (02:09 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/util/byteorder.h

index 8db14d3ab8a8aa8b9ffe8991ddaf99d29b7c8d5a..053c4d22f5fe1beb2fee34ea6ed2bddb776c6743 100644 (file)
@@ -95,8 +95,8 @@ it also defines lots of intermediate macros, just ignore those :-)
 #define PVAL(buf,pos) (CVAL(buf,pos))
 #define SCVAL(buf,pos,val) (CVAL_NC(buf,pos) = (val))
 
-#define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8)
-#define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16)
+#define SVAL(buf,pos) (uint32_t)PULL_LE_U16(buf, pos)
+#define IVAL(buf,pos) PULL_LE_U32(buf, pos)
 #define SSVALX(buf,pos,val) (CVAL_NC(buf,pos)=(uint8_t)((val)&0xFF),CVAL_NC(buf,pos+1)=(uint8_t)((val)>>8))
 #define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16))
 #define SVALS(buf,pos) ((int16_t)SVAL(buf,pos))