s3-includes: fixed CONST_DISCARD() to actually discard const
authorAndrew Tridgell <tridge@samba.org>
Thu, 24 Mar 2011 04:40:45 +0000 (15:40 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 25 Mar 2011 03:37:06 +0000 (04:37 +0100)
a cast is not enough

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source3/include/includes.h

index 7d98cd583a3e22ef6cd00d276b197781abc1c7c0..96560e4f5fe5a30967b8c46170d2f9d31c39c143 100644 (file)
@@ -752,7 +752,7 @@ ssize_t readahead(int fd, off64_t offset, size_t count);
 #endif
 
 #ifndef CONST_DISCARD
-#define CONST_DISCARD(type, ptr)      ((type) ((void *) (ptr)))
+#define CONST_DISCARD(type, ptr)      discard_const_p(type, ptr)
 #endif
 
 void dump_core(void) _NORETURN_;