From: Ruben Kerkhof Date: Tue, 9 Aug 2016 11:57:36 +0000 (+0200) Subject: collectdctl.c: fix two compiler warnings X-Git-Tag: collectd-5.6.0~69 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=acce2eaea9ed847b1683d0333229248bfcc88cb3;p=collectd.git collectdctl.c: fix two compiler warnings collectdctl.c: In function ‘flush’: collectdctl.c:315:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < plugins_num; ++i) { ^ collectdctl.c:323:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int j = 0; j < identifiers_num; ++j) { ^ --- diff --git a/src/collectdctl.c b/src/collectdctl.c index e60781a9..31183b1c 100644 --- a/src/collectdctl.c +++ b/src/collectdctl.c @@ -312,7 +312,7 @@ static int flush (lcc_connection_t *c, int argc, char **argv) plugins[0] = NULL; } - for (int i = 0; i < plugins_num; ++i) { + for (size_t i = 0; i < plugins_num; ++i) { if (identifiers_num == 0) { status = lcc_flush (c, plugins[i], NULL, timeout); if (status != 0) @@ -320,7 +320,7 @@ static int flush (lcc_connection_t *c, int argc, char **argv) (plugins[i] == NULL) ? "(all)" : plugins[i], lcc_strerror (c)); } else { - for (int j = 0; j < identifiers_num; ++j) { + for (size_t j = 0; j < identifiers_num; ++j) { status = lcc_flush (c, plugins[i], identifiers + j, timeout); if (status != 0) { char id[1024];