summaryrefslogtreecommitdiff
path: root/source3/include/byteorder.h
diff options
context:
space:
mode:
Diffstat (limited to 'source3/include/byteorder.h')
-rw-r--r--source3/include/byteorder.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h
index 1abf1854f3..c262dd2d33 100644
--- a/source3/include/byteorder.h
+++ b/source3/include/byteorder.h
@@ -107,8 +107,7 @@ it also defines lots of intermediate macros, just ignore those :-)
#define CVAL(buf,pos) (((const unsigned char *)(buf))[pos])
#define CVAL_NC(buf,pos) (((unsigned char *)(buf))[pos]) /* Non-const version of CVAL */
-#define PVAL(buf,pos) ((const unsigned)CVAL(buf,pos))
-#define PVAL_NC(buf,pos) ((unsigned)CVAL(buf,pos)) /* Non const version of PVAL */
+#define PVAL(buf,pos) (CVAL(buf,pos))
#define SCVAL(buf,pos,val) (CVAL_NC(buf,pos) = (val))
@@ -118,12 +117,12 @@ it also defines lots of intermediate macros, just ignore those :-)
#define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16)
#define SSVALX(buf,pos,val) (CVAL_NC(buf,pos)=(unsigned char)((val)&0xFF),CVAL_NC(buf,pos+1)=(unsigned char)((val)>>8))
#define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16))
-#define SVALS(buf,pos) ((const int16)SVAL(buf,pos))
-#define IVALS(buf,pos) ((const int32)IVAL(buf,pos))
-#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((const uint16)(val)))
-#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((const uint32)(val)))
-#define SSVALS(buf,pos,val) SSVALX((buf),(pos),((const int16)(val)))
-#define SIVALS(buf,pos,val) SIVALX((buf),(pos),((const int32)(val)))
+#define SVALS(buf,pos) ((int16)SVAL(buf,pos))
+#define IVALS(buf,pos) ((int32)IVAL(buf,pos))
+#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((uint16)(val)))
+#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32)(val)))
+#define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16)(val)))
+#define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32)(val)))
#else /* CAREFUL_ALIGNMENT */
@@ -145,10 +144,10 @@ it also defines lots of intermediate macros, just ignore those :-)
#define IVALS_NC(buf,pos) (*(int32 *)((char *)(buf) + (pos))) /* Non const version of above. */
/* store single value in an SMB buffer */
-#define SSVAL(buf,pos,val) SVAL_NC(buf,pos)=((const uint16)(val))
-#define SIVAL(buf,pos,val) IVAL_NC(buf,pos)=((const uint32)(val))
-#define SSVALS(buf,pos,val) SVALS_NC(buf,pos)=((const int16)(val))
-#define SIVALS(buf,pos,val) IVALS_NC(buf,pos)=((const int32)(val))
+#define SSVAL(buf,pos,val) SVAL_NC(buf,pos)=((uint16)(val))
+#define SIVAL(buf,pos,val) IVAL_NC(buf,pos)=((uint32)(val))
+#define SSVALS(buf,pos,val) SVALS_NC(buf,pos)=((int16)(val))
+#define SIVALS(buf,pos,val) IVALS_NC(buf,pos)=((int32)(val))
#endif /* CAREFUL_ALIGNMENT */