svn commit: samba r19917 - in branches/SAMBA_3_0/source/lib/ldb:
common ldb_ldap ldb_tdb modules
vlendec at samba.org
vlendec at samba.org
Mon Nov 27 08:41:42 GMT 2006
Author: vlendec
Date: 2006-11-27 08:41:41 +0000 (Mon, 27 Nov 2006)
New Revision: 19917
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19917
Log:
Fix warnings
Modified:
branches/SAMBA_3_0/source/lib/ldb/common/attrib_handlers.c
branches/SAMBA_3_0/source/lib/ldb/ldb_ldap/ldb_ldap.c
branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_cache.c
branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_pack.c
branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_search.c
branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
branches/SAMBA_3_0/source/lib/ldb/modules/operational.c
Changeset:
Modified: branches/SAMBA_3_0/source/lib/ldb/common/attrib_handlers.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/common/attrib_handlers.c 2006-11-27 08:11:10 UTC (rev 19916)
+++ branches/SAMBA_3_0/source/lib/ldb/common/attrib_handlers.c 2006-11-27 08:41:41 UTC (rev 19917)
@@ -296,7 +296,7 @@
}
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;
Modified: branches/SAMBA_3_0/source/lib/ldb/ldb_ldap/ldb_ldap.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/ldb_ldap/ldb_ldap.c 2006-11-27 08:11:10 UTC (rev 19916)
+++ branches/SAMBA_3_0/source/lib/ldb/ldb_ldap/ldb_ldap.c 2006-11-27 08:41:41 UTC (rev 19917)
@@ -154,7 +154,8 @@
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 @@
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 @@
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;
}
Modified: branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_cache.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_cache.c 2006-11-27 08:11:10 UTC (rev 19916)
+++ branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_cache.c 2006-11-27 08:41:41 UTC (rev 19917)
@@ -60,7 +60,8 @@
*/
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_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 @@
*/
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 @@
*/
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 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 @@
*/
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_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 @@
*/
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_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;
Modified: branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_pack.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_pack.c 2006-11-27 08:11:10 UTC (rev 19916)
+++ branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_pack.c 2006-11-27 08:41:41 UTC (rev 19917)
@@ -114,7 +114,7 @@
}
/* 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 @@
}
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 @@
message->elements = NULL;
- p = data->dptr;
+ p = (uint8_t *)data->dptr;
if (data->dsize < 8) {
errno = EIO;
goto failed;
@@ -268,7 +268,7 @@
}
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;
Modified: branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_search.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_search.c 2006-11-27 08:11:10 UTC (rev 19916)
+++ branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_search.c 2006-11-27 08:41:41 UTC (rev 19917)
@@ -211,7 +211,8 @@
*/
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 @@
*/
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_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);
}
Modified: branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb.c 2006-11-27 08:11:10 UTC (rev 19916)
+++ branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb.c 2006-11-27 08:41:41 UTC (rev 19917)
@@ -150,7 +150,7 @@
goto failed;
}
- key.dptr = (uint8_t *)key_str;
+ key.dptr = (char *)key_str;
key.dsize = strlen(key_str) + 1;
return key;
Modified: branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb_wrap.c 2006-11-27 08:11:10 UTC (rev 19916)
+++ branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_tdb_wrap.c 2006-11-27 08:41:41 UTC (rev 19917)
@@ -59,8 +59,8 @@
}
#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 @@
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;
Modified: branches/SAMBA_3_0/source/lib/ldb/modules/operational.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/modules/operational.c 2006-11-27 08:11:10 UTC (rev 19916)
+++ branches/SAMBA_3_0/source/lib/ldb/modules/operational.c 2006-11-27 08:41:41 UTC (rev 19917)
@@ -244,7 +244,7 @@
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);
}
More information about the samba-cvs
mailing list