Change in libosmo-gprs[master]: llc: re-define value-string API as static inline functions
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/29440 ) Change subject: llc: re-define value-string API as static inline functions ...................................................................... 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(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/40/29440/1 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 https://gerrit.osmocom.org/c/libosmo-gprs/+/29440 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: I1b3245f62f5182aa91dbad7958d89220f7107337 Gerrit-Change-Number: 29440 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> Gerrit-MessageType: newchange
participants (1)
-
fixeria