From e57c36ecba516992d70592a1a35fc8bc466b5faa Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 31 Dec 2006 12:28:16 +0000 Subject: r20436: add more comments and add macros signed versions of the 64 bit macros metze (This used to be commit e77d0d1532e800e0a7b0a4a30cf9b4d97761ee52) --- source4/lib/util/byteorder.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source4/lib/util') diff --git a/source4/lib/util/byteorder.h b/source4/lib/util/byteorder.h index 941dee9e88..823287f075 100644 --- a/source4/lib/util/byteorder.h +++ b/source4/lib/util/byteorder.h @@ -73,13 +73,17 @@ reasoning behind them. byteorder.h defines the following macros: SVAL(buf,pos) - extract a 2 byte SMB value IVAL(buf,pos) - extract a 4 byte SMB value -SVALS(buf,pos) signed version of SVAL() -IVALS(buf,pos) signed version of IVAL() +BVAL(buf,pos) - extract a 8 byte SMB value +SVALS(buf,pos) - signed version of SVAL() +IVALS(buf,pos) - signed version of IVAL() +BVALS(buf,pos) - signed version of BVAL() SSVAL(buf,pos,val) - put a 2 byte SMB value into a buffer SIVAL(buf,pos,val) - put a 4 byte SMB value into a buffer +SBVAL(buf,pos,val) - put a 8 byte SMB value into a buffer SSVALS(buf,pos,val) - signed version of SSVAL() SIVALS(buf,pos,val) - signed version of SIVAL() +SBVALS(buf,pos,val) - signed version of SBVAL() RSVAL(buf,pos) - like SVAL() but for NMB byte ordering RSVALS(buf,pos) - like SVALS() but for NMB byte ordering @@ -218,7 +222,9 @@ static __inline__ void st_le32(uint32_t *addr, const uint32_t val) #define VWV(vwv) ((vwv)*2) /* 64 bit macros */ -#define SBVAL(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,((uint64_t)(v))>>32)) #define BVAL(p, ofs) (IVAL(p,ofs) | (((uint64_t)IVAL(p,(ofs)+4)) << 32)) +#define BVALS(p, ofs) ((int64_t)BVAL(p,ofs)) +#define SBVAL(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,((uint64_t)(v))>>32)) +#define SBVALS(p, ofs, v) (SBVAL(p,ofs,(uint64_t)v)) #endif /* _BYTEORDER_H */ -- cgit