From 0366a52f3a4f407350bdd1709285b08aae18e149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Fri, 6 Oct 2023 00:50:35 +0200 Subject: [PATCH] spa: support: log: convert `spa_log_topic_init()` to a function There is no reason for this to be a macro. --- spa/include/spa/support/log.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/spa/include/spa/support/log.h b/spa/include/spa/support/log.h index a2d7552be..fab7704d9 100644 --- a/spa/include/spa/support/log.h +++ b/spa/include/spa/support/log.h @@ -194,15 +194,13 @@ struct spa_log_methods { #define SPA_LOG_TOPIC(v, t) \ (struct spa_log_topic){ .version = (v), .topic = (t)} -#define spa_log_topic_init(l, topic) \ -do { \ - struct spa_log *_l = l; \ - if (SPA_LIKELY(_l)) { \ - struct spa_interface *_if = &_l->iface; \ - spa_interface_call(_if, struct spa_log_methods, \ - topic_init, 1, topic); \ - } \ -} while(0) +static inline void spa_log_topic_init(struct spa_log *log, struct spa_log_topic *topic) +{ + if (SPA_UNLIKELY(!log)) + return; + + spa_interface_call(&log->iface, struct spa_log_methods, topic_init, 1, topic); +} /* Unused, left for backwards compat */ #define spa_log_level_enabled(l,lev) ((l) && (l)->level >= (lev))