summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 77f3dd8)
raw | patch | inline | side by side (parent: 77f3dd8)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 25 Sep 2016 11:23:43 +0000 (13:23 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 25 Sep 2016 11:23:43 +0000 (13:23 +0200) |
src/utils_cmd_flush.c | patch | blob | history | |
src/utils_cmd_putval.c | patch | blob | history | |
src/utils_cmds.c | patch | blob | history | |
src/utils_cmds_test.c | patch | blob | history |
diff --git a/src/utils_cmd_flush.c b/src/utils_cmd_flush.c
index 320b0632215b24d5a88c846e56d7a77fe9eee8ab..9ef50ffb3c216d819d2b256b26956912af67b8f8 100644 (file)
--- a/src/utils_cmd_flush.c
+++ b/src/utils_cmd_flush.c
int error = 0;
int status;
- size_t i;
-
if ((fh == NULL) || (buffer == NULL))
return (-1);
return (CMD_UNKNOWN_COMMAND);
}
- for (i = 0; (i == 0) || (i < cmd.cmd.flush.plugins_num); i++)
+ for (size_t i = 0; (i == 0) || (i < cmd.cmd.flush.plugins_num); i++)
{
char *plugin = NULL;
diff --git a/src/utils_cmd_putval.c b/src/utils_cmd_putval.c
index b2537859163716c0450db8a7c11c65abfe86b02e..691f1f806b2bfc83b176b850159c8ef345173fab 100644 (file)
--- a/src/utils_cmd_putval.c
+++ b/src/utils_cmd_putval.c
const data_set_t *ds;
value_list_t vl = VALUE_LIST_INIT;
- size_t i;
if ((ret_putval == NULL) || (opts == NULL))
{
/* All the remaining fields are part of the option list. */
result = CMD_OK;
- for (i = 1; i < argc; ++i)
+ for (size_t i = 1; i < argc; ++i)
{
value_list_t *tmp;
void cmd_destroy_putval (cmd_putval_t *putval)
{
- size_t i;
-
if (putval == NULL)
return;
sfree (putval->raw_identifier);
- for (i = 0; i < putval->vl_num; ++i)
+ for (size_t i = 0; i < putval->vl_num; ++i)
{
if (i == 0) /* values is shared between all entries */
sfree (putval->vl[i].values);
{
cmd_error_handler_t err = { cmd_error_fh, fh };
cmd_t cmd;
- size_t i;
int status;
return (CMD_UNKNOWN_COMMAND);
}
- for (i = 0; i < cmd.cmd.putval.vl_num; ++i)
+ for (size_t i = 0; i < cmd.cmd.putval.vl_num; ++i)
plugin_dispatch_values (&cmd.cmd.putval.vl[i]);
if (fh != stdout)
diff --git a/src/utils_cmds.c b/src/utils_cmds.c
index f6675969fa55d543dccd7a508d6fc82359d504ae..1f53ad1d6a4da8bc966d2c67f024a29d2517ddef 100644 (file)
--- a/src/utils_cmds.c
+++ b/src/utils_cmds.c
size_t *ret_len, char ***ret_fields,
cmd_error_handler_t *err)
{
- char *string, *field;
+ char *field;
bool in_field, in_quotes;
size_t estimate, len;
estimate = 0;
in_field = false;
- for (string = buffer; *string != '\0'; ++string)
+ for (char *string = buffer; *string != '\0'; ++string)
{
/* Make a quick worst-case estimate of the number of fields by
* counting spaces and ignoring quotation marks. */
field = NULL;
in_field = false;
in_quotes = false;
- for (string = buffer; *string != '\0'; string++)
+ for (char *string = buffer; *string != '\0'; string++)
{
if (isspace ((int)string[0]))
{
diff --git a/src/utils_cmds_test.c b/src/utils_cmds_test.c
index f5743e9976a6d7826d5195e9fe895cf72fe8422a..9e9eae3b5baacc132770761d36d53469d2d42332 100644 (file)
--- a/src/utils_cmds_test.c
+++ b/src/utils_cmds_test.c
{
cmd_error_handler_t err = { error_cb, NULL };
int test_result = 0;
- size_t i;
- for (i = 0; i < STATIC_ARRAY_SIZE (parse_data); i++) {
+ for (size_t i = 0; i < STATIC_ARRAY_SIZE (parse_data); i++) {
char *input = strdup (parse_data[i].input);
char description[1024];