From 4acb6aa9c3c7994c90759f9e9bc64e1c44e49209 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 2 Oct 2022 17:38:24 +0300 Subject: [PATCH 43/43] Remove unnecessary includes from common/ headers See osdn #45720 Signed-off-by: Marko Lindqvist --- ai/aitraits.c | 1 + ai/default/aidiplomat.c | 1 + ai/default/aihunt.c | 1 + ai/default/aitools.c | 1 + ai/default/aiunit.c | 1 + ai/default/daiactions.c | 1 + ai/default/dailog.c | 1 + ai/default/daiplayer.c | 1 + client/agents/agents.c | 3 +++ client/agents/cma_core.c | 1 + client/cityrepdata.c | 1 + client/gui-gtk-3.22/citizensinfo.c | 1 + client/gui-gtk-3.22/diplodlg.c | 1 + client/gui-gtk-3.22/editprop.c | 1 + client/gui-gtk-3.22/helpdlg.c | 1 + client/gui-gtk-3.22/inteldlg.c | 1 + client/gui-gtk-3.22/mapview.c | 3 ++- client/gui-gtk-3.22/unitselextradlg.c | 1 + client/gui-gtk-4.0/citizensinfo.c | 1 + client/gui-gtk-4.0/diplodlg.c | 1 + client/gui-gtk-4.0/editprop.c | 1 + client/gui-gtk-4.0/helpdlg.c | 1 + client/gui-gtk-4.0/inteldlg.c | 1 + client/gui-gtk-4.0/mapview.c | 3 ++- client/gui-gtk-4.0/unitselextradlg.c | 1 + client/gui-qt/colors.cpp | 3 +++ client/gui-qt/pages.cpp | 1 + client/gui-sdl2/colors.c | 3 +++ client/gui-sdl2/finddlg.c | 1 + client/gui-sdl2/gotodlg.c | 1 + client/gui-sdl2/inteldlg.c | 1 + client/gui-sdl2/plrdlg.c | 3 +++ client/gui-sdl2/spaceshipdlg.c | 1 + client/helpdata.c | 1 + client/plrdlg_common.c | 1 + client/text.c | 1 + common/actions.c | 2 ++ common/actions.h | 1 - common/borders.h | 4 +++- common/calendar.h | 3 ++- common/city.h | 9 +++++---- common/clientutils.h | 2 +- common/diptreaty.c | 1 + common/effects.h | 9 +++++---- common/extras.h | 7 ++++--- common/game.c | 1 + common/game.h | 9 ++++----- common/government.c | 1 + common/idex.c | 1 + common/idex.h | 5 +++-- common/map.h | 6 ++++-- common/map_types.h | 4 ++-- common/movement.h | 4 +++- common/nation.c | 1 + common/nation.h | 5 +++-- common/player.c | 1 + common/player.h | 4 ++-- common/reqtext.c | 1 + common/requirements.c | 1 + common/requirements.h | 5 ++--- common/research.c | 1 + common/tile.h | 7 ++++--- common/unit.h | 4 ++-- common/worklist.h | 2 +- common/world_object.h | 4 +++- server/actiontools.c | 1 + server/advisors/autosettlers.c | 1 + server/animals.c | 1 + server/gamehand.c | 1 + server/generator/mapgen.c | 1 + server/meta.c | 1 + server/plrhand.h | 1 + server/report.c | 1 + server/rssanity.c | 3 ++- server/sanitycheck.c | 1 + server/settings.c | 1 + server/spacerace.c | 1 + server/srv_log.c | 1 + tools/ruledit/effect_edit.cpp | 1 + tools/ruledit/univ_value.c | 1 + tools/ruleutil/rulesave.c | 5 ++++- 81 files changed, 130 insertions(+), 45 deletions(-) diff --git a/ai/aitraits.c b/ai/aitraits.c index 5716145329..215fc858a4 100644 --- a/ai/aitraits.c +++ b/ai/aitraits.c @@ -21,6 +21,7 @@ /* common */ #include "game.h" +#include "nation.h" #include "player.h" #include "traits.h" diff --git a/ai/default/aidiplomat.c b/ai/default/aidiplomat.c index 224b2a8d2a..7b4e932217 100644 --- a/ai/default/aidiplomat.c +++ b/ai/default/aidiplomat.c @@ -30,6 +30,7 @@ #include "government.h" #include "map.h" #include "movement.h" +#include "nation.h" #include "packets.h" #include "player.h" #include "research.h" diff --git a/ai/default/aihunt.c b/ai/default/aihunt.c index d45fed8ed9..dab852fd90 100644 --- a/ai/default/aihunt.c +++ b/ai/default/aihunt.c @@ -25,6 +25,7 @@ #include "game.h" #include "map.h" #include "movement.h" +#include "nation.h" #include "player.h" #include "unit.h" #include "unitlist.h" diff --git a/ai/default/aitools.c b/ai/default/aitools.c index f1b6fe2965..141f79c5cf 100644 --- a/ai/default/aitools.c +++ b/ai/default/aitools.c @@ -28,6 +28,7 @@ #include "government.h" #include "map.h" #include "movement.h" +#include "nation.h" #include "packets.h" #include "player.h" #include "unit.h" diff --git a/ai/default/aiunit.c b/ai/default/aiunit.c index 9cfd41d339..e73ef510be 100644 --- a/ai/default/aiunit.c +++ b/ai/default/aiunit.c @@ -21,6 +21,7 @@ #include "bitvector.h" #include "log.h" #include "mem.h" +#include "nation.h" #include "rand.h" #include "registry.h" #include "shared.h" diff --git a/ai/default/daiactions.c b/ai/default/daiactions.c index ae014664ae..deba809ed9 100644 --- a/ai/default/daiactions.c +++ b/ai/default/daiactions.c @@ -17,6 +17,7 @@ /* common */ #include "city.h" +#include "metaknowledge.h" #include "movement.h" #include "player.h" #include "research.h" diff --git a/ai/default/dailog.c b/ai/default/dailog.c index 5f313e7973..c10359323e 100644 --- a/ai/default/dailog.c +++ b/ai/default/dailog.c @@ -19,6 +19,7 @@ /* common */ #include "map.h" +#include "nation.h" #include "player.h" #include "research.h" diff --git a/ai/default/daiplayer.c b/ai/default/daiplayer.c index 7387088ffc..8f8ae8e7f3 100644 --- a/ai/default/daiplayer.c +++ b/ai/default/daiplayer.c @@ -20,6 +20,7 @@ #include "city.h" #include "game.h" #include "unit.h" +#include "world_object.h" /* server */ #include "citytools.h" diff --git a/client/agents/agents.c b/client/agents/agents.c index 19d9f4c941..cfcb3c307c 100644 --- a/client/agents/agents.c +++ b/client/agents/agents.c @@ -24,6 +24,9 @@ #include "mem.h" #include "timing.h" +/* common */ +#include "nation.h" + /* client */ #include "client_main.h" diff --git a/client/agents/cma_core.c b/client/agents/cma_core.c index 0f7fa4872d..12494a29c3 100644 --- a/client/agents/cma_core.c +++ b/client/agents/cma_core.c @@ -36,6 +36,7 @@ #include "events.h" #include "game.h" #include "government.h" +#include "nation.h" #include "packets.h" #include "specialist.h" diff --git a/client/cityrepdata.c b/client/cityrepdata.c index fda5ec4e6b..fb4ec84270 100644 --- a/client/cityrepdata.c +++ b/client/cityrepdata.c @@ -31,6 +31,7 @@ #include "culture.h" #include "game.h" #include "map.h" +#include "nation.h" #include "specialist.h" #include "unitlist.h" diff --git a/client/gui-gtk-3.22/citizensinfo.c b/client/gui-gtk-3.22/citizensinfo.c index ba9f5c58af..cacee129e9 100644 --- a/client/gui-gtk-3.22/citizensinfo.c +++ b/client/gui-gtk-3.22/citizensinfo.c @@ -26,6 +26,7 @@ /* common */ #include "citizens.h" #include "city.h" +#include "nation.h" #include "player.h" /* client/gui-gtk-3.22 */ diff --git a/client/gui-gtk-3.22/diplodlg.c b/client/gui-gtk-3.22/diplodlg.c index 08ddc2ab45..7723c0e5e5 100644 --- a/client/gui-gtk-3.22/diplodlg.c +++ b/client/gui-gtk-3.22/diplodlg.c @@ -32,6 +32,7 @@ #include "game.h" #include "government.h" #include "map.h" +#include "nation.h" #include "packets.h" #include "player.h" #include "research.h" diff --git a/client/gui-gtk-3.22/editprop.c b/client/gui-gtk-3.22/editprop.c index 8dfff7984c..a042cc9cc0 100644 --- a/client/gui-gtk-3.22/editprop.c +++ b/client/gui-gtk-3.22/editprop.c @@ -33,6 +33,7 @@ #include "government.h" #include "map.h" #include "movement.h" +#include "nation.h" #include "research.h" #include "tile.h" diff --git a/client/gui-gtk-3.22/helpdlg.c b/client/gui-gtk-3.22/helpdlg.c index 38381a9529..e90df5de2d 100644 --- a/client/gui-gtk-3.22/helpdlg.c +++ b/client/gui-gtk-3.22/helpdlg.c @@ -33,6 +33,7 @@ #include "game.h" #include "government.h" #include "movement.h" +#include "nation.h" #include "specialist.h" #include "tech.h" #include "unit.h" diff --git a/client/gui-gtk-3.22/inteldlg.c b/client/gui-gtk-3.22/inteldlg.c index 34aa4ff9dd..26d9fbe3a0 100644 --- a/client/gui-gtk-3.22/inteldlg.c +++ b/client/gui-gtk-3.22/inteldlg.c @@ -28,6 +28,7 @@ /* common */ #include "government.h" +#include "nation.h" #include "packets.h" #include "player.h" #include "research.h" diff --git a/client/gui-gtk-3.22/mapview.c b/client/gui-gtk-3.22/mapview.c index 04ef0bb66b..60c89acfaa 100644 --- a/client/gui-gtk-3.22/mapview.c +++ b/client/gui-gtk-3.22/mapview.c @@ -33,8 +33,9 @@ /* common */ #include "game.h" -#include "government.h" /* government_graphic() */ +#include "government.h" /* government_graphic() */ #include "map.h" +#include "nation.h" #include "player.h" /* client */ diff --git a/client/gui-gtk-3.22/unitselextradlg.c b/client/gui-gtk-3.22/unitselextradlg.c index c735ac095b..7d174154bc 100644 --- a/client/gui-gtk-3.22/unitselextradlg.c +++ b/client/gui-gtk-3.22/unitselextradlg.c @@ -24,6 +24,7 @@ #include "extras.h" #include "game.h" #include "movement.h" +#include "nation.h" #include "unit.h" /* client */ diff --git a/client/gui-gtk-4.0/citizensinfo.c b/client/gui-gtk-4.0/citizensinfo.c index 3593cb8dec..f639fd7a00 100644 --- a/client/gui-gtk-4.0/citizensinfo.c +++ b/client/gui-gtk-4.0/citizensinfo.c @@ -25,6 +25,7 @@ /* common */ #include "citizens.h" #include "city.h" +#include "nation.h" #include "player.h" /* client/gui-gtk-4.0 */ diff --git a/client/gui-gtk-4.0/diplodlg.c b/client/gui-gtk-4.0/diplodlg.c index 01b600668c..2b4f3e53d2 100644 --- a/client/gui-gtk-4.0/diplodlg.c +++ b/client/gui-gtk-4.0/diplodlg.c @@ -32,6 +32,7 @@ #include "game.h" #include "government.h" #include "map.h" +#include "nation.h" #include "packets.h" #include "player.h" #include "research.h" diff --git a/client/gui-gtk-4.0/editprop.c b/client/gui-gtk-4.0/editprop.c index 7d4996263a..221eec0e1f 100644 --- a/client/gui-gtk-4.0/editprop.c +++ b/client/gui-gtk-4.0/editprop.c @@ -33,6 +33,7 @@ #include "government.h" #include "map.h" #include "movement.h" +#include "nation.h" #include "research.h" #include "tile.h" diff --git a/client/gui-gtk-4.0/helpdlg.c b/client/gui-gtk-4.0/helpdlg.c index c020e67140..a4eeca7bb2 100644 --- a/client/gui-gtk-4.0/helpdlg.c +++ b/client/gui-gtk-4.0/helpdlg.c @@ -33,6 +33,7 @@ #include "game.h" #include "government.h" #include "movement.h" +#include "nation.h" #include "specialist.h" #include "tech.h" #include "unit.h" diff --git a/client/gui-gtk-4.0/inteldlg.c b/client/gui-gtk-4.0/inteldlg.c index 3d9693ce2f..710cf9bbbf 100644 --- a/client/gui-gtk-4.0/inteldlg.c +++ b/client/gui-gtk-4.0/inteldlg.c @@ -28,6 +28,7 @@ /* common */ #include "government.h" +#include "nation.h" #include "packets.h" #include "player.h" #include "research.h" diff --git a/client/gui-gtk-4.0/mapview.c b/client/gui-gtk-4.0/mapview.c index 0cd6d37378..870ad11a25 100644 --- a/client/gui-gtk-4.0/mapview.c +++ b/client/gui-gtk-4.0/mapview.c @@ -33,8 +33,9 @@ /* common */ #include "game.h" -#include "government.h" /* government_graphic() */ +#include "government.h" /* government_graphic() */ #include "map.h" +#include "nation.h" #include "player.h" /* client */ diff --git a/client/gui-gtk-4.0/unitselextradlg.c b/client/gui-gtk-4.0/unitselextradlg.c index 685986bbdf..71efe353a3 100644 --- a/client/gui-gtk-4.0/unitselextradlg.c +++ b/client/gui-gtk-4.0/unitselextradlg.c @@ -24,6 +24,7 @@ #include "extras.h" #include "game.h" #include "movement.h" +#include "nation.h" #include "unit.h" /* client */ diff --git a/client/gui-qt/colors.cpp b/client/gui-qt/colors.cpp index 6f4813d43b..40a3b2f3ed 100644 --- a/client/gui-qt/colors.cpp +++ b/client/gui-qt/colors.cpp @@ -18,6 +18,9 @@ // utility #include "mem.h" +// common +#include "rgbcolor.h" + // gui-qt #include "qtg_cxxside.h" diff --git a/client/gui-qt/pages.cpp b/client/gui-qt/pages.cpp index e79ee80f68..a40a2e1028 100644 --- a/client/gui-qt/pages.cpp +++ b/client/gui-qt/pages.cpp @@ -33,6 +33,7 @@ // common #include "game.h" +#include "rgbcolor.h" #include "version.h" // client diff --git a/client/gui-sdl2/colors.c b/client/gui-sdl2/colors.c index 59f6d4c9bf..9740e8b0e0 100644 --- a/client/gui-sdl2/colors.c +++ b/client/gui-sdl2/colors.c @@ -30,6 +30,9 @@ #include #endif /* SDL2_PLAIN_INCLUDE */ +/* common */ +#include "rgbcolor.h" + /* client */ #include "tilespec.h" diff --git a/client/gui-sdl2/finddlg.c b/client/gui-sdl2/finddlg.c index bea72c2730..db03c0880d 100644 --- a/client/gui-sdl2/finddlg.c +++ b/client/gui-sdl2/finddlg.c @@ -30,6 +30,7 @@ /* common */ #include "game.h" +#include "nation.h" /* gui-sdl2 */ #include "colors.h" diff --git a/client/gui-sdl2/gotodlg.c b/client/gui-sdl2/gotodlg.c index c8e0bd7df3..4ca5a15852 100644 --- a/client/gui-sdl2/gotodlg.c +++ b/client/gui-sdl2/gotodlg.c @@ -32,6 +32,7 @@ /* common */ #include "game.h" #include "fc_types.h" /* bv_player */ +#include "nation.h" #include "unitlist.h" /* client */ diff --git a/client/gui-sdl2/inteldlg.c b/client/gui-sdl2/inteldlg.c index 2da2ea1cab..184d4ce643 100644 --- a/client/gui-sdl2/inteldlg.c +++ b/client/gui-sdl2/inteldlg.c @@ -28,6 +28,7 @@ /* common */ #include "government.h" +#include "nation.h" #include "research.h" /* client */ diff --git a/client/gui-sdl2/plrdlg.c b/client/gui-sdl2/plrdlg.c index 138f87c038..08ab1475f7 100644 --- a/client/gui-sdl2/plrdlg.c +++ b/client/gui-sdl2/plrdlg.c @@ -26,6 +26,9 @@ #include "astring.h" #include "fcintl.h" +/* common */ +#include "nation.h" + /* client */ #include "client_main.h" #include "climisc.h" diff --git a/client/gui-sdl2/spaceshipdlg.c b/client/gui-sdl2/spaceshipdlg.c index e4e32df34c..3b6b5c1b63 100644 --- a/client/gui-sdl2/spaceshipdlg.c +++ b/client/gui-sdl2/spaceshipdlg.c @@ -21,6 +21,7 @@ /* common */ #include "game.h" +#include "nation.h" #include "packets.h" #include "victory.h" diff --git a/client/helpdata.c b/client/helpdata.c index 212705ddae..4e82662b10 100644 --- a/client/helpdata.c +++ b/client/helpdata.c @@ -41,6 +41,7 @@ #include "map.h" #include "movement.h" #include "multipliers.h" +#include "nation.h" #include "reqtext.h" #include "research.h" #include "server_settings.h" diff --git a/client/plrdlg_common.c b/client/plrdlg_common.c index 0a2331671b..76257d243f 100644 --- a/client/plrdlg_common.c +++ b/client/plrdlg_common.c @@ -26,6 +26,7 @@ #include "connection.h" #include "game.h" #include "government.h" +#include "nation.h" #include "research.h" /* client */ diff --git a/client/text.c b/client/text.c index 84f6d2489d..ba1e51546f 100644 --- a/client/text.c +++ b/client/text.c @@ -36,6 +36,7 @@ #include "game.h" #include "government.h" #include "map.h" +#include "nation.h" #include "research.h" #include "traderoutes.h" #include "unitlist.h" diff --git a/common/actions.c b/common/actions.c index a20371c5c1..6fa74c1aa0 100644 --- a/common/actions.c +++ b/common/actions.c @@ -28,7 +28,9 @@ #include "fc_interface.h" #include "game.h" #include "map.h" +#include "metaknowledge.h" #include "movement.h" +#include "nation.h" #include "research.h" #include "server_settings.h" #include "tile.h" diff --git a/common/actions.h b/common/actions.h index c16798e956..4de91fc3a5 100644 --- a/common/actions.h +++ b/common/actions.h @@ -16,7 +16,6 @@ /* common */ #include "fc_types.h" -#include "metaknowledge.h" #include "requirements.h" #ifdef __cplusplus diff --git a/common/borders.h b/common/borders.h index 83200cf5a0..72b0c20125 100644 --- a/common/borders.h +++ b/common/borders.h @@ -17,6 +17,8 @@ extern "C" { #endif /* __cplusplus */ +struct tile; + bool is_border_source(struct tile *ptile); int tile_border_source_radius_sq(struct tile *ptile); int tile_border_source_strength(struct tile *ptile); @@ -26,4 +28,4 @@ int tile_border_strength(struct tile *ptile, struct tile *source); } #endif /* __cplusplus */ -#endif /* FC__BORDERS_H */ +#endif /* FC__BORDERS_H */ diff --git a/common/calendar.h b/common/calendar.h index 6eb67ca3c3..54e0b37ed6 100644 --- a/common/calendar.h +++ b/common/calendar.h @@ -20,6 +20,7 @@ extern "C" { #define FIRST_TURN 1 struct packet_game_info; + void game_next_year(struct packet_game_info *info); void game_advance_year(void); @@ -31,4 +32,4 @@ const char *calendar_text(void); } #endif /* __cplusplus */ -#endif /* FC__CALENDAR_H */ +#endif /* FC__CALENDAR_H */ diff --git a/common/city.h b/common/city.h index 24c4d7defc..1e12494bcb 100644 --- a/common/city.h +++ b/common/city.h @@ -24,15 +24,16 @@ extern "C" { /* common */ #include "fc_types.h" #include "name_translation.h" -#include "improvement.h" #include "tile.h" #include "traderoutes.h" -#include "unit.h" -#include "unitlist.h" -#include "vision.h" #include "workertask.h" #include "worklist.h" +struct impr_type; +struct unit; +struct unit_list; +struct vision; + enum production_class_type { PCT_UNIT, PCT_NORMAL_IMPROVEMENT, diff --git a/common/clientutils.h b/common/clientutils.h index 96664d9af2..609cf7498c 100644 --- a/common/clientutils.h +++ b/common/clientutils.h @@ -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 diff --git a/common/diptreaty.c b/common/diptreaty.c index 88ffcdad6a..4df9c23206 100644 --- a/common/diptreaty.c +++ b/common/diptreaty.c @@ -21,6 +21,7 @@ /* common */ #include "game.h" +#include "nation.h" #include "player.h" #include "diptreaty.h" diff --git a/common/effects.h b/common/effects.h index e7b51642d6..8cb6f7be2d 100644 --- a/common/effects.h +++ b/common/effects.h @@ -21,12 +21,13 @@ extern "C" { #include "support.h" /* bool type */ /* common */ -#include "connection.h" #include "fc_types.h" -#include "multipliers.h" #include "requirements.h" +struct conn_list; +struct multiplier; + /* Type of effects. Add new values via SPECENUM_VALUE%d and * SPECENUM_VALUE%dNAME at the end of the list. * Used in the network protocol. @@ -353,8 +354,8 @@ extern "C" { struct effect { enum effect_type type; - /* pointer to multipliers (NULL means that this effect has no multiplier */ - struct multiplier *multiplier; + /* Pointer to multipliers (NULL means that this effect has no multiplier */ + struct multiplier *multiplier; /* The "value" of the effect. The meaning of this varies between * effects. When get_xxx_bonus() is called the value of all applicable diff --git a/common/extras.h b/common/extras.h index deecb64754..4ca3ed89e2 100644 --- a/common/extras.h +++ b/common/extras.h @@ -18,10 +18,11 @@ extern "C" { #endif /* __cplusplus */ /* common */ -#include "base.h" #include "fc_types.h" -#include "road.h" -#include "terrain.h" +#include "unittype.h" + +struct base_type; +struct road_type; /* Used in the network protocol. */ #define SPECENUM_NAME extra_flag_id diff --git a/common/game.c b/common/game.c index 11f48eed66..0cccfdca03 100644 --- a/common/game.c +++ b/common/game.c @@ -45,6 +45,7 @@ #include "packets.h" #include "player.h" #include "research.h" +#include "rgbcolor.h" #include "spaceship.h" #include "specialist.h" #include "style.h" diff --git a/common/game.h b/common/game.h index 0e17d95786..56b193de4d 100644 --- a/common/game.h +++ b/common/game.h @@ -24,17 +24,17 @@ extern "C" { #endif /* utility */ -#include "fcthread.h" #include "randseed.h" #include "shared.h" #include "timing.h" /* common */ -#include "connection.h" /* struct conn_list */ +#include "connection.h" /* struct conn_list */ #include "fc_types.h" -#include "player.h" #include "packets.h" -#include "world_object.h" +#include "traits.h" + +struct world; enum debug_globals { DEBUG_FERRIES, @@ -302,7 +302,6 @@ struct civ_game { extern bool am_i_server; extern struct civ_game game; -extern struct world wld; /**********************************************************************//** Is the program type server? diff --git a/common/government.c b/common/government.c index 4ef19aff87..534ae11714 100644 --- a/common/government.c +++ b/common/government.c @@ -25,6 +25,7 @@ /* common */ #include "game.h" +#include "nation.h" #include "player.h" #include "tech.h" diff --git a/common/idex.c b/common/idex.c index 4428b35cc1..740511e748 100644 --- a/common/idex.c +++ b/common/idex.c @@ -35,6 +35,7 @@ /* common */ #include "city.h" #include "unit.h" +#include "world_object.h" #include "idex.h" diff --git a/common/idex.h b/common/idex.h index e2f4d69059..a3796a15c8 100644 --- a/common/idex.h +++ b/common/idex.h @@ -24,7 +24,8 @@ extern "C" { /* common */ #include "fc_types.h" -#include "world_object.h" + +struct world; void idex_init(struct world *iworld); void idex_free(struct world *iworld); @@ -42,4 +43,4 @@ struct unit *idex_lookup_unit(struct world *iworld, int id); } #endif /* __cplusplus */ -#endif /* FC__IDEX_H */ +#endif /* FC__IDEX_H */ diff --git a/common/map.h b/common/map.h index 9f0af0b5e1..fe8767ba02 100644 --- a/common/map.h +++ b/common/map.h @@ -22,14 +22,16 @@ extern "C" { /* utility */ #include "bitvector.h" #include "iterator.h" -#include "log.h" /* fc_assert */ +#include "log.h" /* fc_assert() */ /* common */ #include "fc_types.h" #include "game.h" #include "map_types.h" -#include "tile.h" #include "packets.h" +#include "world_object.h" + +struct tile; /* Parameters for terrain counting functions. */ static const bool C_ADJACENT = FALSE; diff --git a/common/map_types.h b/common/map_types.h index 4bdd742e94..8938ca72c7 100644 --- a/common/map_types.h +++ b/common/map_types.h @@ -23,7 +23,7 @@ extern "C" { /* common */ #include "fc_types.h" -/**************************************************************** +/***************************************************************** Miscellaneous terrain information *****************************************************************/ #define terrain_misc packet_ruleset_terrain_control @@ -117,4 +117,4 @@ struct civ_map { } #endif /* __cplusplus */ -#endif /* FC__MAP_H */ +#endif /* FC__MAP_H */ diff --git a/common/movement.h b/common/movement.h index 59f53d73f7..3daf8e62ce 100644 --- a/common/movement.h +++ b/common/movement.h @@ -17,9 +17,11 @@ extern "C" { #endif /* __cplusplus */ +/* common */ #include "fc_types.h" #include "map.h" -#include "tile.h" + +struct tile; #define SINGLE_MOVE (terrain_control.move_fragments) #define MOVE_COST_IGTER (terrain_control.igter_cost) diff --git a/common/nation.c b/common/nation.c index eff0b1856b..eadaaf90df 100644 --- a/common/nation.c +++ b/common/nation.c @@ -30,6 +30,7 @@ #include "game.h" #include "government.h" #include "player.h" +#include "rgbcolor.h" #include "tech.h" #include "traits.h" diff --git a/common/nation.h b/common/nation.h index 20fb280782..42cedf3322 100644 --- a/common/nation.h +++ b/common/nation.h @@ -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 @@ -23,9 +23,10 @@ extern "C" { /* common */ #include "fc_types.h" #include "name_translation.h" -#include "rgbcolor.h" #include "terrain.h" /* MAX_NUM_TERRAINS */ +struct rgbcolor; + #define NO_NATION_SELECTED (NULL) /* Changing this value will break network compatibility. */ diff --git a/common/player.c b/common/player.c index 00a0850832..302d4ee400 100644 --- a/common/player.c +++ b/common/player.c @@ -32,6 +32,7 @@ #include "idex.h" #include "improvement.h" #include "map.h" +#include "nation.h" #include "research.h" #include "rgbcolor.h" #include "tech.h" diff --git a/common/player.h b/common/player.h index ec6cb6e07b..e446668114 100644 --- a/common/player.h +++ b/common/player.h @@ -25,16 +25,16 @@ extern "C" { #include "effects.h" #include "fc_types.h" #include "multipliers.h" -#include "nation.h" #include "shared.h" #include "spaceship.h" #include "style.h" #include "tech.h" -#include "traits.h" #include "unitlist.h" #include "vision.h" +struct ai_trait; struct city; +struct nation_type; #define PLAYER_DEFAULT_TAX_RATE 0 #define PLAYER_DEFAULT_SCIENCE_RATE 100 diff --git a/common/reqtext.c b/common/reqtext.c index a420ff80a8..e6139b1a95 100644 --- a/common/reqtext.c +++ b/common/reqtext.c @@ -28,6 +28,7 @@ #include "government.h" #include "map.h" #include "movement.h" +#include "nation.h" #include "player.h" #include "requirements.h" #include "server_settings.h" diff --git a/common/requirements.c b/common/requirements.c index 44741fce5c..b546af9334 100644 --- a/common/requirements.c +++ b/common/requirements.c @@ -32,6 +32,7 @@ #include "government.h" #include "improvement.h" #include "movement.h" +#include "nation.h" #include "player.h" #include "map.h" #include "research.h" diff --git a/common/requirements.h b/common/requirements.h index 068756dcb5..2b74cd516f 100644 --- a/common/requirements.h +++ b/common/requirements.h @@ -18,12 +18,11 @@ extern "C" { #endif /* __cplusplus */ -/* utility */ -#include "astring.h" - /* common */ #include "fc_types.h" +struct astring; + /* Range of requirements. * Used in the network protocol. * Order is important -- wider ranges should come later -- some code diff --git a/common/research.c b/common/research.c index 1620ac8cf7..b9ae9eea95 100644 --- a/common/research.c +++ b/common/research.c @@ -24,6 +24,7 @@ /* common */ #include "fc_types.h" #include "game.h" +#include "nation.h" #include "player.h" #include "name_translation.h" #include "team.h" diff --git a/common/tile.h b/common/tile.h index 01151a7c63..86aac2fa05 100644 --- a/common/tile.h +++ b/common/tile.h @@ -25,12 +25,13 @@ extern "C" { #include "base.h" #include "extras.h" #include "fc_types.h" -#include "player.h" #include "road.h" #include "terrain.h" #include "unitlist.h" -/* network, order dependent */ +struct player; + +/* Network, order dependent */ enum known_type { TILE_UNKNOWN = 0, TILE_KNOWN_UNSEEN = 1, @@ -154,7 +155,7 @@ bool tile_has_extra_flag(const struct tile *ptile, enum extra_flag_id flag);; /* Vision related */ enum known_type tile_get_known(const struct tile *ptile, - const struct player *pplayer); + const struct player *pplayer); bool tile_is_seen(const struct tile *target_tile, const struct player *pow_player); diff --git a/common/unit.h b/common/unit.h index 2a2c662825..d569d64d6d 100644 --- a/common/unit.h +++ b/common/unit.h @@ -23,10 +23,10 @@ extern "C" { /* common */ #include "base.h" #include "fc_types.h" -#include "terrain.h" /* enum tile_special_type */ +#include "map_types.h" +#include "terrain.h" /* enum tile_special_type */ #include "unittype.h" #include "vision.h" -#include "world_object.h" struct road_type; struct unit_move_data; /* Actually defined in "server/unittools.c". */ diff --git a/common/worklist.h b/common/worklist.h index b4b081ccee..546e007639 100644 --- a/common/worklist.h +++ b/common/worklist.h @@ -24,7 +24,7 @@ extern "C" { #define MAX_LEN_WORKLIST 64 #define MAX_NUM_WORKLISTS 16 -/* a worklist */ +/* A worklist */ struct worklist { int length; struct universal entries[MAX_LEN_WORKLIST]; diff --git a/common/world_object.h b/common/world_object.h index add8a641f4..2bd51c3bcf 100644 --- a/common/world_object.h +++ b/common/world_object.h @@ -40,8 +40,10 @@ struct world struct unit_hash *units; }; +extern struct world wld; /* In game.c */ + #ifdef __cplusplus } #endif /* __cplusplus */ -#endif /* FC__WORLD_OBJECT_H */ +#endif /* FC__WORLD_OBJECT_H */ diff --git a/server/actiontools.c b/server/actiontools.c index 1d9c11c8da..8319cc019f 100644 --- a/server/actiontools.c +++ b/server/actiontools.c @@ -23,6 +23,7 @@ /* server */ #include "aiiface.h" +#include "nation.h" #include "notify.h" #include "plrhand.h" #include "unithand.h" diff --git a/server/advisors/autosettlers.c b/server/advisors/autosettlers.c index 244b956373..9878663394 100644 --- a/server/advisors/autosettlers.c +++ b/server/advisors/autosettlers.c @@ -32,6 +32,7 @@ #include "government.h" #include "map.h" #include "movement.h" +#include "nation.h" #include "packets.h" #include "unitlist.h" diff --git a/server/animals.c b/server/animals.c index 5560a26215..6723351cbc 100644 --- a/server/animals.c +++ b/server/animals.c @@ -29,6 +29,7 @@ /* server */ #include "aiiface.h" #include "barbarian.h" +#include "nation.h" #include "plrhand.h" #include "srv_main.h" #include "stdinhand.h" diff --git a/server/gamehand.c b/server/gamehand.c index f1803cc529..19cd77bde3 100644 --- a/server/gamehand.c +++ b/server/gamehand.c @@ -36,6 +36,7 @@ #include "improvement.h" #include "modpack.h" #include "movement.h" +#include "nation.h" #include "packets.h" /* server */ diff --git a/server/generator/mapgen.c b/server/generator/mapgen.c index 545653f099..abab956768 100644 --- a/server/generator/mapgen.c +++ b/server/generator/mapgen.c @@ -26,6 +26,7 @@ #include "log.h" #include "maphand.h" /* assign_continent_numbers(), MAP_NCONT */ #include "mem.h" +#include "nation.h" #include "rand.h" #include "shared.h" diff --git a/server/meta.c b/server/meta.c index 49248177d0..59855d6ae8 100644 --- a/server/meta.c +++ b/server/meta.c @@ -55,6 +55,7 @@ #include "dataio.h" #include "game.h" #include "map.h" +#include "nation.h" #include "version.h" /* server */ diff --git a/server/plrhand.h b/server/plrhand.h index d4f73f8409..a635839994 100644 --- a/server/plrhand.h +++ b/server/plrhand.h @@ -15,6 +15,7 @@ struct connection; struct conn_list; +struct nation_list; struct nation_type; struct player; struct rgbcolor; diff --git a/server/report.c b/server/report.c index 53db8aeae6..5c93fa7080 100644 --- a/server/report.c +++ b/server/report.c @@ -34,6 +34,7 @@ #include "events.h" #include "game.h" #include "government.h" +#include "nation.h" #include "packets.h" #include "player.h" #include "research.h" diff --git a/server/rssanity.c b/server/rssanity.c index 81f3570af3..fad7fe0039 100644 --- a/server/rssanity.c +++ b/server/rssanity.c @@ -16,6 +16,7 @@ #endif /* utility */ +#include "astring.h" #include "deprecations.h" /* common */ @@ -26,8 +27,8 @@ #include "government.h" #include "map.h" #include "movement.h" +#include "nation.h" #include "player.h" -#include "road.h" #include "specialist.h" #include "tech.h" diff --git a/server/sanitycheck.c b/server/sanitycheck.c index e7e6ce2d18..11c88a8b24 100644 --- a/server/sanitycheck.c +++ b/server/sanitycheck.c @@ -25,6 +25,7 @@ #include "government.h" #include "map.h" #include "movement.h" +#include "nation.h" #include "player.h" #include "research.h" #include "specialist.h" diff --git a/server/settings.c b/server/settings.c index ad0c523bf0..3e2dbb8024 100644 --- a/server/settings.c +++ b/server/settings.c @@ -33,6 +33,7 @@ #include "gamehand.h" #include "maphand.h" #include "meta.h" +#include "nation.h" #include "notify.h" #include "plrhand.h" #include "report.h" diff --git a/server/spacerace.c b/server/spacerace.c index 4e97a85854..aa4b7a8dcf 100644 --- a/server/spacerace.c +++ b/server/spacerace.c @@ -26,6 +26,7 @@ #include "calendar.h" #include "events.h" #include "game.h" +#include "nation.h" #include "packets.h" #include "spaceship.h" diff --git a/server/srv_log.c b/server/srv_log.c index 2f81d64236..8736e93acd 100644 --- a/server/srv_log.c +++ b/server/srv_log.c @@ -29,6 +29,7 @@ #include "city.h" #include "game.h" #include "map.h" +#include "nation.h" #include "unit.h" /* server */ diff --git a/tools/ruledit/effect_edit.cpp b/tools/ruledit/effect_edit.cpp index 57e3cce30e..56e879af4e 100644 --- a/tools/ruledit/effect_edit.cpp +++ b/tools/ruledit/effect_edit.cpp @@ -28,6 +28,7 @@ // common #include "effects.h" +#include "multipliers.h" // ruledit #include "ruledit.h" diff --git a/tools/ruledit/univ_value.c b/tools/ruledit/univ_value.c index 50e11bb7ec..4ddcbe52ba 100644 --- a/tools/ruledit/univ_value.c +++ b/tools/ruledit/univ_value.c @@ -20,6 +20,7 @@ #include "counters.h" #include "game.h" #include "government.h" +#include "nation.h" #include "requirements.h" #include "server_settings.h" #include "specialist.h" diff --git a/tools/ruleutil/rulesave.c b/tools/ruleutil/rulesave.c index de5e727561..16c9960724 100644 --- a/tools/ruleutil/rulesave.c +++ b/tools/ruleutil/rulesave.c @@ -16,6 +16,7 @@ #endif /* utility */ +#include "astring.h" #include "registry.h" #include "string_vector.h" @@ -27,6 +28,8 @@ #include "map.h" #include "movement.h" #include "multipliers.h" +#include "nation.h" +#include "rgbcolor.h" #include "sex.h" #include "specialist.h" #include "style.h" @@ -44,7 +47,7 @@ /* Ruleset format version */ /* - * 1 - Freeciv-2.6 + * 1 - Freeciv-2.6 * 10 - Freeciv-3.0 * 20 - Freeciv-3.1 * 30 - Freeciv-3.2 -- 2.35.1