Rename "index" variable to "idx" since gcc complains that it shadows

index(3) function declaration.

Reported by:	lwhsu
MFC after:	2 weeks
This commit is contained in:
ae 2018-01-19 20:33:47 +00:00
parent 5da4f0f640
commit a409fce80d
2 changed files with 11 additions and 11 deletions

View File

@ -751,7 +751,7 @@ int
op_community(struct snmp_context *ctx, struct snmp_value *value,
u_int sub, u_int iidx __unused, enum snmp_op op)
{
struct asn_oid index;
struct asn_oid idx;
struct community *c;
asn_subid_t which = value->var.subs[sub - 1];
@ -773,14 +773,14 @@ op_community(struct snmp_context *ctx, struct snmp_value *value,
case SNMP_OP_SET:
if (community != COMM_INITIALIZE && snmpd.comm_dis)
return (SNMP_ERR_NOT_WRITEABLE);
index.len = 2;
index.subs[0] = 0;
index.subs[1] = value->var.subs[value->var.len - 1];
idx.len = 2;
idx.subs[0] = 0;
idx.subs[1] = value->var.subs[value->var.len - 1];
switch (which) {
case LEAF_begemotSnmpdCommunityString:
/* check that given string is unique */
TAILQ_FOREACH(c, &community_list, link) {
if (!asn_compare_oid(&index, &c->index))
if (!asn_compare_oid(&idx, &c->index))
continue;
if (c->string != NULL && strcmp(c->string,
value->v.octetstring.octets) == 0)
@ -795,7 +795,7 @@ op_community(struct snmp_context *ctx, struct snmp_value *value,
sub)) == NULL) {
/* create new community and use user sepcified index */
c = comm_define_ordered(COMM_READ, "SNMP Custom Community",
&index, NULL, NULL);
&idx, NULL, NULL);
if (c == NULL)
return (SNMP_ERR_NO_CREATION);
}

View File

@ -2028,13 +2028,13 @@ asn_error_func(const struct asn_buf *b, const char *err, ...)
* Create a new community
*/
struct community*
comm_define_ordered(u_int priv, const char *descr, struct asn_oid *index,
comm_define_ordered(u_int priv, const char *descr, struct asn_oid *idx,
struct lmodule *owner, const char *str)
{
struct community *c, *p;
u_int ncomm;
ncomm = index->subs[index->len - 1];
ncomm = idx->subs[idx->len - 1];
/* check that community doesn't already exist */
TAILQ_FOREACH(c, &community_list, link)
@ -2061,7 +2061,7 @@ comm_define_ordered(u_int priv, const char *descr, struct asn_oid *index,
/*
* Insert ordered
*/
c->index = *index;
c->index = *idx;
TAILQ_FOREACH(p, &community_list, link) {
if (asn_compare_oid(&p->index, &c->index) > 0) {
TAILQ_INSERT_BEFORE(p, c, link);
@ -2077,7 +2077,7 @@ u_int
comm_define(u_int priv, const char *descr, struct lmodule *owner,
const char *str)
{
struct asn_oid index, *p;
struct asn_oid idx, *p;
struct community *c;
u_int ncomm;
@ -2094,7 +2094,7 @@ comm_define(u_int priv, const char *descr, struct lmodule *owner,
if (owner != NULL)
p = &owner->index;
else {
p = &index;
p = &idx;
p->len = 1;
p->subs[0] = 0;
}