From 768e48d6e06c658102622bac12007fb72c1bb200 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 9 Jun 2023 01:27:31 +0300 Subject: [PATCH 33/33] Give city_create_unit() parameters nonnull attribute To make it easier detect if someone adds a call potentially with NULL. Reported by Lexxie See osdn #45893 Signed-off-by: Marko Lindqvist --- server/cityturn.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/cityturn.c b/server/cityturn.c index 806fb74244..36d72b6c51 100644 --- a/server/cityturn.c +++ b/server/cityturn.c @@ -100,6 +100,10 @@ static bool city_distribute_surplus_shields(struct player *pplayer, static bool city_build_building(struct player *pplayer, struct city *pcity); static bool city_build_unit(struct player *pplayer, struct city *pcity); static bool city_build_stuff(struct player *pplayer, struct city *pcity); +static struct unit *city_create_unit(struct city *pcity, + const struct unit_type *utype, + struct citizens_reduction *red) + fc__attribute((nonnull (1, 2))); static const struct impr_type *building_upgrades_to(struct city *pcity, const struct impr_type *pimprove); static void upgrade_building_prod(struct city *pcity); -- 2.39.2