From 6a3b4a31c6ea3b5189112528a39d9c1da6c0459f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 1 Mar 2022 15:06:13 +1000 Subject: [PATCH] util-tristate: mark the inline functions as used for clang's benefit Signed-off-by: Peter Hutterer --- src/util-tristate.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/util-tristate.h b/src/util-tristate.h index 81b2496..4cdb6b6 100644 --- a/src/util-tristate.h +++ b/src/util-tristate.h @@ -80,6 +80,7 @@ typedef struct { static const unsigned _TRISTATE_TYPE_MASK = ~0x3; /* implementation detail, ignore */ +__attribute__((used)) static inline void _tristate_check_type(const tristate *t1, unsigned type) { assert((t1->_val & _TRISTATE_TYPE_MASK) == type || !"Invalid tristate type comparison"); } @@ -114,19 +115,19 @@ static inline void _tristate_check_type(const tristate *t1, unsigned type) { _tristate_check_type(&t, _TRISTATE_TYPE_##_on##_off); \ return t._val == tristate_##_on._val; \ } \ - static inline bool tristate_is_##_off(tristate t) { \ + __attribute__((used)) static inline bool tristate_is_##_off(tristate t) { \ _tristate_check_type(&t, _TRISTATE_TYPE_##_on##_off); \ return t._val == tristate_##_off._val; \ } \ - static inline bool tristate_is_##_none(tristate t) { \ + __attribute__((used)) static inline bool tristate_is_##_none(tristate t) { \ _tristate_check_type(&t, _TRISTATE_TYPE_##_on##_off); \ return t._val == tristate_##_none._val; \ } \ - static inline signed char tristate_##_on##_off##_value(tristate t) { \ + __attribute__((used)) static inline signed char tristate_##_on##_off##_value(tristate t) { \ _tristate_check_type(&t, _TRISTATE_TYPE_##_on##_off); \ return t._val; \ } \ - static inline const char *tristate_##_on##_off##_name(tristate t) { \ + __attribute__((used)) static inline const char *tristate_##_on##_off##_name(tristate t) { \ if (tristate_is_##_on(t)) return #_on; \ if (tristate_is_##_off(t)) return #_off; \ if (tristate_is_##_none(t)) return #_none; \