]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
format_stackdriver: Remove `int` cast from `yajl_gen_double()`. 4266/head
authorFlorian Forster <octo@collectd.org>
Fri, 2 Feb 2024 07:42:17 +0000 (08:42 +0100)
committerFlorian Forster <octo@collectd.org>
Fri, 2 Feb 2024 07:42:17 +0000 (08:42 +0100)
src/utils/format_stackdriver/format_stackdriver.c

index 2976a66f41ff41ac96f2abc77874786d37348684..5c027e010195bc46521b852adb55bec4e9aecd17 100644 (file)
@@ -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;
     }