[MERGED] openbsc[master]: use new OSMO_VALUE_STRING

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Dec 21 14:02:07 UTC 2016


Neels Hofmeyr has submitted this change and it was merged.

Change subject: use new OSMO_VALUE_STRING
......................................................................


use new OSMO_VALUE_STRING

libosmocore change-id I857af45ae602bb9a647ba26cf8b0d1b23403b54c adds
OSMO_VALUE_STRING to compose value_string arrays with the exact enum names as
entries. Use instead of identical local macros in two places.

Change-Id: I1b44d2a3f293785a01d6a587c78f9e0cbeec70c3
---
M openbsc/src/libiu/iu.c
M openbsc/src/libmsc/auth.c
2 files changed, 11 insertions(+), 13 deletions(-)

Approvals:
  Max: Looks good to me, but someone else must approve
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/src/libiu/iu.c b/openbsc/src/libiu/iu.c
index c15c6c5..8ba6fa4 100644
--- a/openbsc/src/libiu/iu.c
+++ b/openbsc/src/libiu/iu.c
@@ -30,6 +30,7 @@
 #include <osmocom/core/talloc.h>
 #include <osmocom/core/logging.h>
 #include <osmocom/core/application.h>
+#include <osmocom/core/utils.h>
 #include <osmocom/vty/logging.h>
 
 #include <osmocom/gsm/gsm48.h>
@@ -89,12 +90,10 @@
 static LLIST_HEAD(rnc_list);
 
 const struct value_string iu_event_type_names[] = {
-#define IU_EVT_STR(X) { X, #X }
-	IU_EVT_STR(IU_EVENT_RAB_ASSIGN),
-	IU_EVT_STR(IU_EVENT_SECURITY_MODE_COMPLETE),
-	IU_EVT_STR(IU_EVENT_IU_RELEASE),
-	IU_EVT_STR(IU_EVENT_LINK_INVALIDATED),
-#undef IU_EVT_STR
+	OSMO_VALUE_STRING(IU_EVENT_RAB_ASSIGN),
+	OSMO_VALUE_STRING(IU_EVENT_SECURITY_MODE_COMPLETE),
+	OSMO_VALUE_STRING(IU_EVENT_IU_RELEASE),
+	OSMO_VALUE_STRING(IU_EVENT_LINK_INVALIDATED),
 	{ 0, NULL }
 };
 
diff --git a/openbsc/src/libmsc/auth.c b/openbsc/src/libmsc/auth.c
index 3b1fd73..bf62d3c 100644
--- a/openbsc/src/libmsc/auth.c
+++ b/openbsc/src/libmsc/auth.c
@@ -26,19 +26,18 @@
 #include <openbsc/gsm_data.h>
 
 #include <osmocom/gsm/comp128.h>
+#include <osmocom/core/utils.h>
 
 #include <openssl/rand.h>
 
 #include <stdlib.h>
 
 const struct value_string auth_action_names[] = {
-#define AUTH_ACTION_STR(X) { X, #X }
-	AUTH_ACTION_STR(AUTH_ERROR),
-	AUTH_ACTION_STR(AUTH_NOT_AVAIL),
-	AUTH_ACTION_STR(AUTH_DO_AUTH_THEN_CIPH),
-	AUTH_ACTION_STR(AUTH_DO_CIPH),
-	AUTH_ACTION_STR(AUTH_DO_AUTH),
-#undef AUTH_ACTION_STR
+	OSMO_VALUE_STRING(AUTH_ERROR),
+	OSMO_VALUE_STRING(AUTH_NOT_AVAIL),
+	OSMO_VALUE_STRING(AUTH_DO_AUTH_THEN_CIPH),
+	OSMO_VALUE_STRING(AUTH_DO_CIPH),
+	OSMO_VALUE_STRING(AUTH_DO_AUTH),
 	{ 0, NULL }
 };
 

-- 
To view, visit https://gerrit.osmocom.org/1444
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1b44d2a3f293785a01d6a587c78f9e0cbeec70c3
Gerrit-PatchSet: 5
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list