diff --git a/daemon/cli.c b/daemon/cli.c index 0c7bdaac5..bee035970 100644 --- a/daemon/cli.c +++ b/daemon/cli.c @@ -467,7 +467,7 @@ static void cli_incoming_list_totals(str *instr, struct cli_writer *cw) { AUTO_CLEANUP_INIT(GQueue *metrics, statistics_free_metrics, statistics_gather_metrics(NULL)); for (GList *l = metrics->head; l; l = l->next) { - struct stats_metric *m = l->data; + stats_metric *m = l->data; if (!m->descr) continue; if (m->value_long) { @@ -1706,7 +1706,7 @@ static void cli_incoming_list_jsonstats(str *instr, struct cli_writer *cw) { AUTO_CLEANUP_INIT(GQueue *metrics, statistics_free_metrics, statistics_gather_metrics(NULL)); for (GList *l = metrics->head; l; l = l->next) { - struct stats_metric *m = l->data; + stats_metric *m = l->data; if (!m->label) continue; diff --git a/daemon/mqtt.c b/daemon/mqtt.c index c5b79c30c..3d070c318 100644 --- a/daemon/mqtt.c +++ b/daemon/mqtt.c @@ -471,7 +471,7 @@ static void mqtt_global_stats(JsonBuilder *json) { statistics_gather_metrics(&interface_rate_stats)); for (GList *l = metrics->head; l; l = l->next) { - struct stats_metric *m = l->data; + stats_metric *m = l->data; if (!m->label) continue; diff --git a/daemon/statistics.c b/daemon/statistics.c index 6a94f0660..382ed2bcb 100644 --- a/daemon/statistics.c +++ b/daemon/statistics.c @@ -198,7 +198,7 @@ found:; INLINE void prom_metric(GQueue *ret, const char *name, const char *type) { - struct stats_metric *last = g_queue_peek_tail(ret); + stats_metric *last = g_queue_peek_tail(ret); last->prom_name = name; last->prom_type = type; } @@ -207,15 +207,15 @@ static void prom_label(GQueue *ret, const char *fmt, ...) { return; va_list ap; va_start(ap, fmt); - struct stats_metric *last = g_queue_peek_tail(ret); + stats_metric *last = g_queue_peek_tail(ret); last->prom_label = g_strdup_vprintf(fmt, ap); va_end(ap); } #define PROM(name, type) prom_metric(ret, name, type) #define PROMLAB(fmt, ...) prom_label(ret, fmt, ##__VA_ARGS__) -INLINE void metric_push(GQueue *ret, struct stats_metric *m) { - struct stats_metric *last = NULL; +INLINE void metric_push(GQueue *ret, stats_metric *m) { + stats_metric *last = NULL; for (GList *l_last = ret->tail; l_last; l_last = l_last->prev) { last = l_last->data; if (last->label) @@ -233,7 +233,7 @@ INLINE void metric_push(GQueue *ret, struct stats_metric *m) { static void add_metric(GQueue *ret, const char *label, const char *desc, const char *fmt1, const char *fmt2, ...) { va_list ap; - struct stats_metric *m = g_slice_alloc0(sizeof(*m)); + stats_metric *m = g_slice_alloc0(sizeof(*m)); if (label) m->label = g_strdup(label); if (desc) @@ -276,7 +276,7 @@ static void add_metric(GQueue *ret, const char *label, const char *desc, const c static void add_header(GQueue *ret, const char *fmt1, const char *fmt2, ...) { va_list ap; - struct stats_metric *m = g_slice_alloc0(sizeof(*m)); + stats_metric *m = g_slice_alloc0(sizeof(*m)); if (fmt1) { va_start(ap, fmt2); // coverity[copy_paste_error : FALSE] m->label = g_strdup_vprintf(fmt1, ap); @@ -915,7 +915,7 @@ GQueue *statistics_gather_metrics(struct interface_sampled_rate_stats *interface #pragma GCC diagnostic warning "-Wformat-zero-length" static void free_stats_metric(void *p) { - struct stats_metric *m = p; + stats_metric *m = p; g_free(m->descr); g_free(m->label); g_free(m->value_long); @@ -960,7 +960,7 @@ const char *statistics_ng(bencode_item_t *input, bencode_item_t *output) { bencode_buffer_t *buf = output->buffer; for (GList *l = metrics->head; l; l = l->next) { - struct stats_metric *m = l->data; + stats_metric *m = l->data; if (!m->label) continue; diff --git a/daemon/websocket.c b/daemon/websocket.c index 481dd0b84..fa0441e6f 100644 --- a/daemon/websocket.c +++ b/daemon/websocket.c @@ -389,7 +389,7 @@ static const char *websocket_http_metrics(struct websocket_message *wm) { g_autoptr(GHashTable) metric_types = g_hash_table_new(g_str_hash, g_str_equal); for (GList *l = metrics->head; l; l = l->next) { - struct stats_metric *m = l->data; + stats_metric *m = l->data; if (!m->label) continue; if (!m->value_short) diff --git a/include/types.h b/include/types.h index 1ae268f7b..4737e6cf5 100644 --- a/include/types.h +++ b/include/types.h @@ -2,6 +2,7 @@ #define __TYPES__H__ typedef struct sdp_ng_flags sdp_ng_flags; +typedef struct stats_metric stats_metric; #include "containers.h"