diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-11-06 18:35:17 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2010-03-08 10:32:56 +0100 |
commit | 2d03011858ca33ee56b4c36ac6a901850ff69864 (patch) | |
tree | c4d733c6f4d2aadf72e9486f182e7c3db6a8d430 /source4/lib/ldb/ldb_tdb/ldb_index.c | |
parent | 4a2b78a6f36d4eb2a8763464f33720936921650c (diff) | |
download | samba-2d03011858ca33ee56b4c36ac6a901850ff69864.tar.gz samba-2d03011858ca33ee56b4c36ac6a901850ff69864.tar.bz2 samba-2d03011858ca33ee56b4c36ac6a901850ff69864.zip |
LDB:TDB backend - change counter variables to "unsigned" where appropriate
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_index.c')
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_index.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c index bb4617db09..c9c3e0c211 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_index.c +++ b/source4/lib/ldb/ldb_tdb/ldb_index.c @@ -76,7 +76,7 @@ static int dn_list_cmp(const struct ldb_val *v1, const struct ldb_val *v2) */ static int ltdb_dn_list_find_val(const struct dn_list *list, const struct ldb_val *v) { - int i; + unsigned int i; for (i=0; i<list->count; i++) { if (dn_list_cmp(&list->dn[i], v) == 0) return i; } @@ -967,7 +967,7 @@ static int ltdb_index_filter(const struct dn_list *dn_list, */ static void ltdb_dn_list_remove_duplicates(struct dn_list *list) { - int i, new_count; + unsigned int i, new_count; if (list->count < 2) { return; @@ -1279,12 +1279,13 @@ int ltdb_index_add_new(struct ldb_module *module, const struct ldb_message *msg) delete an index entry for one message element */ int ltdb_index_del_value(struct ldb_module *module, struct ldb_dn *dn, - struct ldb_message_element *el, int v_idx) + struct ldb_message_element *el, unsigned int v_idx) { struct ldb_context *ldb; struct ldb_dn *dn_key; const char *dn_str; int ret, i; + unsigned int j; struct dn_list *list; ldb = ldb_module_get_ctx(module); @@ -1329,9 +1330,8 @@ int ltdb_index_del_value(struct ldb_module *module, struct ldb_dn *dn, return LDB_SUCCESS; } - if (i != list->count-1) { - memmove(&list->dn[i], &list->dn[i+1], sizeof(list->dn[0])*(list->count - (i+1))); - } + j = (unsigned int) i; + memmove(&list->dn[j], &list->dn[j+1], sizeof(list->dn[0])*(list->count - (i+1))); list->count--; list->dn = talloc_realloc(list, list->dn, struct ldb_val, list->count); |