summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7c7cb54)
raw | patch | inline | side by side (parent: 7c7cb54)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 1 Jul 2017 13:09:40 +0000 (15:09 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 1 Jul 2017 13:09:40 +0000 (15:09 +0200) |
```
CC src/snmp_agent_la-snmp_agent.lo
src/snmp_agent.c:166:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:190:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:289:37: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (i = 0; i < key_len && offset < oid->oid_len; i++)
~~~~~~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:355:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++)
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:420:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < (*dd)->oids_len; i++)
~ ^ ~~~~~~~~~~~~~~~
src/snmp_agent.c:429:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < (*dd)->oids_len; i++)
~ ^ ~~~~~~~~~~~~~~~
src/snmp_agent.c:440:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < (*dd)->oids_len; i++)
~ ^ ~~~~~~~~~~~~~~~
src/snmp_agent.c:532:20: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
assert(oid_index < values_num);
~~~~~~~~~ ^ ~~~~~~~~~~
/usr/include/assert.h:89:5: note: expanded from macro 'assert'
((expr) \
^~~~
src/snmp_agent.c:584:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:768:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:806:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:821:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:1287:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
13 warnings generated.
```
CC src/snmp_agent_la-snmp_agent.lo
src/snmp_agent.c:166:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:190:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:289:37: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (i = 0; i < key_len && offset < oid->oid_len; i++)
~~~~~~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:355:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++)
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:420:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < (*dd)->oids_len; i++)
~ ^ ~~~~~~~~~~~~~~~
src/snmp_agent.c:429:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < (*dd)->oids_len; i++)
~ ^ ~~~~~~~~~~~~~~~
src/snmp_agent.c:440:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < (*dd)->oids_len; i++)
~ ^ ~~~~~~~~~~~~~~~
src/snmp_agent.c:532:20: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
assert(oid_index < values_num);
~~~~~~~~~ ^ ~~~~~~~~~~
/usr/include/assert.h:89:5: note: expanded from macro 'assert'
((expr) \
^~~~
src/snmp_agent.c:584:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:768:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:806:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:821:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:1287:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
13 warnings generated.
```
src/snmp_agent.c | patch | blob | history |
diff --git a/src/snmp_agent.c b/src/snmp_agent.c
index d1579bdac25d020315a327ecaeb66b001938f2c6..d7aea2d27075bb8427df57b62560ca4df9d634b8 100644 (file)
--- a/src/snmp_agent.c
+++ b/src/snmp_agent.c
DEBUG(PLUGIN_NAME ": Type: %s", dd->type);
if (dd->type_instance)
DEBUG(PLUGIN_NAME ": TypeInstance: %s", dd->type_instance);
- for (int i = 0; i < dd->oids_len; i++) {
+ for (size_t i = 0; i < dd->oids_len; i++) {
snmp_agent_oid_to_string(oid_str, sizeof(oid_str), &dd->oids[i]);
DEBUG(PLUGIN_NAME ": OID[%d]: %s", i, oid_str);
}
DEBUG(PLUGIN_NAME ": Type: %s", dd->type);
if (dd->type_instance)
DEBUG(PLUGIN_NAME ": TypeInstance: %s", dd->type_instance);
- for (int i = 0; i < dd->oids_len; i++) {
+ for (size_t i = 0; i < dd->oids_len; i++) {
snmp_agent_oid_to_string(oid_str, sizeof(oid_str), &dd->oids[i]);
DEBUG(PLUGIN_NAME ": OID[%d]: %s", i, oid_str);
}
return 0;
}
-static void snmp_agent_generate_oid2string(oid_t *oid, int offset, char *key) {
+static void snmp_agent_generate_oid2string(oid_t *oid, size_t offset, char *key) {
int key_len = oid->oid[offset];
int i;
for (llentry_t *de = llist_head(td->columns); de != NULL; de = de->next) {
data_definition_t *dd = de->value;
- for (int i = 0; i < dd->oids_len; i++)
+ for (size_t i = 0; i < dd->oids_len; i++)
if (td->index_oid.oid_len)
snmp_agent_unregister_oid_index(&dd->oids[i], *index);
else
/* unregister scalar type OID */
if ((*dd)->table == NULL) {
- for (int i = 0; i < (*dd)->oids_len; i++)
+ for (size_t i = 0; i < (*dd)->oids_len; i++)
unregister_mib((*dd)->oids[i].oid, (*dd)->oids[i].oid_len);
}
if (!(*dd)->table->index_oid.oid_len) {
c_avl_iterator_t *iter = c_avl_get_iterator((*dd)->table->instance_index);
while (c_avl_iterator_next(iter, (void *)&instance, (void *)&instance) ==
0) {
- for (int i = 0; i < (*dd)->oids_len; i++)
+ for (size_t i = 0; i < (*dd)->oids_len; i++)
snmp_agent_unregister_oid_string(&(*dd)->oids[i], instance);
}
c_avl_iterator_destroy(iter);
c_avl_iterator_t *iter = c_avl_get_iterator((*dd)->table->index_instance);
while (c_avl_iterator_next(iter, (void *)&index, (void *)&value) == 0) {
- for (int i = 0; i < (*dd)->oids_len; i++)
+ for (size_t i = 0; i < (*dd)->oids_len; i++)
snmp_agent_unregister_oid_index(&(*dd)->oids[i], *index);
}
c_avl_iterator_destroy(iter);
}
assert(ds->ds_num == values_num);
- assert(oid_index < values_num);
+ assert(oid_index < (int)values_num);
char data[DATA_MAX_NAME_LEN];
size_t data_len = sizeof(data);
for (llentry_t *de = llist_head(td->columns); de != NULL; de = de->next) {
data_definition_t *dd = de->value;
- for (int i = 0; i < dd->oids_len; i++) {
+ for (size_t i = 0; i < dd->oids_len; i++) {
int ret = snmp_oid_ncompare(oid.oid, oid.oid_len, dd->oids[i].oid,
dd->oids[i].oid_len,
MIN(oid.oid_len, dd->oids[i].oid_len));
de = de->next) {
data_definition_t *dd = de->value;
- for (int i = 0; i < dd->oids_len; i++) {
+ for (size_t i = 0; i < dd->oids_len; i++) {
int ret = snmp_oid_compare(oid.oid, oid.oid_len, dd->oids[i].oid,
dd->oids[i].oid_len);
for (llentry_t *de = llist_head(td->columns); de != NULL; de = de->next) {
data_definition_t *dd = de->value;
- for (int i = 0; i < dd->oids_len; i++) {
+ for (size_t i = 0; i < dd->oids_len; i++) {
dd->oids[i].type =
snmp_agent_get_asn_type(dd->oids[i].oid, dd->oids[i].oid_len);
}
for (llentry_t *e = llist_head(g_agent->scalars); e != NULL; e = e->next) {
data_definition_t *dd = e->value;
- for (int i = 0; i < dd->oids_len; i++) {
+ for (size_t i = 0; i < dd->oids_len; i++) {
dd->oids[i].type =
snmp_agent_get_asn_type(dd->oids[i].oid, dd->oids[i].oid_len);
for (llentry_t *de = llist_head(td->columns); de != NULL; de = de->next) {
data_definition_t *dd = de->value;
- for (int i = 0; i < dd->oids_len; i++) {
+ for (size_t i = 0; i < dd->oids_len; i++) {
if (td->index_oid.oid_len) {
ret = snmp_agent_register_oid_index(&dd->oids[i], *index,
snmp_agent_table_oid_handler);