From 7eb94a5082199d7a94e741e1f54a66366a517077 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 26 May 2023 23:15:32 +0300 Subject: [PATCH 16/16] Add nonnull attribute to ap_diplomat_battle() tgt_tile See osdn #48069 Signed-off-by: Marko Lindqvist --- common/actions.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/actions.c b/common/actions.c index b563a4e314..29f36821f3 100644 --- a/common/actions.c +++ b/common/actions.c @@ -131,6 +131,12 @@ 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, + const struct action *paction) + 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); @@ -4550,8 +4556,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