From: Michael Tremer Date: Thu, 23 Oct 2025 09:25:24 +0000 (+0000) Subject: metrics: Constify the value pointers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0745ee8790ba94f2a2da9af153026455e9b3d98;p=telemetry.git metrics: Constify the value pointers 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 --- diff --git a/src/daemon/metrics.c b/src/daemon/metrics.c index 79e9016..7cfd1e2 100644 --- a/src/daemon/metrics.c +++ b/src/daemon/metrics.c @@ -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; diff --git a/src/daemon/metrics.h b/src/daemon/metrics.h index e70d7be..88b2e0f 100644 --- a/src/daemon/metrics.h +++ b/src/daemon/metrics.h @@ -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 } })