static int ut_config_type (const threshold_t *th_orig, oconfig_item_t *ci)
{
- int i;
threshold_t th;
int status = 0;
th.hysteresis = 0;
th.flags = UT_FLAG_INTERESTING; /* interesting by default */
- for (i = 0; i < ci->children_num; i++)
+ for (int i = 0; i < ci->children_num; i++)
{
oconfig_item_t *option = ci->children + i;
static int ut_config_plugin (const threshold_t *th_orig, oconfig_item_t *ci)
{
- int i;
threshold_t th;
int status = 0;
memcpy (&th, th_orig, sizeof (th));
sstrncpy (th.plugin, ci->values[0].value.string, sizeof (th.plugin));
- for (i = 0; i < ci->children_num; i++)
+ for (int i = 0; i < ci->children_num; i++)
{
oconfig_item_t *option = ci->children + i;
static int ut_config_host (const threshold_t *th_orig, oconfig_item_t *ci)
{
- int i;
threshold_t th;
int status = 0;
memcpy (&th, th_orig, sizeof (th));
sstrncpy (th.host, ci->values[0].value.string, sizeof (th.host));
- for (i = 0; i < ci->children_num; i++)
+ for (int i = 0; i < ci->children_num; i++)
{
oconfig_item_t *option = ci->children + i;
{
gauge_t value;
gauge_t sum;
- size_t i;
sum = 0.0;
- for (i = 0; i < vl->values_len; i++)
+ for (size_t i = 0; i < vl->values_len; i++)
{
if (isnan (values[i]))
continue;
{ /* {{{ */
int ret = -1;
int ds_index = -1;
- size_t i;
gauge_t values_copy[ds->ds_num];
memcpy (values_copy, values, sizeof (values_copy));
}
/* Prepare `sum' and `num'. */
- for (i = 0; i < ds->ds_num; i++)
+ for (size_t i = 0; i < ds->ds_num; i++)
if (!isnan (values[i]))
{
num++;
if ((num == 0) /* All data sources are undefined. */
|| (sum == 0.0)) /* Sum is zero, cannot calculate percentage. */
{
- for (i = 0; i < ds->ds_num; i++)
+ for (size_t i = 0; i < ds->ds_num; i++)
values_copy[i] = NAN;
}
else /* We can actually calculate the percentage. */
{
- for (i = 0; i < ds->ds_num; i++)
+ for (size_t i = 0; i < ds->ds_num; i++)
values_copy[i] = 100.0 * values[i] / sum;
}
} /* if (UT_FLAG_PERCENTAGE) */
- for (i = 0; i < ds->ds_num; i++)
+ for (size_t i = 0; i < ds->ds_num; i++)
{
int status;
static int ut_config (oconfig_item_t *ci)
{ /* {{{ */
- int i;
int status = 0;
int old_size = c_avl_size (threshold_tree);
.flags = UT_FLAG_INTERESTING /* interesting by default */
};
- for (i = 0; i < ci->children_num; i++)
+ for (int i = 0; i < ci->children_num; i++)
{
oconfig_item_t *option = ci->children + i;