]> git.ipfire.org Git - oddments/collecty.git/commitdiff
metrics: Constify the value pointers
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 23 Oct 2025 09:25:24 +0000 (09:25 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 23 Oct 2025 09:25:24 +0000 (09:25 +0000)
Sometimes we will receive some data which has been constified and in
order to pass it on straight away, we will constify the value pointer,
too.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/metrics.c
src/daemon/metrics.h

index 79e9016b1f90cf45f6e5632b650528e4cfb0d17b..7cfd1e2242fe3d48a2080e1cc4f0c47faae8a2b6 100644 (file)
@@ -312,7 +312,7 @@ static int td_metrics_find_index(td_metrics* self, const char* field) {
 }
 
 static int td_metrics_push_value(td_metrics* self,
-               const char* field, td_metric_type type, void* value) {
+               const char* field, td_metric_type type, const void* value) {
        td_metric* metric = NULL;
        int index;
 
index e70d7be895d904256bf42405c62ae6e2c2d86eac..88b2e0febacaa06e8cc09dac004a5dfe109581f1 100644 (file)
@@ -39,7 +39,7 @@ typedef struct td_metric_value {
        td_metric_type type;
 
        // Value
-       void* value;
+       const void* value;
 } td_metric_value;
 
 #define VALUES(...)                                    ((const td_metric_value[]) { __VA_ARGS__, { NULL } })