summaryrefslogtreecommitdiff
path: root/source3/tdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/tdb')
-rw-r--r--source3/tdb/tdb.c2
-rw-r--r--source3/tdb/tdbutil.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c
index 0644b64da0..f153e2f258 100644
--- a/source3/tdb/tdb.c
+++ b/source3/tdb/tdb.c
@@ -128,7 +128,7 @@
/* free memory if the pointer is valid and zero the pointer */
#ifndef SAFE_FREE
-#define SAFE_FREE(x) do { if ((x) != NULL) {free((void *) (x)); (x)=NULL;} } while(0)
+#define SAFE_FREE(x) do { if ((x) != NULL) {free(CONST_DISCARD(void *, (x))); (x)=NULL;} } while(0)
#endif
#define BUCKET(hash) ((hash) % tdb->header.hash_size)
diff --git a/source3/tdb/tdbutil.c b/source3/tdb/tdbutil.c
index 29fbd25904..4fcfb6185a 100644
--- a/source3/tdb/tdbutil.c
+++ b/source3/tdb/tdbutil.c
@@ -43,7 +43,7 @@ static void gotalarm_sig(void)
TDB_DATA make_tdb_data(const char *dptr, size_t dsize)
{
TDB_DATA ret;
- ret.dptr = (char *) dptr;
+ ret.dptr = CONST_DISCARD(char *, dptr);
ret.dsize = dsize;
return ret;
}
@@ -62,7 +62,7 @@ static int tdb_chainlock_with_timeout_internal( TDB_CONTEXT *tdb, TDB_DATA key,
/* Allow tdb_chainlock to be interrupted by an alarm. */
int ret;
gotalarm = 0;
- tdb_set_lock_alarm((sig_atomic_t *) &gotalarm);
+ tdb_set_lock_alarm(CONST_DISCARD(sig_atomic_t *, &gotalarm));
if (timeout) {
CatchSignal(SIGALRM, SIGNAL_CAST gotalarm_sig);