X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fthreshold.c;h=94a4f02449c06fb8093defef6ea2a1095e556352;hb=edd9af8a874ebc9f2a7f02846807229a648917db;hp=45ee3b4d02c61b722419577ee607580dcdb4cb26;hpb=abc30f241619b3eb66c801c324390e1e9e6e001f;p=collectd.git diff --git a/src/threshold.c b/src/threshold.c index 45ee3b4d..94a4f024 100644 --- a/src/threshold.c +++ b/src/threshold.c @@ -31,7 +31,6 @@ #include "utils_threshold.h" #include -#include /* * Threshold management @@ -70,7 +69,7 @@ static int ut_threshold_add (const threshold_t *th) return (-1); } - th_copy = (threshold_t *) malloc (sizeof (threshold_t)); + th_copy = malloc (sizeof (*th_copy)); if (th_copy == NULL) { sfree (name_copy); @@ -78,7 +77,6 @@ static int ut_threshold_add (const threshold_t *th) return (-1); } memcpy (th_copy, th, sizeof (threshold_t)); - th_ptr = NULL; DEBUG ("ut_threshold_add: Adding entry `%s'", name); @@ -553,7 +551,7 @@ static int ut_report_state (const data_set_t *ds, { gauge_t value; gauge_t sum; - int i; + size_t i; sum = 0.0; for (i = 0; i < vl->values_len; i++) @@ -701,7 +699,7 @@ static int ut_check_one_threshold (const data_set_t *ds, { /* {{{ */ int ret = -1; int ds_index = -1; - int i; + size_t i; gauge_t values_copy[ds->ds_num]; memcpy (values_copy, values, sizeof (values_copy));