summaryrefslogtreecommitdiff
path: root/source3/lib/ldb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-11-27 08:41:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:09 -0500
commit847644bdac520a3cca7f30ffa50c0de3eeedf6d9 (patch)
tree94026c95cc94cfbf00da44dd0b32da29aa07f747 /source3/lib/ldb
parentfb5d4f9c863c5486eed607dfb723254411758f89 (diff)
downloadsamba-847644bdac520a3cca7f30ffa50c0de3eeedf6d9.tar.gz
samba-847644bdac520a3cca7f30ffa50c0de3eeedf6d9.tar.bz2
samba-847644bdac520a3cca7f30ffa50c0de3eeedf6d9.zip
r19917: Fix warnings
(This used to be commit cf4309b9048a8417104cac660421a3dcd2e96ffe)
Diffstat (limited to 'source3/lib/ldb')
-rw-r--r--source3/lib/ldb/common/attrib_handlers.c2
-rw-r--r--source3/lib/ldb/ldb_ldap/ldb_ldap.c10
-rw-r--r--source3/lib/ldb/ldb_tdb/ldb_cache.c29
-rw-r--r--source3/lib/ldb/ldb_tdb/ldb_pack.c8
-rw-r--r--source3/lib/ldb/ldb_tdb/ldb_search.c9
-rw-r--r--source3/lib/ldb/ldb_tdb/ldb_tdb.c2
-rw-r--r--source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c8
-rw-r--r--source3/lib/ldb/modules/operational.c2
8 files changed, 44 insertions, 26 deletions
diff --git a/source3/lib/ldb/common/attrib_handlers.c b/source3/lib/ldb/common/attrib_handlers.c
index cb1dfa105f..a289f3c32a 100644
--- a/source3/lib/ldb/common/attrib_handlers.c
+++ b/source3/lib/ldb/common/attrib_handlers.c
@@ -296,7 +296,7 @@ static int ldb_comparison_objectclass(struct ldb_context *ldb, void *mem_ctx,
}
for (i=0;subclasses[i];i++) {
struct ldb_val vs;
- vs.data = discard_const(subclasses[i]);
+ vs.data = (uint8 *)discard_const(subclasses[i]);
vs.length = strlen(subclasses[i]);
if (ldb_comparison_objectclass(ldb, mem_ctx, &vs, v2) == 0) {
return 0;
diff --git a/source3/lib/ldb/ldb_ldap/ldb_ldap.c b/source3/lib/ldb/ldb_ldap/ldb_ldap.c
index cdc1a500f8..6dc52b2484 100644
--- a/source3/lib/ldb/ldb_ldap/ldb_ldap.c
+++ b/source3/lib/ldb/ldb_ldap/ldb_ldap.c
@@ -154,7 +154,8 @@ static LDAPMod **lldb_msg_to_mods(void *mem_ctx, const struct ldb_message *msg,
if (!mods[num_mods]->mod_vals.modv_bvals[j]) {
goto failed;
}
- mods[num_mods]->mod_vals.modv_bvals[j]->bv_val = el->values[j].data;
+ mods[num_mods]->mod_vals.modv_bvals[j]->bv_val =
+ (char *)el->values[j].data;
mods[num_mods]->mod_vals.modv_bvals[j]->bv_len = el->values[j].length;
}
mods[num_mods]->mod_vals.modv_bvals[j] = NULL;
@@ -212,7 +213,8 @@ static int lldb_add_msg_attr(struct ldb_context *ldb,
for (i=0;i<count;i++) {
/* we have to ensure this is null terminated so that
ldb_msg_find_attr_as_string() can work */
- el->values[i].data = talloc_size(el->values, bval[i]->bv_len+1);
+ el->values[i].data =
+ (uint8_t *)talloc_size(el->values, bval[i]->bv_len+1);
if (!el->values[i].data) {
errno = ENOMEM;
return -1;
@@ -270,7 +272,9 @@ static int lldb_search(struct ldb_module *module, struct ldb_request *req)
return LDB_ERR_OPERATIONS_ERROR;
}
- expression = ldb_filter_from_tree(lldb_ac, req->op.search.tree);
+ expression = ldb_filter_from_tree(
+ lldb_ac,
+ CONST_DISCARD(struct ldb_parse_tree *, req->op.search.tree));
if (expression == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
diff --git a/source3/lib/ldb/ldb_tdb/ldb_cache.c b/source3/lib/ldb/ldb_tdb/ldb_cache.c
index 467f1ac34d..632e22762f 100644
--- a/source3/lib/ldb/ldb_tdb/ldb_cache.c
+++ b/source3/lib/ldb/ldb_tdb/ldb_cache.c
@@ -60,7 +60,8 @@ static const struct {
*/
static void ltdb_attributes_unload(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb =
+ (struct ltdb_private *)module->private_data;
struct ldb_message *msg;
int i;
@@ -107,7 +108,8 @@ static int ltdb_attributes_flags(struct ldb_message_element *el, unsigned *v)
*/
static int ltdb_attributes_load(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb =
+ (struct ltdb_private *)module->private_data;
struct ldb_message *msg = ltdb->cache->attributes;
struct ldb_dn *dn;
int i;
@@ -175,7 +177,8 @@ failed:
*/
static int ltdb_subclasses_load(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb =
+ (struct ltdb_private *)module->private_data;
struct ldb_message *msg = ltdb->cache->subclasses;
struct ldb_dn *dn;
int i, j;
@@ -210,7 +213,8 @@ failed:
*/
static void ltdb_subclasses_unload(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb =
+ (struct ltdb_private *)module->private_data;
struct ldb_message *msg;
int i;
@@ -234,7 +238,8 @@ static void ltdb_subclasses_unload(struct ldb_module *module)
*/
static int ltdb_baseinfo_init(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb =
+ (struct ltdb_private *)module->private_data;
struct ldb_message *msg;
struct ldb_message_element el;
struct ldb_val val;
@@ -287,7 +292,8 @@ failed:
*/
static void ltdb_cache_free(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb =
+ (struct ltdb_private *)module->private_data;
ltdb->sequence_number = 0;
talloc_free(ltdb->cache);
@@ -310,11 +316,12 @@ int ltdb_cache_reload(struct ldb_module *module)
*/
int ltdb_cache_load(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb =
+ (struct ltdb_private *)module->private_data;
struct ldb_dn *baseinfo_dn = NULL;
struct ldb_dn *indexlist_dn = NULL;
uint64_t seq;
- struct ldb_message *baseinfo;
+ struct ldb_message *baseinfo = NULL;
/* a very fast check to avoid extra database reads */
if (ltdb->cache != NULL &&
@@ -416,7 +423,8 @@ failed:
*/
int ltdb_increase_sequence_number(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb =
+ (struct ltdb_private *)module->private_data;
struct ldb_message *msg;
struct ldb_message_element el[2];
struct ldb_val val;
@@ -493,7 +501,8 @@ int ltdb_increase_sequence_number(struct ldb_module *module)
*/
int ltdb_attribute_flags(struct ldb_module *module, const char *attr_name)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb =
+ (struct ltdb_private *)module->private_data;
const struct ldb_message_element *attr_el;
int i, j, ret=0;
diff --git a/source3/lib/ldb/ldb_tdb/ldb_pack.c b/source3/lib/ldb/ldb_tdb/ldb_pack.c
index c6edf663ae..50dc20524f 100644
--- a/source3/lib/ldb/ldb_tdb/ldb_pack.c
+++ b/source3/lib/ldb/ldb_tdb/ldb_pack.c
@@ -114,7 +114,7 @@ int ltdb_pack_data(struct ldb_module *module,
}
/* allocate it */
- data->dptr = talloc_array(ldb, uint8_t, size);
+ data->dptr = talloc_array(ldb, char, size);
if (!data->dptr) {
talloc_free(dn);
errno = ENOMEM;
@@ -122,7 +122,7 @@ int ltdb_pack_data(struct ldb_module *module,
}
data->dsize = size;
- p = data->dptr;
+ p = (uint8_t *)data->dptr;
put_uint32(p, 0, LTDB_PACKING_FORMAT);
put_uint32(p, 4, real_elements);
p += 8;
@@ -173,7 +173,7 @@ int ltdb_unpack_data(struct ldb_module *module,
message->elements = NULL;
- p = data->dptr;
+ p = (uint8_t *)data->dptr;
if (data->dsize < 8) {
errno = EIO;
goto failed;
@@ -268,7 +268,7 @@ int ltdb_unpack_data(struct ldb_module *module,
}
message->elements[i].values[j].length = len;
- message->elements[i].values[j].data = talloc_size(message->elements[i].values, len+1);
+ message->elements[i].values[j].data = (uint8_t *)talloc_size(message->elements[i].values, len+1);
if (message->elements[i].values[j].data == NULL) {
errno = ENOMEM;
goto failed;
diff --git a/source3/lib/ldb/ldb_tdb/ldb_search.c b/source3/lib/ldb/ldb_tdb/ldb_search.c
index 884eccd362..7a6fe263fd 100644
--- a/source3/lib/ldb/ldb_tdb/ldb_search.c
+++ b/source3/lib/ldb/ldb_tdb/ldb_search.c
@@ -211,7 +211,8 @@ static struct ldb_message *ltdb_pull_attrs(struct ldb_module *module,
*/
int ltdb_search_dn1(struct ldb_module *module, const struct ldb_dn *dn, struct ldb_message *msg)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb =
+ (struct ltdb_private *)module->private_data;
int ret;
TDB_DATA tdb_key, tdb_data;
@@ -253,7 +254,8 @@ int ltdb_search_dn1(struct ldb_module *module, const struct ldb_dn *dn, struct l
*/
static int ltdb_lock_read(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb =
+ (struct ltdb_private *)module->private_data;
return tdb_lockall_read(ltdb->tdb);
}
@@ -262,7 +264,8 @@ static int ltdb_lock_read(struct ldb_module *module)
*/
static int ltdb_unlock_read(struct ldb_module *module)
{
- struct ltdb_private *ltdb = module->private_data;
+ struct ltdb_private *ltdb =
+ (struct ltdb_private *)module->private_data;
return tdb_unlockall_read(ltdb->tdb);
}
diff --git a/source3/lib/ldb/ldb_tdb/ldb_tdb.c b/source3/lib/ldb/ldb_tdb/ldb_tdb.c
index 3f9db39097..232195dfcd 100644
--- a/source3/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source3/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -150,7 +150,7 @@ struct TDB_DATA ltdb_key(struct ldb_module *module, const struct ldb_dn *dn)
goto failed;
}
- key.dptr = (uint8_t *)key_str;
+ key.dptr = (char *)key_str;
key.dsize = strlen(key_str) + 1;
return key;
diff --git a/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c b/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
index c9eac013fc..4f3acad9ea 100644
--- a/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
+++ b/source3/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
@@ -59,8 +59,8 @@ static int ltdb_wrap_destructor(struct ltdb_wrap *w)
}
#if defined(_SAMBA_BUILD_) && (_SAMBA_BUILD_ <= 3)
-static void ltdb_log_fn(struct tdb_context *tdb, int level, const char *fmt, ...) PRINTF_ATTRIBUTE(3, 4);
-static void ltdb_log_fn(struct tdb_context *tdb, int level, const char *fmt, ...)
+static void ltdb_log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const char *fmt, ...) PRINTF_ATTRIBUTE(3, 4);
+static void ltdb_log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const char *fmt, ...)
{
/* until we merge the tdb debug changes into samba3, we don't know
how serious the error is, and we can't go via the ldb loggin code */
@@ -147,7 +147,9 @@ struct tdb_context *ltdb_wrap_open(TALLOC_CTX *mem_ctx,
return NULL;
}
- w->tdb = tdb_open_ex(path, hash_size, tdb_flags, open_flags, mode, log_ctx_p, NULL);
+ w->tdb = tdb_open_ex(path, hash_size, tdb_flags, open_flags, mode,
+ (const struct tdb_logging_context *)log_ctx_p,
+ NULL);
if (w->tdb == NULL) {
talloc_free(w);
return NULL;
diff --git a/source3/lib/ldb/modules/operational.c b/source3/lib/ldb/modules/operational.c
index c327a96f90..555ae5e9f6 100644
--- a/source3/lib/ldb/modules/operational.c
+++ b/source3/lib/ldb/modules/operational.c
@@ -244,7 +244,7 @@ static int operational_search(struct ldb_module *module, struct ldb_request *req
searchable, but are stored using a different name in the
backend */
for (i=0;i<ARRAY_SIZE(parse_tree_sub);i++) {
- ldb_parse_tree_attr_replace(req->op.search.tree,
+ ldb_parse_tree_attr_replace(CONST_DISCARD(struct ldb_parse_tree *,req->op.search.tree),
parse_tree_sub[i].attr,
parse_tree_sub[i].replace);
}