lib:util: Add comments to use bytearray.h to byteorder.h
authorAndreas Schneider <asn@samba.org>
Thu, 17 Jan 2019 10:00:23 +0000 (11:00 +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 1330e82f5c8d9adc7d7f06a379f43ea7a5279cec..7f7dc7960ad757d50385bf77bfd53b7db0224719 100644 (file)
@@ -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 */