From: Douglas Bagnall Date: Tue, 22 Mar 2016 21:54:01 +0000 (+1300) Subject: VLV: avoid name conflict with string.h's index() X-Git-Tag: tdb-1.3.9~79 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9efb5bb8aef46d04f8016820cd152b65794cbd11;p=thirdparty%2Fsamba.git VLV: avoid name conflict with string.h's index() Signed-off-by: Douglas Bagnall Reviewed-by: Garming Sam Reviewed-by: Andrew Bartlett Autobuild-User(master): Garming Sam Autobuild-Date(master): Wed Mar 30 14:26:51 CEST 2016 on sn-devel-144 --- diff --git a/source4/dsdb/samdb/ldb_modules/vlv_pagination.c b/source4/dsdb/samdb/ldb_modules/vlv_pagination.c index 5ae66594059..34da5c26d84 100644 --- a/source4/dsdb/samdb/ldb_modules/vlv_pagination.c +++ b/source4/dsdb/samdb/ldb_modules/vlv_pagination.c @@ -332,7 +332,7 @@ static int vlv_results(struct vlv_context *ac) int ret, i, first_i, last_i; struct ldb_vlv_req_control *vlv_details; struct ldb_server_sort_control *sort_details; - int index = 0; + int target = 0; struct ldb_context *ldb = NULL; if (ac->store == NULL) { @@ -355,22 +355,22 @@ static int vlv_results(struct vlv_context *ac) sort_details = ac->store->sort_details; if (vlv_details->type == 1) { - index = vlv_gt_eq_to_index(ac, ac->store->results, vlv_details, - sort_details, &ret); + target = vlv_gt_eq_to_index(ac, ac->store->results, vlv_details, + sort_details, &ret); if (ret != LDB_SUCCESS) { return ret; } } else { - index = vlv_calc_real_offset(vlv_details->match.byOffset.offset, - vlv_details->match.byOffset.contentCount, - ac->store->num_entries); - if (index == -1) { + target = vlv_calc_real_offset(vlv_details->match.byOffset.offset, + vlv_details->match.byOffset.contentCount, + ac->store->num_entries); + if (target == -1) { return LDB_ERR_OPERATIONS_ERROR; } } /* send the results */ - first_i = MAX(index - vlv_details->beforeCount, 0); - last_i = MIN(index + vlv_details->afterCount, ac->store->num_entries - 1); + first_i = MAX(target - vlv_details->beforeCount, 0); + last_i = MIN(target + vlv_details->afterCount, ac->store->num_entries - 1); for (i = first_i; i <= last_i; i++) { struct ldb_result *result; @@ -446,8 +446,8 @@ static int vlv_results(struct vlv_context *ac) vlv->ctxid_len = sizeof(uint32_t); vlv->vlv_result = 0; vlv->contentCount = ac->store->num_entries; - if (index >= 0) { - vlv->targetPosition = index + 1; + if (target >= 0) { + vlv->targetPosition = target + 1; } else if (vlv_details->type == 1) { vlv->targetPosition = ac->store->num_entries + 1; } else {