summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-10-09 08:00:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:20:51 -0500
commitc403dd11fb33755809a23338ecac99676d766b88 (patch)
treed594f04f6a121fe060205a6b4f8ccaa4125efe80 /source4/lib/ldb/common
parentd6e1eb987204b83a71516addab6c3d863d09846d (diff)
downloadsamba-c403dd11fb33755809a23338ecac99676d766b88.tar.gz
samba-c403dd11fb33755809a23338ecac99676d766b88.tar.bz2
samba-c403dd11fb33755809a23338ecac99676d766b88.zip
r19188: merge from samba3:
fix compiler warnings metze (This used to be commit dc139d8715f58b27363266f1426da451907845eb)
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r--source4/lib/ldb/common/ldb.c4
-rw-r--r--source4/lib/ldb/common/ldb_dn.c5
-rw-r--r--source4/lib/ldb/common/ldb_ldif.c11
-rw-r--r--source4/lib/ldb/common/ldb_modules.c3
-rw-r--r--source4/lib/ldb/common/ldb_msg.c2
-rw-r--r--source4/lib/ldb/common/ldb_parse.c8
6 files changed, 19 insertions, 14 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c
index 0981d9b25b..28d1c7235a 100644
--- a/source4/lib/ldb/common/ldb.c
+++ b/source4/lib/ldb/common/ldb.c
@@ -161,7 +161,7 @@ static const struct ldb_dn *ldb_set_default_basedn(struct ldb_context *ldb)
struct ldb_result *res;
struct ldb_dn *basedn=NULL;
- basedn = ldb_get_opaque(ldb, "default_baseDN");
+ basedn = (struct ldb_dn *)ldb_get_opaque(ldb, "default_baseDN");
if (basedn) {
return basedn;
}
@@ -183,7 +183,7 @@ static const struct ldb_dn *ldb_set_default_basedn(struct ldb_context *ldb)
const struct ldb_dn *ldb_get_default_basedn(struct ldb_context *ldb)
{
- return ldb_get_opaque(ldb, "default_baseDN");
+ return (const struct ldb_dn *)ldb_get_opaque(ldb, "default_baseDN");
}
/*
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c
index e0ef29ccfd..f10e2812f1 100644
--- a/source4/lib/ldb/common/ldb_dn.c
+++ b/source4/lib/ldb/common/ldb_dn.c
@@ -112,7 +112,7 @@ static struct ldb_val ldb_dn_unescape_value(void *mem_ctx, const char *src)
LDB_DN_NULL_FAILED(src);
- dst = p = talloc_memdup(mem_ctx, src, strlen(src) + 1);
+ dst = p = (char *)talloc_memdup(mem_ctx, src, strlen(src) + 1);
LDB_DN_NULL_FAILED(dst);
end = &dst[strlen(dst)];
@@ -300,7 +300,8 @@ static struct ldb_dn_component ldb_dn_explode_component(void *mem_ctx, char *raw
p[qe] = '\0';
p = p + qs + 1;
dc.value.length = strlen(p);
- dc.value.data = talloc_memdup(mem_ctx, p, dc.value.length + 1);
+ dc.value.data = (uint8_t *)talloc_memdup(mem_ctx, p,
+ dc.value.length + 1);
break;
default: /* mismatched quotes ot other error, bail out */
diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c
index c5084aaa6c..0c31f25cc7 100644
--- a/source4/lib/ldb/common/ldb_ldif.c
+++ b/source4/lib/ldb/common/ldb_ldif.c
@@ -72,7 +72,7 @@ static int ldb_read_data_file(void *mem_ctx, struct ldb_val *value)
goto done;
}
- value->data = talloc_size(mem_ctx, statbuf.st_size + 1);
+ value->data = (uint8_t *)talloc_size(mem_ctx, statbuf.st_size + 1);
if (value->data == NULL) {
ret = -1;
goto done;
@@ -680,7 +680,8 @@ struct ldif_read_file_state {
static int fgetc_file(void *private_data)
{
- struct ldif_read_file_state *state = private_data;
+ struct ldif_read_file_state *state =
+ (struct ldif_read_file_state *)private_data;
return fgetc(state->f);
}
@@ -701,7 +702,8 @@ struct ldif_read_string_state {
static int fgetc_string(void *private_data)
{
- struct ldif_read_string_state *state = private_data;
+ struct ldif_read_string_state *state =
+ (struct ldif_read_string_state *)private_data;
if (state->s[0] != 0) {
return *state->s++;
}
@@ -730,7 +732,8 @@ static int fprintf_file(void *private_data, const char *fmt, ...) PRINTF_ATTRIBU
static int fprintf_file(void *private_data, const char *fmt, ...)
{
- struct ldif_write_file_state *state = private_data;
+ struct ldif_write_file_state *state =
+ (struct ldif_write_file_state *)private_data;
int ret;
va_list ap;
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index fa403658ee..3b0009ae47 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -81,7 +81,8 @@ const char **ldb_modules_list_from_string(struct ldb_context *ldb, TALLOC_CTX *m
int i;
/* spaces not admitted */
- modstr = talloc_strdup_no_spaces(mem_ctx, string);
+ modstr = talloc_strdup_no_spaces((struct ldb_context *)mem_ctx,
+ string);
if ( ! modstr) {
return NULL;
}
diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c
index 9fbb2cdf3e..7e001f9180 100644
--- a/source4/lib/ldb/common/ldb_msg.c
+++ b/source4/lib/ldb/common/ldb_msg.c
@@ -792,7 +792,7 @@ int ldb_msg_check_string_attribute(const struct ldb_message *msg, const char *na
if (el == NULL)
return 0;
- val.data = discard_const(value);
+ val.data = discard_const_p(uint8_t, value);
val.length = strlen(value);
if (ldb_msg_find_val(el, &val))
diff --git a/source4/lib/ldb/common/ldb_parse.c b/source4/lib/ldb/common/ldb_parse.c
index d9044a8b0c..26f88769e6 100644
--- a/source4/lib/ldb/common/ldb_parse.c
+++ b/source4/lib/ldb/common/ldb_parse.c
@@ -67,7 +67,7 @@ struct ldb_val ldb_binary_decode(void *mem_ctx, const char *str)
struct ldb_val ret;
int slen = str?strlen(str):0;
- ret.data = talloc_size(mem_ctx, slen+1);
+ ret.data = (uint8_t *)talloc_size(mem_ctx, slen+1);
ret.length = 0;
if (ret.data == NULL) return ret;
@@ -134,7 +134,7 @@ char *ldb_binary_encode(void *mem_ctx, struct ldb_val val)
char *ldb_binary_encode_string(void *mem_ctx, const char *string)
{
struct ldb_val val;
- val.data = discard_const(string);
+ val.data = discard_const_p(uint8_t, string);
val.length = strlen(string);
return ldb_binary_encode(mem_ctx, val);
}
@@ -285,7 +285,7 @@ static enum ldb_parse_op ldb_parse_filtertype(void *mem_ctx, char **type, char *
}
/* save name */
- name = talloc_memdup(mem_ctx, t, t1 - t + 1);
+ name = (char *)talloc_memdup(mem_ctx, t, t1 - t + 1);
if (name == NULL) return 0;
name[t1 - t] = '\0';
@@ -326,7 +326,7 @@ static enum ldb_parse_op ldb_parse_filtertype(void *mem_ctx, char **type, char *
while (*p && ((*p != ')') || ((*p == ')') && (*(p - 1) == '\\')))) p++;
- val = talloc_memdup(mem_ctx, t, p - t + 1);
+ val = (char *)talloc_memdup(mem_ctx, t, p - t + 1);
if (val == NULL) {
talloc_free(name);
return 0;