summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-04-29 16:12:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:05:16 -0500
commit6e62c6beac456c07d651db9ea351debe8c60c301 (patch)
treed856f87a987212aa7bf1d80cc1b12a596a34d0b1
parentfc487fb552f38ae41c6a406f0b1cad0c84aa0c2d (diff)
downloadsamba-6e62c6beac456c07d651db9ea351debe8c60c301.tar.gz
samba-6e62c6beac456c07d651db9ea351debe8c60c301.tar.bz2
samba-6e62c6beac456c07d651db9ea351debe8c60c301.zip
r15325: Fix compiler warnings
(This used to be commit 5d51047fe3187863a18b2a976ba3bf831cb3c765)
-rw-r--r--source4/lib/gencache/gencache.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source4/lib/gencache/gencache.c b/source4/lib/gencache/gencache.c
index 05530b7702..4c60d76095 100644
--- a/source4/lib/gencache/gencache.c
+++ b/source4/lib/gencache/gencache.c
@@ -119,9 +119,9 @@ BOOL gencache_set(const char *keystr, const char *value, time_t timeout)
if (!valstr)
return False;
- keybuf.dptr = strdup(keystr);
+ keybuf.dptr = (uint8_t *)strdup(keystr);
keybuf.dsize = strlen(keystr)+1;
- databuf.dptr = strdup(valstr);
+ databuf.dptr = (uint8_t *)strdup(valstr);
databuf.dsize = strlen(valstr)+1;
DEBUG(10, ("Adding cache entry with key = %s; value = %s and timeout \
= %s (%d seconds %s)\n", keybuf.dptr, value, ctime(&timeout),
@@ -171,9 +171,9 @@ BOOL gencache_set_only(const char *keystr, const char *valstr, time_t timeout)
= %s\n", keystr, old_valstr, ctime(&old_timeout)));
asprintf(&datastr, CACHE_DATA_FMT, (int)timeout, valstr);
- keybuf.dptr = strdup(keystr);
+ keybuf.dptr = (uint8_t *)strdup(keystr);
keybuf.dsize = strlen(keystr)+1;
- databuf.dptr = strdup(datastr);
+ databuf.dptr = (uint8_t *)strdup(datastr);
databuf.dsize = strlen(datastr)+1;
DEBUGADD(10, ("New value = %s, new timeout = %s (%d seconds %s)", valstr,
ctime(&timeout), (int)(timeout - time(NULL)),
@@ -210,7 +210,7 @@ BOOL gencache_del(const char *keystr)
if (!gencache_init()) return False;
- keybuf.dptr = strdup(keystr);
+ keybuf.dptr = (uint8_t *)strdup(keystr);
keybuf.dsize = strlen(keystr)+1;
DEBUG(10, ("Deleting cache entry (key = %s)\n", keystr));
ret = tdb_delete(cache->tdb, keybuf);
@@ -243,13 +243,13 @@ BOOL gencache_get(const char *keystr, char **valstr, time_t *timeout)
if (!gencache_init())
return False;
- keybuf.dptr = strdup(keystr);
+ keybuf.dptr = (uint8_t *)strdup(keystr);
keybuf.dsize = strlen(keystr)+1;
databuf = tdb_fetch(cache->tdb, keybuf);
SAFE_FREE(keybuf.dptr);
if (databuf.dptr && databuf.dsize > TIMEOUT_LEN) {
- char* entry_buf = strndup(databuf.dptr, databuf.dsize);
+ char* entry_buf = strndup((char *)databuf.dptr, databuf.dsize);
char *v;
time_t t;
unsigned i;
@@ -323,7 +323,7 @@ void gencache_iterate(void (*fn)(const char* key, const char *value, time_t time
while (node) {
/* ensure null termination of the key string */
- keystr = strndup(node->node_key.dptr, node->node_key.dsize);
+ keystr = strndup((char *)node->node_key.dptr, node->node_key.dsize);
/*
* We don't use gencache_get function, because we need to iterate through
@@ -336,7 +336,7 @@ void gencache_iterate(void (*fn)(const char* key, const char *value, time_t time
node = node->next;
continue;
}
- entry = strndup(databuf.dptr, databuf.dsize);
+ entry = strndup((char *)databuf.dptr, databuf.dsize);
SAFE_FREE(databuf.dptr);
valstr = malloc_array_p(char, databuf.dsize - TIMEOUT_LEN);
sscanf(entry, CACHE_DATA_FMT, (int*)(&i), valstr);