From 25738ea56a6b96d81298e225682c202368302af3 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 18 May 2022 07:02:43 +0300 Subject: [PATCH 6/6] Fix clang-15 unused variable warnings See osdn #44564 Signed-off-by: Marko Lindqvist --- client/gui-qt/cityrep.cpp | 3 --- client/gui-xaw/helpdlg.c | 16 +++++----------- server/savegame.c | 2 -- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/client/gui-qt/cityrep.cpp b/client/gui-qt/cityrep.cpp index b1d27e5f87..d3ccea9361 100644 --- a/client/gui-qt/cityrep.cpp +++ b/client/gui-qt/cityrep.cpp @@ -474,7 +474,6 @@ void city_widget::display_list_menu(const QPoint &) cid id; const char *imprname; enum menu_labels m_state; - int sell_count; int sell_gold; int sell_ret = QMessageBox::Cancel; struct city *pcity; @@ -552,7 +551,6 @@ void city_widget::display_list_menu(const QPoint &) connect(&cty_center, &QAction::triggered, this, &city_widget::center); } act = 0; - sell_count = 0; sell_gold = 0; sell_ask = true; act = list_menu.exec(QCursor::pos()); @@ -666,7 +664,6 @@ void city_widget::display_list_menu(const QPoint &) } if (sell_ret == QMessageBox::Ok) { if (!pcity->did_sell && city_has_building(pcity, building)) { - sell_count++; sell_gold += impr_sell_gold(building); city_sell_improvement(pcity, improvement_number(building)); } diff --git a/client/gui-xaw/helpdlg.c b/client/gui-xaw/helpdlg.c index 0edf7b2427..57114ce2f4 100644 --- a/client/gui-xaw/helpdlg.c +++ b/client/gui-xaw/helpdlg.c @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold 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 @@ -734,9 +734,8 @@ static void help_update_improvement(const struct help_item *pitem, create_help_page(HELP_IMPROVEMENT); - if (imp && !is_great_wonder(imp)) { + if (imp && !is_great_wonder(imp)) { char req_buf[512]; - int i; sprintf(buf, "%d ", impr_build_shield_cost(imp)); xaw_set_label(help_improvement_cost_data, buf); @@ -748,13 +747,12 @@ static void help_update_improvement(const struct help_item *pitem, xaw_set_label(help_improvement_req_data, advance_name_translation(advance_by_number(imp->tech_req))); }*/ - + /* FIXME: this should show ranges, negated reqs, and all the * MAX_NUM_REQS reqs. * Currently it's limited to 1 req but this code is partially prepared * to be extended. Remember MAX_NUM_REQS is a compile-time * definition. */ - i = 0; requirement_vector_iterate(&imp->reqs, preq) { if (!preq->present) { continue; @@ -762,7 +760,6 @@ static void help_update_improvement(const struct help_item *pitem, xaw_set_label(help_improvement_req_data, universal_name_translation(&preq->source, req_buf, sizeof(req_buf))); - i++; break; } requirement_vector_iterate_end; /* create_tech_tree(help_tech_tree, 0, @@ -783,16 +780,15 @@ static void help_update_improvement(const struct help_item *pitem, Update wonder help. **************************************************************************/ static void help_update_wonder(const struct help_item *pitem, - char *title) + char *title) { char buf[64000]; struct impr_type *imp = improvement_by_translated_name(title); create_help_page(HELP_WONDER); - if (imp && is_great_wonder(imp)) { + if (imp && is_great_wonder(imp)) { char req_buf[512]; - int i; struct advance *obs_tech = NULL; sprintf(buf, "%d ", impr_build_shield_cost(imp)); @@ -802,7 +798,6 @@ static void help_update_wonder(const struct help_item *pitem, * Currently it's limited to 1 req but this code is partially prepared * to be extended. Remember MAX_NUM_REQS is a compile-time * definition. */ - i = 0; requirement_vector_iterate(&imp->reqs, preq) { if (!preq->present) { continue; @@ -810,7 +805,6 @@ static void help_update_wonder(const struct help_item *pitem, xaw_set_label(help_improvement_req_data, universal_name_translation(&preq->source, req_buf, sizeof(req_buf))); - i++; break; } requirement_vector_iterate_end; diff --git a/server/savegame.c b/server/savegame.c index 4bc69c8d35..51fcfbf5ed 100644 --- a/server/savegame.c +++ b/server/savegame.c @@ -3947,7 +3947,6 @@ static void game_load_internal(struct section_file *file) if (!game.info.is_new_game) { int *worked_tiles = NULL; /* temporary map for worked tiles */ - int loaded_players = 0; int players; /* Update time has been saved as year in legacysave.c */ @@ -3996,7 +3995,6 @@ static void game_load_internal(struct section_file *file) default_ai_type_name(), NULL, FALSE); server_player_init(pplayer, FALSE, FALSE); - loaded_players++; } player_slots_iterate_end; /* check number of players */ -- 2.35.1