diff options
author | Luke Leighton <lkcl@samba.org> | 1999-02-12 15:34:57 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-02-12 15:34:57 +0000 |
commit | 4f20234c7884cfdc4b0abc8350e8af70d2afe302 (patch) | |
tree | 83967d7704a45a0aac139bf143021ea14d173f16 | |
parent | 2b8292075cb2b8585eba48ab14a7ed94cb6ed003 (diff) | |
download | samba-4f20234c7884cfdc4b0abc8350e8af70d2afe302.tar.gz samba-4f20234c7884cfdc4b0abc8350e8af70d2afe302.tar.bz2 samba-4f20234c7884cfdc4b0abc8350e8af70d2afe302.zip |
const issues with byte mod / byte read macros.
(This used to be commit 98ecb88704c3db26de8b548f4f1526f23401a161)
-rw-r--r-- | source3/include/byteorder.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 2a615e9dde..113de607fb 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -154,16 +154,21 @@ it also defines lots of intermediate macros, just ignore those :-) */ /* get single value from an SMB buffer */ -#define SVAL(buf,pos) (*(uint16 *)((char *)(buf) + (pos))) -#define IVAL(buf,pos) (*(uint32 *)((char *)(buf) + (pos))) -#define SVALS(buf,pos) (*(int16 *)((char *)(buf) + (pos))) -#define IVALS(buf,pos) (*(int32 *)((char *)(buf) + (pos))) +#define SVAL(buf,pos) (*(const uint16 *)((const char *)(buf) + (pos))) +#define IVAL(buf,pos) (*(const uint32 *)((const char *)(buf) + (pos))) +#define SVALS(buf,pos) (*(const int16 *)((const char *)(buf) + (pos))) +#define IVALS(buf,pos) (*(const int32 *)((const char *)(buf) + (pos))) + +#define SVALMOD(buf,pos) (*(uint16 *)((char *)(buf) + (pos))) +#define IVALMOD(buf,pos) (*(uint32 *)((char *)(buf) + (pos))) +#define SVALMODS(buf,pos) (*(int16 *)((char *)(buf) + (pos))) +#define IVALMODS(buf,pos) (*(int32 *)((char *)(buf) + (pos))) /* store single value in an SMB buffer */ -#define SSVAL(buf,pos,val) SVAL(buf,pos)=((uint16)(val)) -#define SIVAL(buf,pos,val) IVAL(buf,pos)=((uint32)(val)) -#define SSVALS(buf,pos,val) SVALS(buf,pos)=((int16)(val)) -#define SIVALS(buf,pos,val) IVALS(buf,pos)=((int32)(val)) +#define SSVAL(buf,pos,val) SVALMOD(buf,pos)=((uint16)(val)) +#define SIVAL(buf,pos,val) IVALMOD(buf,pos)=((uint32)(val)) +#define SSVALS(buf,pos,val) SVALMODS(buf,pos)=((int16)(val)) +#define SIVALS(buf,pos,val) IVALMODS(buf,pos)=((int32)(val)) #endif |