Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c
Show First 20 Lines • Show All 497 Lines • ▼ Show 20 Lines | |||||
snmp_table_insert(struct snmp_toolinfo *snmptoolctx, | snmp_table_insert(struct snmp_toolinfo *snmptoolctx, | ||||
struct snmp_index_entry *entry) | struct snmp_index_entry *entry) | ||||
{ | { | ||||
int32_t rc; | int32_t rc; | ||||
struct snmp_index_entry *temp, *prev; | struct snmp_index_entry *temp, *prev; | ||||
if (snmptoolctx == NULL || snmptoolctx->mappings == NULL || | if (snmptoolctx == NULL || snmptoolctx->mappings == NULL || | ||||
entry == NULL) | entry == NULL) | ||||
return(-1); | return (-1); | ||||
if ((prev = SLIST_FIRST(&snmptoolctx->snmp_tablelist)) == NULL || | if ((prev = SLIST_FIRST(&snmptoolctx->snmp_tablelist)) == NULL || | ||||
asn_compare_oid(&(entry->var), &(prev->var)) < 0) { | asn_compare_oid(&(entry->var), &(prev->var)) < 0) { | ||||
SLIST_INSERT_HEAD(&snmptoolctx->snmp_tablelist, entry, link); | SLIST_INSERT_HEAD(&snmptoolctx->snmp_tablelist, entry, link); | ||||
return (1); | return (1); | ||||
} else | } | ||||
rc = -1; /* Make the compiler happy. */ | |||||
rc = -1; | |||||
donner: Use initialization during declaration to make the compiler happy.
This feature was introduced… | |||||
SLIST_FOREACH(temp, &snmptoolctx->snmp_tablelist, link) { | SLIST_FOREACH(temp, &snmptoolctx->snmp_tablelist, link) { | ||||
if ((rc = asn_compare_oid(&(entry->var), &(temp->var))) <= 0) | if ((rc = asn_compare_oid(&(entry->var), &(temp->var))) <= 0) | ||||
break; | break; | ||||
prev = temp; | prev = temp; | ||||
rc = -1; | rc = -1; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 488 Lines • Show Last 20 Lines |
Use initialization during declaration to make the compiler happy.
This feature was introduced in the 90th by C compilers.