From 4e16a285c7c34732ba95fb5ec201e6f11cf88bef Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Fri, 6 Nov 2009 18:35:17 +0100 Subject: LDB:common - Change counters to "unsigned" where appropriate To count LDB objects use variables of type "unsigned (int)" or "long long int" on binary or downto searches. To count characters in strings use "size_t". To calculate differences between pointers use "ptrdiff_t". --- source4/lib/ldb/common/ldb_parse.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source4/lib/ldb/common/ldb_parse.c') diff --git a/source4/lib/ldb/common/ldb_parse.c b/source4/lib/ldb/common/ldb_parse.c index 75cc6e74d0..a5aa28bb5a 100644 --- a/source4/lib/ldb/common/ldb_parse.c +++ b/source4/lib/ldb/common/ldb_parse.c @@ -61,9 +61,9 @@ a filter is defined by: */ struct ldb_val ldb_binary_decode(void *mem_ctx, const char *str) { - int i, j; + size_t i, j; struct ldb_val ret; - int slen = str?strlen(str):0; + size_t slen = str?strlen(str):0; ret.data = (uint8_t *)talloc_size(mem_ctx, slen+1); ret.length = 0; @@ -96,9 +96,9 @@ struct ldb_val ldb_binary_decode(void *mem_ctx, const char *str) */ char *ldb_binary_encode(void *mem_ctx, struct ldb_val val) { - int i; + size_t i; char *ret; - int len = val.length; + size_t len = val.length; unsigned char *buf = val.data; for (i=0;ioperation) { case LDB_OP_AND: case LDB_OP_OR: @@ -826,7 +826,7 @@ void ldb_parse_tree_attr_replace(struct ldb_parse_tree *tree, struct ldb_parse_tree *ldb_parse_tree_copy_shallow(TALLOC_CTX *mem_ctx, const struct ldb_parse_tree *ot) { - int i; + unsigned int i; struct ldb_parse_tree *nt; nt = talloc(mem_ctx, struct ldb_parse_tree); -- cgit