From 9b69ef085d78e2444742b2ec20f9dad9e030227b Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 26 May 2023 23:16:30 +0300 Subject: [PATCH 9/9] Add nonnull attribute to ap_diplomat_battle() tgt_tile See osdn #48069 Signed-off-by: Marko Lindqvist --- common/actions.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/actions.c b/common/actions.c index 68f461ef8a..2b9eb92d60 100644 --- a/common/actions.c +++ b/common/actions.c @@ -134,6 +134,11 @@ action_prob_not_relevant(const struct act_prob probability); static inline bool action_prob_not_impl(const struct act_prob probability); +static struct act_prob ap_diplomat_battle(const struct unit *pattacker, + const struct unit *pvictim, + const struct tile *tgt_tile) + fc__attribute((nonnull(3))); + /* Make sure that an action distance can target the whole map. */ FC_STATIC_ASSERT(MAP_DISTANCE_MAX <= ACTION_DISTANCE_LAST_NON_SIGNAL, action_range_can_not_cover_the_whole_map); @@ -5309,8 +5314,6 @@ static struct act_prob ap_diplomat_battle(const struct unit *pattacker, { struct unit *pdefender; - fc_assert_ret_val(tgt_tile, ACTPROB_NOT_KNOWN); - if (!can_player_see_hypotetic_units_at(unit_owner(pattacker), tgt_tile)) { /* Don't leak information about unseen defenders. */ -- 2.39.2