From: Florian Forster Date: Fri, 2 Feb 2024 07:42:17 +0000 (+0100) Subject: format_stackdriver: Remove `int` cast from `yajl_gen_double()`. X-Git-Tag: collectd-6.0.0.rc2~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4266%2Fhead;p=thirdparty%2Fcollectd.git format_stackdriver: Remove `int` cast from `yajl_gen_double()`. --- diff --git a/src/utils/format_stackdriver/format_stackdriver.c b/src/utils/format_stackdriver/format_stackdriver.c index 2976a66f4..5c027e010 100644 --- a/src/utils/format_stackdriver/format_stackdriver.c +++ b/src/utils/format_stackdriver/format_stackdriver.c @@ -134,8 +134,8 @@ static int format_typed_value(yajl_gen gen, metric_t const *m, switch (m->family->type) { case METRIC_TYPE_GAUGE: { - int status = json_string(gen, "doubleValue") || - (int)yajl_gen_double(gen, m->value.gauge); + int status = + json_string(gen, "doubleValue") || yajl_gen_double(gen, m->value.gauge); if (status != 0) { return status; } @@ -146,8 +146,7 @@ static int format_typed_value(yajl_gen gen, metric_t const *m, assert(m->value.fpcounter >= start_value.fpcounter); fpcounter_t diff = m->value.fpcounter - start_value.fpcounter; - int status = - json_string(gen, "doubleValue") || (int)yajl_gen_double(gen, diff); + int status = json_string(gen, "doubleValue") || yajl_gen_double(gen, diff); if (status != 0) { return status; }