From: Florian Forster Date: Thu, 18 Jun 2015 15:31:03 +0000 (+0200) Subject: threshold plugin: Fix "Dead assignment" warnings. X-Git-Tag: collectd-5.5.1~68^2~39 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=dbf349ec8c0150a52a7bad5f8b9fc79a6201e2f6;p=collectd.git threshold plugin: Fix "Dead assignment" warnings. --- diff --git a/src/threshold.c b/src/threshold.c index 4a840bb9..391ee932 100644 --- a/src/threshold.c +++ b/src/threshold.c @@ -622,11 +622,9 @@ static int ut_report_state (const data_set_t *ds, if (state == STATE_OKAY) { if (state_old == STATE_MISSING) - status = ssnprintf (buf, bufsize, - ": Value is no longer missing."); + ssnprintf (buf, bufsize, ": Value is no longer missing."); else - status = ssnprintf (buf, bufsize, - ": All data sources are within range again."); + ssnprintf (buf, bufsize, ": All data sources are within range again."); } else { @@ -640,7 +638,7 @@ static int ut_report_state (const data_set_t *ds, { if (!isnan (min) && !isnan (max)) { - status = ssnprintf (buf, bufsize, ": Data source \"%s\" is currently " + ssnprintf (buf, bufsize, ": Data source \"%s\" is currently " "%f. That is within the %s region of %f%s and %f%s.", ds->ds[ds_index].name, values[ds_index], (state == STATE_ERROR) ? "failure" : "warning", @@ -649,13 +647,13 @@ static int ut_report_state (const data_set_t *ds, } else { - status = ssnprintf (buf, bufsize, ": Data source \"%s\" is currently " - "%f. That is %s the %s threshold of %f%s.", - ds->ds[ds_index].name, values[ds_index], - isnan (min) ? "below" : "above", - (state == STATE_ERROR) ? "failure" : "warning", - isnan (min) ? max : min, - ((th->flags & UT_FLAG_PERCENTAGE) != 0) ? "%" : ""); + ssnprintf (buf, bufsize, ": Data source \"%s\" is currently " + "%f. That is %s the %s threshold of %f%s.", + ds->ds[ds_index].name, values[ds_index], + isnan (min) ? "below" : "above", + (state == STATE_ERROR) ? "failure" : "warning", + isnan (min) ? max : min, + ((th->flags & UT_FLAG_PERCENTAGE) != 0) ? "%" : ""); } } else if (th->flags & UT_FLAG_PERCENTAGE) @@ -678,7 +676,7 @@ static int ut_report_state (const data_set_t *ds, else value = 100.0 * values[ds_index] / sum; - status = ssnprintf (buf, bufsize, ": Data source \"%s\" is currently " + ssnprintf (buf, bufsize, ": Data source \"%s\" is currently " "%g (%.2f%%). That is %s the %s threshold of %.2f%%.", ds->ds[ds_index].name, values[ds_index], value, (value < min) ? "below" : "above", @@ -687,12 +685,12 @@ static int ut_report_state (const data_set_t *ds, } else /* is not inverted */ { - status = ssnprintf (buf, bufsize, ": Data source \"%s\" is currently " - "%f. That is %s the %s threshold of %f.", - ds->ds[ds_index].name, values[ds_index], - (values[ds_index] < min) ? "below" : "above", - (state == STATE_ERROR) ? "failure" : "warning", - (values[ds_index] < min) ? min : max); + ssnprintf (buf, bufsize, ": Data source \"%s\" is currently " + "%f. That is %s the %s threshold of %f.", + ds->ds[ds_index].name, values[ds_index], + (values[ds_index] < min) ? "below" : "above", + (state == STATE_ERROR) ? "failure" : "warning", + (values[ds_index] < min) ? min : max); } }