projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1842 from rubenk/declare-loop-variable-in-for-loop-controlling...
[collectd.git]
/
src
/
collectdctl.c
diff --git
a/src/collectdctl.c
b/src/collectdctl.c
index
8ca0559
..
e60781a
100644
(file)
--- a/
src/collectdctl.c
+++ b/
src/collectdctl.c
@@
-185,7
+185,6
@@
static int getval (lcc_connection_t *c, int argc, char **argv)
char **ret_values_names = NULL;
int status;
char **ret_values_names = NULL;
int status;
- size_t i;
assert (strcasecmp (argv[0], "getval") == 0);
assert (strcasecmp (argv[0], "getval") == 0);
@@
-203,7
+202,7
@@
static int getval (lcc_connection_t *c, int argc, char **argv)
if (ret_values != NULL) \
free (ret_values); \
if (ret_values_names != NULL) { \
if (ret_values != NULL) \
free (ret_values); \
if (ret_values_names != NULL) { \
- for (i = 0; i < ret_values_num; ++i) \
+ for (
size_t
i = 0; i < ret_values_num; ++i) \
free (ret_values_names[i]); \
free (ret_values_names); \
} \
free (ret_values_names[i]); \
free (ret_values_names); \
} \
@@
-218,7
+217,7
@@
static int getval (lcc_connection_t *c, int argc, char **argv)
BAIL_OUT (-1);
}
BAIL_OUT (-1);
}
- for (i = 0; i < ret_values_num; ++i)
+ for (
size_t
i = 0; i < ret_values_num; ++i)
printf ("%s=%e\n", ret_values_names[i], ret_values[i]);
BAIL_OUT (0);
#undef BAIL_OUT
printf ("%s=%e\n", ret_values_names[i], ret_values[i]);
BAIL_OUT (0);
#undef BAIL_OUT
@@
-235,7
+234,6
@@
static int flush (lcc_connection_t *c, int argc, char **argv)
size_t plugins_num = 0;
int status;
size_t plugins_num = 0;
int status;
- int i;
assert (strcasecmp (argv[0], "flush") == 0);
assert (strcasecmp (argv[0], "flush") == 0);
@@
-250,7
+248,7
@@
static int flush (lcc_connection_t *c, int argc, char **argv)
return (s); \
} while (0)
return (s); \
} while (0)
- for (i = 1; i < argc; ++i) {
+ for (i
nt i
= 1; i < argc; ++i) {
char *key, *value;
key = argv[i];
char *key, *value;
key = argv[i];
@@
-314,7
+312,7
@@
static int flush (lcc_connection_t *c, int argc, char **argv)
plugins[0] = NULL;
}
plugins[0] = NULL;
}
- for (i = 0; i < plugins_num; ++i) {
+ for (i
nt i
= 0; i < plugins_num; ++i) {
if (identifiers_num == 0) {
status = lcc_flush (c, plugins[i], NULL, timeout);
if (status != 0)
if (identifiers_num == 0) {
status = lcc_flush (c, plugins[i], NULL, timeout);
if (status != 0)
@@
-322,9
+320,7
@@
static int flush (lcc_connection_t *c, int argc, char **argv)
(plugins[i] == NULL) ? "(all)" : plugins[i], lcc_strerror (c));
}
else {
(plugins[i] == NULL) ? "(all)" : plugins[i], lcc_strerror (c));
}
else {
- int j;
-
- for (j = 0; j < identifiers_num; ++j) {
+ for (int j = 0; j < identifiers_num; ++j) {
status = lcc_flush (c, plugins[i], identifiers + j, timeout);
if (status != 0) {
char id[1024];
status = lcc_flush (c, plugins[i], identifiers + j, timeout);
if (status != 0) {
char id[1024];
@@
-349,7
+345,6
@@
static int listval (lcc_connection_t *c, int argc, char **argv)
size_t ret_ident_num = 0;
int status;
size_t ret_ident_num = 0;
int status;
- size_t i;
assert (strcasecmp (argv[0], "listval") == 0);
assert (strcasecmp (argv[0], "listval") == 0);
@@
-372,7
+367,7
@@
static int listval (lcc_connection_t *c, int argc, char **argv)
BAIL_OUT (status);
}
BAIL_OUT (status);
}
- for (i = 0; i < ret_ident_num; ++i) {
+ for (
size_t
i = 0; i < ret_ident_num; ++i) {
char id[1024];
status = lcc_identifier_to_string (c, id, sizeof (id), ret_ident + i);
char id[1024];
status = lcc_identifier_to_string (c, id, sizeof (id), ret_ident + i);
@@
-398,7
+393,6
@@
static int putval (lcc_connection_t *c, int argc, char **argv)
size_t values_len = 0;
int status;
size_t values_len = 0;
int status;
- int i;
assert (strcasecmp (argv[0], "putval") == 0);
assert (strcasecmp (argv[0], "putval") == 0);
@@
-415,7
+409,7
@@
static int putval (lcc_connection_t *c, int argc, char **argv)
if (status != 0)
return (status);
if (status != 0)
return (status);
- for (i = 2; i < argc; ++i) {
+ for (i
nt i
= 2; i < argc; ++i) {
char *tmp;
tmp = strchr (argv[i], (int)'=');
char *tmp;
tmp = strchr (argv[i], (int)'=');