diff options
author | Andreas Schneider <asn@samba.org> | 2018-12-20 11:21:00 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2020-02-21 02:09:33 +0000 |
commit | 841e243625b46d5966bde59fbdc575cd70174278 (patch) | |
tree | 8c75a66d145b488e96863a94840f434a82c65882 | |
parent | 8a87fdb4a7aec8fb4da817abbf9efe797b16fed8 (diff) | |
download | samba-841e243625b46d5966bde59fbdc575cd70174278.tar.gz |
lib:util: Use _DATA_BYTE(_CONST) from bytearray.h
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | lib/util/byteorder.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/util/byteorder.h b/lib/util/byteorder.h index d58e6d0b7d7..8db14d3ab8a 100644 --- a/lib/util/byteorder.h +++ b/lib/util/byteorder.h @@ -20,6 +20,8 @@ #ifndef _BYTEORDER_H #define _BYTEORDER_H +#include "bytearray.h" + /* This file implements macros for machine independent short and int manipulation @@ -88,8 +90,8 @@ it also defines lots of intermediate macros, just ignore those :-) */ -#define CVAL(buf,pos) ((unsigned int)(((const uint8_t *)(buf))[pos])) -#define CVAL_NC(buf,pos) (((uint8_t *)(buf))[pos]) /* Non-const version of CVAL */ +#define CVAL(buf,pos) ((uint32_t)_DATA_BYTE_CONST(buf, pos)) +#define CVAL_NC(buf,pos) _DATA_BYTE(buf, pos) /* Non-const version of CVAL */ #define PVAL(buf,pos) (CVAL(buf,pos)) #define SCVAL(buf,pos,val) (CVAL_NC(buf,pos) = (val)) |