[PATCH] libosmocore[master]: features: define osmo_bts_*_feature() as static inline

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/.

dexter gerrit-no-reply at lists.osmocom.org
Mon Mar 5 12:33:40 UTC 2018


Review at  https://gerrit.osmocom.org/7084

features: define osmo_bts_*_feature() as static inline

The functions osmo_bts_set_feature() and osmo_bts_has_feature() are
currently defined as inline. Since inline is a hinting, the compiler
might choose not to inline the function. This eventually leads to
linker problems because the function is then defined multiple times.

- use "static inline" instead of "inline" only.

This patch is a follow up patch to
Change Id 680acae725b2b8dda2f239ff20073306fdfb3f6e

Change-Id: Iddd97415a17b06b69f69ddca2e2e296eb2f23a89
---
M include/osmocom/gsm/bts_features.h
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/84/7084/1

diff --git a/include/osmocom/gsm/bts_features.h b/include/osmocom/gsm/bts_features.h
index f9b0142..e84f95b 100644
--- a/include/osmocom/gsm/bts_features.h
+++ b/include/osmocom/gsm/bts_features.h
@@ -30,13 +30,13 @@
 
 const char *osmo_bts_feature_name(enum osmo_bts_features feature);
 
-inline int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_features feature)
+static inline int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_features feature)
 {
 	OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
 	return bitvec_set_bit_pos(features, feature, 1);
 }
 
-inline bool osmo_bts_has_feature(const struct bitvec *features, enum osmo_bts_features feature)
+static inline bool osmo_bts_has_feature(const struct bitvec *features, enum osmo_bts_features feature)
 {
 	OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
 	return bitvec_get_bit_pos(features, feature);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iddd97415a17b06b69f69ddca2e2e296eb2f23a89
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list