diff options
author | Andreas Schneider <asn@samba.org> | 2018-12-21 09:48:29 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2020-02-21 02:09:33 +0000 |
commit | b880441654c6d50fea4fd59061ee0cd486090073 (patch) | |
tree | a815e358db989d4f26194d6529b77c65a4fd11fb | |
parent | 841e243625b46d5966bde59fbdc575cd70174278 (diff) | |
download | samba-b880441654c6d50fea4fd59061ee0cd486090073.tar.gz |
lib:util: Use PULL_LE_(U16|U32) for SVAL and IVAL
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | lib/util/byteorder.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/util/byteorder.h b/lib/util/byteorder.h index 8db14d3ab8a..053c4d22f5f 100644 --- a/lib/util/byteorder.h +++ b/lib/util/byteorder.h @@ -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)) |