summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-09-27 03:09:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:39:01 -0500
commitf895df9772a49bc1e3ff0d2078f2e9d3dc2b7f4a (patch)
treedbcf53594a06545bbd6bf20078f6020272c890b2 /source4/lib
parenta2dffe109bc989c5a610d610a2f1a31f10d65968 (diff)
downloadsamba-f895df9772a49bc1e3ff0d2078f2e9d3dc2b7f4a.tar.gz
samba-f895df9772a49bc1e3ff0d2078f2e9d3dc2b7f4a.tar.bz2
samba-f895df9772a49bc1e3ff0d2078f2e9d3dc2b7f4a.zip
r10524: SAFE_FREE() in tdb does not need the discard_const_p()
the discard_const_p() was causing problems on openbsd where intptr_t is not defined (This used to be commit f02a92787b179a4070227d87e37b7ac092d9e6eb)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/tdb/common/tdb_private.h11
1 files changed, 1 insertions, 10 deletions
diff --git a/source4/lib/tdb/common/tdb_private.h b/source4/lib/tdb/common/tdb_private.h
index f3338babfb..d7193b2b67 100644
--- a/source4/lib/tdb/common/tdb_private.h
+++ b/source4/lib/tdb/common/tdb_private.h
@@ -115,18 +115,9 @@ typedef u32 tdb_off_t;
#define MAP_FAILED ((void *)-1)
#endif
-#ifndef discard_const_p
-# if defined(__intptr_t_defined) || defined(HAVE_INTPTR_T)
-# define discard_const(ptr) ((void *)((intptr_t)(ptr)))
-# else
-# define discard_const(ptr) ((void *)(ptr))
-# endif
-# define discard_const_p(type, ptr) ((type *)discard_const(ptr))
-#endif
-
/* free memory if the pointer is valid and zero the pointer */
#ifndef SAFE_FREE
-#define SAFE_FREE(x) do { if ((x) != NULL) {free(discard_const_p(void *, (x))); (x)=NULL;} } while(0)
+#define SAFE_FREE(x) do { if ((x) != NULL) {free(x); (x)=NULL;} } while(0)
#endif
#define BUCKET(hash) ((hash) % tdb->header.hash_size)