From: Andreas Schneider Date: Thu, 17 Jan 2019 10:00:23 +0000 (+0100) Subject: lib:util: Add comments to use bytearray.h to byteorder.h X-Git-Tag: ldb-2.1.1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc4064eae61ebc981d070284ceb9668642401943;p=thirdparty%2Fsamba.git lib:util: Add comments to use bytearray.h to byteorder.h Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- diff --git a/lib/util/byteorder.h b/lib/util/byteorder.h index 1330e82f5c8..7f7dc7960ad 100644 --- a/lib/util/byteorder.h +++ b/lib/util/byteorder.h @@ -90,11 +90,23 @@ it also defines lots of intermediate macros, just ignore those :-) */ +/**************************************************************************** + * + * ATTENTION: Do not use those macros anymore, use the ones from bytearray.h + * + ****************************************************************************/ + #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)) +/**************************************************************************** + * + * ATTENTION: Do not use those macros anymore, use the ones from bytearray.h + * + ****************************************************************************/ + #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)) @@ -106,17 +118,35 @@ it also defines lots of intermediate macros, just ignore those :-) #define SSVALS(buf,pos,val) PUSH_LE_U16(buf, pos, val) #define SIVALS(buf,pos,val) PUSH_LE_U32(buf, pos, val) +/**************************************************************************** + * + * ATTENTION: Do not use those macros anymore, use the ones from bytearray.h + * + ****************************************************************************/ + /* 64 bit macros */ #define BVAL(p, ofs) PULL_LE_U64(p, ofs) #define BVALS(p, ofs) ((int64_t)BVAL(p,ofs)) #define SBVAL(p, ofs, v) PUSH_LE_U64(p, ofs, v) #define SBVALS(p, ofs, v) (SBVAL(p,ofs,(uint64_t)v)) +/**************************************************************************** + * + * ATTENTION: Do not use those macros anymore, use the ones from bytearray.h + * + ****************************************************************************/ + /* 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((uint64_t)x)<<32) | (IREV(((uint64_t)x)>>32))) +/**************************************************************************** + * + * ATTENTION: Do not use those macros anymore, use the ones from bytearray.h + * + ****************************************************************************/ + #define RSVAL(buf,pos) (uint32_t)PULL_BE_U16(buf, pos) #define RSVALS(buf,pos) PULL_BE_U16(buf, pos) #define RIVAL(buf,pos) PULL_BE_U32(buf, pos) @@ -130,4 +160,10 @@ it also defines lots of intermediate macros, just ignore those :-) #define RSBVAL(buf,pos,val) PUSH_BE_U64(buf, pos, val) #define RSBVALS(buf,pos,val) PUSH_BE_U64(buf, pos, val) +/**************************************************************************** + * + * ATTENTION: Do not use those macros anymore, use the ones from bytearray.h + * + ****************************************************************************/ + #endif /* _BYTEORDER_H */