diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2017-09-06 13:48:34 +0200 |
---|---|---|
committer | Lukas Slebodnik <lslebodn@redhat.com> | 2017-09-25 21:35:39 +0200 |
commit | 39e300314cb43e534179a6950274e1e9c9a48465 (patch) | |
tree | ef55a347aa553148ff1eb3989a88c8538edddbe8 /src/responder | |
parent | d8d49ae91708a2360c5c8f7a01e531952e2f7771 (diff) | |
download | sssd-39e300314cb43e534179a6950274e1e9c9a48465.tar.gz sssd-39e300314cb43e534179a6950274e1e9c9a48465.tar.xz sssd-39e300314cb43e534179a6950274e1e9c9a48465.zip |
Fix warning declaration of 'index' shadows a global declaration
src/responder/common/cache_req/cache_req.c: In function 'cache_req_add_result':
src/responder/common/cache_req/cache_req.c:587: error: declaration of 'index' shadows a global declaration
/usr/include/string.h:489: error: shadowed declaration is here
src/responder/nss/nss_cmd.c:387: error: declaration of 'index' shadows a global declaration
/usr/include/string.h:489: error: shadowed declaration is here
src/responder/nss/nss_cmd.c: In function 'nss_getent_get_result':
src/responder/nss/nss_cmd.c:433: error: declaration of 'index' shadows a global declaration
/usr/include/string.h:489: error: shadowed declaration is here
src/responder/nss/nss_cmd.c: In function 'nss_endent':
src/responder/nss/nss_cmd.c:671: error: declaration of 'index' shadows a global declaration
/usr/include/string.h:489: error: shadowed declaration is here
src/responder/nss/nss_protocol_netgr.c: In function 'nss_protocol_fill_netgrent':
src/responder/nss/nss_protocol_netgr.c:113: error: declaration of 'index' shadows a global declaration
/usr/include/string.h:489: error: shadowed declaration is here
Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
Diffstat (limited to 'src/responder')
-rw-r--r-- | src/responder/common/cache_req/cache_req_result.c | 8 | ||||
-rw-r--r-- | src/responder/nss/nss_cmd.c | 22 | ||||
-rw-r--r-- | src/responder/nss/nss_protocol_netgr.c | 12 |
3 files changed, 21 insertions, 21 deletions
diff --git a/src/responder/common/cache_req/cache_req_result.c b/src/responder/common/cache_req/cache_req_result.c index 366ba7480..c1a3732e8 100644 --- a/src/responder/common/cache_req/cache_req_result.c +++ b/src/responder/common/cache_req/cache_req_result.c @@ -32,11 +32,11 @@ cache_req_add_result(TALLOC_CTX *mem_ctx, size_t *_num_results) { struct cache_req_result **results = *_results; - size_t index; + size_t idx; size_t count; /* Make space for new results. */ - index = *_num_results; + idx = *_num_results; count = *_num_results + 1; results = talloc_realloc(mem_ctx, results, struct cache_req_result *, @@ -45,8 +45,8 @@ cache_req_add_result(TALLOC_CTX *mem_ctx, return ENOMEM; } - results[index] = talloc_steal(results, new_result); - results[index + 1] = NULL; + results[idx] = talloc_steal(results, new_result); + results[idx + 1] = NULL; *_results = results; *_num_results = count; diff --git a/src/responder/nss/nss_cmd.c b/src/responder/nss/nss_cmd.c index a4727c187..ebf66dfe0 100644 --- a/src/responder/nss/nss_cmd.c +++ b/src/responder/nss/nss_cmd.c @@ -468,7 +468,7 @@ static void nss_getent_done(struct tevent_req *subreq); static errno_t nss_getent(struct cli_ctx *cli_ctx, enum cache_req_type type, - struct nss_enum_index *index, + struct nss_enum_index *idx, nss_protocol_fill_packet_fn fill_fn, struct nss_enum_ctx *enum_ctx) { @@ -490,7 +490,7 @@ static errno_t nss_getent(struct cli_ctx *cli_ctx, cmd_ctx->enumeration = true; cmd_ctx->enum_ctx = enum_ctx; - cmd_ctx->enum_index = index; + cmd_ctx->enum_index = idx; subreq = nss_setent_send(cli_ctx, cli_ctx->ev, cli_ctx, type, enum_ctx); if (subreq == NULL) { @@ -514,7 +514,7 @@ done: static struct cache_req_result * nss_getent_get_result(struct nss_enum_ctx *enum_ctx, - struct nss_enum_index *index) + struct nss_enum_index *idx) { struct cache_req_result *result; @@ -523,14 +523,14 @@ nss_getent_get_result(struct nss_enum_ctx *enum_ctx, return NULL; } - result = enum_ctx->result[index->domain]; + result = enum_ctx->result[idx->domain]; - if (result != NULL && index->result >= result->count) { + if (result != NULL && idx->result >= result->count) { /* Switch to next domain. */ - index->result = 0; - index->domain++; + idx->result = 0; + idx->domain++; - result = enum_ctx->result[index->domain]; + result = enum_ctx->result[idx->domain]; } return result; @@ -752,12 +752,12 @@ done: } static errno_t nss_endent(struct cli_ctx *cli_ctx, - struct nss_enum_index *index) + struct nss_enum_index *idx) { DEBUG(SSSDBG_CONF_SETTINGS, "Resetting enumeration state\n"); - index->domain = 0; - index->result = 0; + idx->domain = 0; + idx->result = 0; nss_protocol_done(cli_ctx, EOK); diff --git a/src/responder/nss/nss_protocol_netgr.c b/src/responder/nss/nss_protocol_netgr.c index ba95d165d..ed04fd258 100644 --- a/src/responder/nss/nss_protocol_netgr.c +++ b/src/responder/nss/nss_protocol_netgr.c @@ -110,7 +110,7 @@ nss_protocol_fill_netgrent(struct nss_ctx *nss_ctx, TALLOC_CTX *tmp_ctx; struct sysdb_netgroup_ctx **entries; struct sysdb_netgroup_ctx *entry; - struct nss_enum_index *index; + struct nss_enum_index *idx; uint32_t num_results; size_t rp; size_t body_len; @@ -123,7 +123,7 @@ nss_protocol_fill_netgrent(struct nss_ctx *nss_ctx, return ENOMEM; } - index = cmd_ctx->enum_index; + idx = cmd_ctx->enum_index; entries = cmd_ctx->enum_ctx->netgroup; /* First two fields (length and reserved), filled up later. */ @@ -141,15 +141,15 @@ nss_protocol_fill_netgrent(struct nss_ctx *nss_ctx, } num_results = 0; - start = index->result; - for (; entries[index->result] != NULL; index->result++) { - if ((index->result - start) >= cmd_ctx->enum_limit) { + start = idx->result; + for (; entries[idx->result] != NULL; idx->result++) { + if ((idx->result - start) >= cmd_ctx->enum_limit) { /* We have reached result limit. */ break; } talloc_free_children(tmp_ctx); - entry = entries[index->result]; + entry = entries[idx->result]; switch (entry->type) { case SYSDB_NETGROUP_TRIPLE_VAL: |