diff options
author | Tim Potter <tpot@samba.org> | 2004-07-07 01:02:54 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:56:54 -0500 |
commit | 34ca729f733d9d22fc789a5fce6c448b03c96545 (patch) | |
tree | ada36cb103aadc3d3999de2a8124d5cba92b1a45 /source4/lib/ldb/ldb_tdb/ldb_tdb.c | |
parent | e59e82b90204107a3b6e2e6e3fc52d48634adc7a (diff) | |
download | samba-34ca729f733d9d22fc789a5fce6c448b03c96545.tar.gz samba-34ca729f733d9d22fc789a5fce6c448b03c96545.tar.bz2 samba-34ca729f733d9d22fc789a5fce6c448b03c96545.zip |
r1374: Fix signed/unsigned warnings (actually found by g++) after unsigned int
changes in r1018.
(This used to be commit 45b4016530fc0bfa13146f73a503866b5dbed517)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_tdb.c')
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_tdb.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c index d60504ff17..b36c53e100 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c +++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c @@ -324,7 +324,7 @@ failed: */ static int find_element(const struct ldb_message *msg, const char *name) { - int i; + unsigned int i; for (i=0;i<msg->num_elements;i++) { if (ldb_attr_cmp(msg->elements[i].name, name) == 0) { return i; @@ -345,7 +345,7 @@ static int msg_add_element(struct ldb_context *ldb, struct ldb_message *msg, struct ldb_message_element *el) { struct ldb_message_element *e2; - int i; + unsigned int i; e2 = ldb_realloc_p(ldb, msg->elements, struct ldb_message_element, msg->num_elements+1); @@ -385,7 +385,7 @@ static int msg_add_element(struct ldb_context *ldb, static int msg_delete_attribute(struct ldb_context *ldb, struct ldb_message *msg, const char *name) { - int i, count=0; + unsigned int i, count=0; struct ldb_message_element *el2; el2 = ldb_malloc_array_p(ldb, struct ldb_message_element, msg->num_elements); @@ -419,15 +419,16 @@ static int msg_delete_element(struct ldb_context *ldb, const char *name, const struct ldb_val *val) { - int i; + unsigned int i; + int found; struct ldb_message_element *el; - i = find_element(msg, name); - if (i == -1) { + found = find_element(msg, name); + if (found == -1) { return -1; } - el = &msg->elements[i]; + el = &msg->elements[found]; for (i=0;i<el->num_values;i++) { if (ldb_val_equal(ldb, msg->elements[i].name, &el->values[i], val)) { @@ -459,7 +460,8 @@ int ltdb_modify_internal(struct ldb_context *ldb, const struct ldb_message *msg) struct ltdb_private *ltdb = ldb->private_data; TDB_DATA tdb_key, tdb_data; struct ldb_message msg2; - int ret, i, j; + unsigned i, j; + int ret; tdb_key = ltdb_key(ldb, msg->dn); if (!tdb_key.dptr) { |