summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-07-14 04:11:21 +0000
committerAndrew Tridgell <tridge@samba.org>2002-07-14 04:11:21 +0000
commit3fbf057d78d063dd466cf1a0a2d762e98917a31e (patch)
treede6bc224aa5c19bf56d607193f29031c63087bc4 /source3
parentf5880f3fe85b0f745186bc248271879f8b248d3d (diff)
downloadsamba-3fbf057d78d063dd466cf1a0a2d762e98917a31e.tar.gz
samba-3fbf057d78d063dd466cf1a0a2d762e98917a31e.tar.bz2
samba-3fbf057d78d063dd466cf1a0a2d762e98917a31e.zip
removed some meaningless const casts that were causing thousands of
warnings (literally!) for the irix compiler (This used to be commit 35b6b46bc67104671298641e2993225bad2c9a39)
Diffstat (limited to 'source3')
-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 */