From fd1cf23567566b65cdeecdbc04f58f29e29edd79 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 6 Oct 2006 14:39:47 +0000 Subject: r19132: Fix some C++ warnings. Is there interest to have them in Samba4 as well? I have some problems resolving the last 3 ones in attrib_handlers.c. In line 251 the function ldb_dn_explode_casefold is called with mem_ctx as the first argument. Looking at ldb_dn_explode_casefold I see that the first argument it expects is a struct ldb_context. I could certainly add a cast to (struct ldb_context *) to that call, but I would assume that this is the wrong fix. Is it possible that attrib_handlers.c:251 and :254 should have ldb and not mem_ctx as the first argument? Can anybody from Samba4 clarify this for me and apply the correct fix? Thanks a lot. Volker (This used to be commit 26f2cb71ebf00b2c6f356da5f32384f7fa083521) --- source3/lib/ldb/common/ldb_parse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/lib/ldb/common/ldb_parse.c') diff --git a/source3/lib/ldb/common/ldb_parse.c b/source3/lib/ldb/common/ldb_parse.c index d9044a8b0c2..ec6ba420b4c 100644 --- a/source3/lib/ldb/common/ldb_parse.c +++ b/source3/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 = (uint8_t *)discard_const(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; -- cgit