summaryrefslogtreecommitdiff
path: root/source3/tdb/open.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-07-30 10:42:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:25 -0500
commit5a5deade6e4634aad561139f39337c9a960c0b80 (patch)
tree9907286b6e90ac4dfbbdf1194c08c99cd07701e7 /source3/tdb/open.c
parent2c6030415e0b1f421ea6e85fe6ffe7389ee7a941 (diff)
downloadsamba-5a5deade6e4634aad561139f39337c9a960c0b80.tar.gz
samba-5a5deade6e4634aad561139f39337c9a960c0b80.tar.bz2
samba-5a5deade6e4634aad561139f39337c9a960c0b80.zip
r17315: Make talloc and tdb C++-warning-free. Would this also be interesting in talloc
and tdb "upstream"? Volker (This used to be commit 68c43191c8aa4faa9801e0ab084a216ceaf4379d)
Diffstat (limited to 'source3/tdb/open.c')
-rw-r--r--source3/tdb/open.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/tdb/open.c b/source3/tdb/open.c
index cb4a9cd994..b53b4c9f5c 100644
--- a/source3/tdb/open.c
+++ b/source3/tdb/open.c
@@ -54,7 +54,7 @@ static int tdb_new_database(struct tdb_context *tdb, int hash_size)
/* We make it up in memory, then write it out if not internal */
size = sizeof(struct tdb_header) + (hash_size+1)*sizeof(tdb_off_t);
- if (!(newdb = calloc(size, 1)))
+ if (!(newdb = (struct tdb_header *)calloc(size, 1)))
return TDB_ERRCODE(TDB_ERR_OOM, -1);
/* Fill in the header */
@@ -139,7 +139,7 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
unsigned char *vp;
u32 vertest;
- if (!(tdb = calloc(1, sizeof *tdb))) {
+ if (!(tdb = (struct tdb_context *)calloc(1, sizeof *tdb))) {
/* Can't log this */
errno = ENOMEM;
goto fail;
@@ -257,7 +257,8 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
tdb->map_size = st.st_size;
tdb->device = st.st_dev;
tdb->inode = st.st_ino;
- tdb->locked = calloc(tdb->header.hash_size+1, sizeof(tdb->locked[0]));
+ tdb->locked = (struct tdb_lock_type *)calloc(tdb->header.hash_size+1,
+ sizeof(tdb->locked[0]));
if (!tdb->locked) {
TDB_LOG((tdb, 2, "tdb_open_ex: "
"failed to allocate lock structure for %s\n",