]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
fix codestyle
authorSvetlana Shmidt <sshmidt@google.com>
Thu, 10 Sep 2020 11:44:22 +0000 (11:44 +0000)
committerSvetlana Shmidt <sshmidt@google.com>
Thu, 10 Sep 2020 11:44:22 +0000 (11:44 +0000)
src/daemon/distribution.c
src/daemon/utils_cache.c

index 0f3907f9e96403d08c8c205d7c5088b409b61fbb..985b1b2560b2c6a0b336d5cb66c3e65b7fcc4eee 100644 (file)
@@ -345,14 +345,17 @@ static int compare_uint64(uint64_t a, uint64_t b) {
   return a == b ? 0 : a < b ? -1 : 1;
 }
 
-/* distribution_cmp compares d1 and d2 and stores the result of the comparison in result:
- *     1 if d1 is larger than d2,
- *    -1 if d1 is smaller than d2, and
- *     0 if d1 and d2 are equal.
- * On error an error code is returned and result is undefined.
- * If distributions don't exist or don't have the same structure EINVAL will be returned
- * If distributions have* the same structure but are uncomparable ERANGE will be returned */
-static int distribution_cmp(distribution_t *d1, distribution_t *d2, int *result) {
+/* distribution_cmp compares d1 and d2 and stores the result of the comparison
+ * in result:
+ *   1 if d1 is larger than d2,
+ *   -1 if d1 is smaller than d2,
+ *   and 0 if d1 and d2 are equal.
+ * On error an error code is returned and result is
+ * undefined. If distributions don't exist or don't have the same structure
+ * EINVAL will be returned If distributions have* the same structure but are
+ * uncomparable ERANGE will be returned */
+static int distribution_cmp(distribution_t *d1, distribution_t *d2,
+                            int *result) {
   if (d1 == NULL || d2 == NULL) {
     return EINVAL;
   }
@@ -373,7 +376,7 @@ static int distribution_cmp(distribution_t *d1, distribution_t *d2, int *result)
   for (size_t i = 1; i < tree_size(d1->num_buckets); i++) {
     int cur_res =
         compare_uint64(d1->tree[i].bucket_counter, d2->tree[i].bucket_counter);
-    if (cur_res != 0 && cur_res != *result)  {
+    if (cur_res != 0 && cur_res != *result) {
       return ERANGE;
     }
   }
index d8c036981d926f59d810c2c82dcca826c954a255..98ffb18b0c3c98e56c61744c4514479540fcc8d9 100644 (file)
@@ -362,7 +362,7 @@ static int uc_update_metric(metric_t const *m) {
     distribution_destroy(ce->distribution_increase);
     ce->distribution_increase = distribution_clone(m->value.distribution);
     int status = distribution_sub(ce->distribution_increase,
-                              ce->values_raw.distribution);
+                                  ce->values_raw.distribution);
     if (status == ERANGE) {
       distribution_destroy(ce->distribution_increase);
       ce->distribution_increase = distribution_clone(m->value.distribution);