From 5bbf558921a21e8f84746e6ebbbd8cf4ee052db2 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 14 Jul 2022 16:39:18 +0300 Subject: [PATCH 16/16] dai_effect_value(): Drop unused government parameter See osdn #44713 Signed-off-by: Marko Lindqvist --- ai/default/aicity.c | 3 +-- ai/default/aidata.c | 2 +- ai/default/aitech.c | 3 +-- ai/default/daieffects.c | 2 +- ai/default/daieffects.h | 4 ++-- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ai/default/aicity.c b/ai/default/aicity.c index 08c05fc457..e8a23c55b6 100644 --- a/ai/default/aicity.c +++ b/ai/default/aicity.c @@ -1513,7 +1513,6 @@ static void adjust_improvement_wants_by_effects(struct ai_type *ait, struct adv_data *ai = adv_data_get(pplayer, NULL); bool capital = is_capital(pcity); bool can_build = TRUE; - struct government *gov = government_of_player(pplayer); struct universal source = { .kind = VUT_IMPROVEMENT, .value = {.building = pimprove} @@ -1629,7 +1628,7 @@ static void adjust_improvement_wants_by_effects(struct ai_type *ait, n_needed_techs = tech_vector_size(&needed_techs); if ((active || n_needed_techs) && !impossible_to_get) { - adv_want v1 = dai_effect_value(pplayer, gov, ai, pcity, capital, + adv_want v1 = dai_effect_value(pplayer, ai, pcity, capital, turns, peffect, cities[mypreq->range], nplayers); /* v1 could be negative (the effect could be undesirable), diff --git a/ai/default/aidata.c b/ai/default/aidata.c index 7818c5010e..e586d04b5a 100644 --- a/ai/default/aidata.c +++ b/ai/default/aidata.c @@ -558,7 +558,7 @@ void dai_gov_value(struct ai_type *ait, struct player *pplayer, if (active) { adv_want v1; - v1 = dai_effect_value(pplayer, gov, adv, pcity, capital, + v1 = dai_effect_value(pplayer, adv, pcity, capital, turns, peffect, 1, nplayers); diff --git a/ai/default/aitech.c b/ai/default/aitech.c index 24f9cd28b5..66b2646215 100644 --- a/ai/default/aitech.c +++ b/ai/default/aitech.c @@ -234,7 +234,6 @@ static void dai_tech_effect_values(struct ai_type *ait, struct player *pplayer) { /* TODO: Currently this duplicates code from aicity.c improvement effect * evaluating almost verbose - refactor so that they can share code. */ - struct government *gov = government_of_player(pplayer); struct adv_data *adv = adv_data_get(pplayer, NULL); struct ai_plr *aip = def_ai_player_data(pplayer, ait); int turns = 9999; /* TODO: Set to correct value */ @@ -286,7 +285,7 @@ static void dai_tech_effect_values(struct ai_type *ait, struct player *pplayer) if (active) { adv_want v1; - v1 = dai_effect_value(pplayer, gov, adv, pcity, capital, + v1 = dai_effect_value(pplayer, adv, pcity, capital, turns, peffect, 1, nplayers); diff --git a/ai/default/daieffects.c b/ai/default/daieffects.c index a1b16c74f0..6c11977f94 100644 --- a/ai/default/daieffects.c +++ b/ai/default/daieffects.c @@ -134,7 +134,7 @@ static int num_affected_units(const struct effect *peffect, How desirable is a particular effect for a particular city, given the number of cities in range (c). **************************************************************************/ -adv_want dai_effect_value(struct player *pplayer, struct government *gov, +adv_want dai_effect_value(struct player *pplayer, const struct adv_data *ai, const struct city *pcity, const bool capital, int turns, const struct effect *peffect, const int c, diff --git a/ai/default/daieffects.h b/ai/default/daieffects.h index 7d2a7c9c0a..f1b38a2ebf 100644 --- a/ai/default/daieffects.h +++ b/ai/default/daieffects.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 2002 - The Freeciv Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,7 +13,7 @@ #ifndef FC__DAI_EFFECTS_H #define FC__DAI_EFFECTS_H -adv_want dai_effect_value(struct player *pplayer, struct government *gov, +adv_want dai_effect_value(struct player *pplayer, const struct adv_data *ai, const struct city *pcity, const bool capital, int turns, const struct effect *peffect, const int c, -- 2.35.1