summaryrefslogtreecommitdiff
path: root/source3/lib/ldb/ldb_tdb
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/ldb_tdb
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/ldb_tdb')
-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
5 files changed, 35 insertions, 21 deletions
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;