From 4b6f00c7220c8b23a294f0698e2f13aa143964a4 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 8 Oct 2022 07:46:34 +0300 Subject: [PATCH 42/42] 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 3ba7d379a2..d3f239ea33 100644 --- a/common/city.c +++ b/common/city.c @@ -1123,16 +1123,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 1e12494bcb..ac69ff5c49 100644 --- a/common/city.h +++ b/common/city.h @@ -545,7 +545,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