fixeria submitted this change.
llc: re-define value-string API as static inline functions
Using static inline functions allows for type checking at compile-time.
Change-Id: I1b3245f62f5182aa91dbad7958d89220f7107337
Fixes: I6d0e1a878fb80c57a901da08798620a6ea4471a4
---
M include/osmocom/gprs/llc/llc.h
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/include/osmocom/gprs/llc/llc.h b/include/osmocom/gprs/llc/llc.h
index b035acc..aa11634 100644
--- a/include/osmocom/gprs/llc/llc.h
+++ b/include/osmocom/gprs/llc/llc.h
@@ -27,8 +27,10 @@
extern const struct value_string osmo_gprs_llc_frame_fmt_names[];
-#define osmo_gprs_llc_frame_fmt_name(val) \
- get_value_string(osmo_gprs_llc_frame_fmt_names, val)
+static inline const char *osmo_gprs_llc_frame_fmt_name(enum osmo_gprs_llc_frame_fmt val)
+{
+ return get_value_string(osmo_gprs_llc_frame_fmt_names, val);
+}
/* Section 6.4 Commands and responses */
enum osmo_gprs_llc_frame_func {
@@ -52,8 +54,10 @@
extern const struct value_string osmo_gprs_llc_frame_func_names[];
-#define osmo_gprs_llc_frame_func_name(val) \
- get_value_string(osmo_gprs_llc_frame_func_names, val)
+static inline const char *osmo_gprs_llc_frame_func_name(enum osmo_gprs_llc_frame_func val)
+{
+ return get_value_string(osmo_gprs_llc_frame_func_names, val);
+}
/* Section 6.4.1.6 / Table 6 */
enum osmo_gprs_llc_xid_type {
To view, visit change 29440. To unsubscribe, or for help writing mail filters, visit settings.