From 26fce7eee91ce3f7eb7c8db4906a71785624d37f Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 8 Oct 2022 07:50:54 +0300 Subject: [PATCH 23/23] Macrofy city_owner() See osdn #45634 Signed-off-by: Marko Lindqvist --- common/city.c | 10 ---------- common/city.h | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/common/city.c b/common/city.c index 54e22acebf..8dffe0b309 100644 --- a/common/city.c +++ b/common/city.c @@ -1087,16 +1087,6 @@ const char *city_name_get(const struct city *pcity) } #endif /* city_name_get */ -/************************************************************************** - Return the owner of the city. -**************************************************************************/ -struct player *city_owner(const struct city *pcity) -{ - fc_assert_ret_val(NULL != pcity, NULL); - fc_assert(NULL != pcity->owner); - return pcity->owner; -} - /***************************************************************************** Add a (positive or negative) value to the city size. As citizens is an unsigned value use int for the parameter 'add'. diff --git a/common/city.h b/common/city.h index e2e7edac65..91ce4efe90 100644 --- a/common/city.h +++ b/common/city.h @@ -529,7 +529,7 @@ void set_city_production(struct city *pcity); /* properties */ const char *city_name_get(const struct city *pcity); -struct player *city_owner(const struct city *pcity); +#define city_owner(_pcity_) (_pcity_)->owner #define city_tile(_pcity_) (_pcity_)->tile /***************************************************************************** -- 2.35.1