diff --git a/ai/aitraits.cpp b/ai/aitraits.cpp index 3e81e3e642..4ef5cbf462 100644 --- a/ai/aitraits.cpp +++ b/ai/aitraits.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "rand.h" diff --git a/ai/classic/classicai.cpp b/ai/classic/classicai.cpp index e00e3e3a10..146822e0c8 100644 --- a/ai/classic/classicai.cpp +++ b/ai/classic/classicai.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "ai.h" #include "player.h" diff --git a/ai/default/aiair.cpp b/ai/default/aiair.cpp index bce8ad63fb..364182a9d4 100644 --- a/ai/default/aiair.cpp +++ b/ai/default/aiair.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "log.h" @@ -26,7 +22,6 @@ #include "unit.h" // server -#include "citytools.h" #include "maphand.h" #include "srv_log.h" #include "unithand.h" @@ -44,8 +39,6 @@ #include "aiplayer.h" #include "aitools.h" #include "aiunit.h" -#include "daicity.h" - #include "aiair.h" class PFPath; diff --git a/ai/default/aidata.cpp b/ai/default/aidata.cpp index 23a9b7fe2e..906f484255 100644 --- a/ai/default/aidata.cpp +++ b/ai/default/aidata.cpp @@ -8,14 +8,9 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "game.h" #include "government.h" -#include "map.h" #include "multipliers.h" #include "research.h" diff --git a/ai/default/aidiplomat.cpp b/ai/default/aidiplomat.cpp index ae5827204e..e698f56e4f 100644 --- a/ai/default/aidiplomat.cpp +++ b/ai/default/aidiplomat.cpp @@ -8,10 +8,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "bitvector.h" #include "log.h" @@ -38,20 +34,17 @@ #include "pf_tools.h" // server -#include "barbarian.h" #include "citytools.h" #include "cityturn.h" #include "diplomats.h" #include "maphand.h" #include "srv_log.h" #include "unithand.h" -#include "unittools.h" /* server/advisors */ #include "advbuilding.h" #include "advdata.h" #include "advgoto.h" -#include "autosettlers.h" // ai #include "handicaps.h" @@ -66,8 +59,6 @@ #include "aiunit.h" #include "daiactions.h" #include "daicity.h" -#include "daimilitary.h" - #include "aidiplomat.h" #define LOG_DIPLOMAT LOG_DEBUG diff --git a/ai/default/aiferry.cpp b/ai/default/aiferry.cpp index 32c166601a..ac7bae4c5e 100644 --- a/ai/default/aiferry.cpp +++ b/ai/default/aiferry.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "log.h" @@ -29,7 +25,6 @@ /* server/advisors */ #include "advgoto.h" #include "autoexplorer.h" -#include "autosettlers.h" // server #include "hand_gen.h" diff --git a/ai/default/aiguard.cpp b/ai/default/aiguard.cpp index a64876e39a..3b0b5663f9 100644 --- a/ai/default/aiguard.cpp +++ b/ai/default/aiguard.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "log.h" @@ -26,7 +22,6 @@ // ai #include "ailog.h" #include "aiplayer.h" -#include "aitools.h" #include "aiunit.h" #include "aiguard.h" diff --git a/ai/default/aihand.cpp b/ai/default/aihand.cpp index 1f7befcbb7..499c0632e1 100644 --- a/ai/default/aihand.cpp +++ b/ai/default/aihand.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "distribute.h" #include "log.h" @@ -25,7 +21,6 @@ #include "city.h" #include "game.h" #include "government.h" -#include "map.h" #include "nation.h" #include "packets.h" #include "player.h" @@ -37,18 +32,15 @@ #include "cm.h" // server -#include "citytools.h" #include "cityturn.h" #include "plrhand.h" #include "sernet.h" #include "spacerace.h" #include "srv_log.h" -#include "unithand.h" /* server/advisors */ #include "advdata.h" #include "advspace.h" -#include "advtools.h" // ai #include "handicaps.h" diff --git a/ai/default/aihunt.cpp b/ai/default/aihunt.cpp index 9fa8283006..550960b90d 100644 --- a/ai/default/aihunt.cpp +++ b/ai/default/aihunt.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "bitvector.h" #include "log.h" @@ -32,7 +28,6 @@ #include "pf_tools.h" // server -#include "citytools.h" #include "srv_log.h" #include "unithand.h" #include "unittools.h" @@ -41,7 +36,6 @@ #include "advdata.h" #include "advgoto.h" #include "advtools.h" -#include "autosettlers.h" // ai #include "handicaps.h" diff --git a/ai/default/ailog.cpp b/ai/default/ailog.cpp index 649495b536..63325d33f9 100644 --- a/ai/default/ailog.cpp +++ b/ai/default/ailog.cpp @@ -8,12 +8,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - // common #include "map.h" #include "nation.h" diff --git a/ai/default/aiparatrooper.cpp b/ai/default/aiparatrooper.cpp index 69da4ccce2..46ff608f9f 100644 --- a/ai/default/aiparatrooper.cpp +++ b/ai/default/aiparatrooper.cpp @@ -9,10 +9,6 @@ received a copy of the GNU General Public License along with Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "log.h" @@ -24,11 +20,7 @@ received a copy of the GNU General Public License along with Freeciv21. #include "unit.h" #include "unitlist.h" -/* common/aicore */ -#include "pf_tools.h" - // server -#include "citytools.h" #include "maphand.h" #include "srv_log.h" #include "unithand.h" diff --git a/ai/default/aiplayer.cpp b/ai/default/aiplayer.cpp index 7e3cbc0751..79c28958a6 100644 --- a/ai/default/aiplayer.cpp +++ b/ai/default/aiplayer.cpp @@ -11,16 +11,11 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "ai.h" #include "city.h" #include "game.h" #include "multipliers.h" -#include "unit.h" // server #include "citytools.h" diff --git a/ai/default/aisettler.cpp b/ai/default/aisettler.cpp index 5a892fa3cd..267e21fb72 100644 --- a/ai/default/aisettler.cpp +++ b/ai/default/aisettler.cpp @@ -9,16 +9,9 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include -#include -#include // utility -#include "log.h" #include "support.h" #include "timing.h" @@ -27,7 +20,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. #include "game.h" #include "government.h" #include "map.h" -#include "movement.h" #include "packets.h" #include "player.h" #include "workertask.h" diff --git a/ai/default/aitech.cpp b/ai/default/aitech.cpp index b490c23e48..e8c1b895ef 100644 --- a/ai/default/aitech.cpp +++ b/ai/default/aitech.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility diff --git a/ai/default/aitools.cpp b/ai/default/aitools.cpp index 4bf3f09845..ea273e3ed3 100644 --- a/ai/default/aitools.cpp +++ b/ai/default/aitools.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "bitvector.h" #include "log.h" @@ -38,12 +34,8 @@ #include "pf_tools.h" // server -#include "barbarian.h" -#include "citytools.h" #include "cityturn.h" #include "maphand.h" -#include "plrhand.h" -#include "score.h" #include "srv_log.h" #include "unithand.h" #include "unittools.h" @@ -52,7 +44,6 @@ #include "advdata.h" #include "advgoto.h" #include "advtools.h" -#include "autosettlers.h" #include "infracache.h" // adv_city // ai @@ -69,6 +60,7 @@ #include "daimilitary.h" #include "aitools.h" +#include "score.h" class PFPath; /** diff --git a/ai/default/aiunit.cpp b/ai/default/aiunit.cpp index 1f5f559940..0b2648a216 100644 --- a/ai/default/aiunit.cpp +++ b/ai/default/aiunit.cpp @@ -11,15 +11,9 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include // utility #include "bitvector.h" -#include "log.h" #include "rand.h" #include "registry.h" #include "shared.h" @@ -46,12 +40,8 @@ // server #include "barbarian.h" #include "citytools.h" -#include "cityturn.h" -#include "diplomats.h" -#include "maphand.h" #include "srv_log.h" #include "unithand.h" -#include "unittools.h" /* server/advisors */ #include "advbuilding.h" @@ -70,7 +60,6 @@ #include "aidiplomat.h" #include "aiferry.h" #include "aiguard.h" -#include "aihand.h" #include "aihunt.h" #include "ailog.h" #include "aiparatrooper.h" @@ -81,6 +70,7 @@ #include "daimilitary.h" #include "aiunit.h" +#include "maphand.h" #define LOGLEVEL_RECOVERY LOG_DEBUG #define LOG_CARAVAN LOG_DEBUG diff --git a/ai/default/daiactions.cpp b/ai/default/daiactions.cpp index 57679f9be7..472d31defb 100644 --- a/ai/default/daiactions.cpp +++ b/ai/default/daiactions.cpp @@ -10,10 +10,6 @@ https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "city.h" #include "movement.h" diff --git a/ai/default/daicity.cpp b/ai/default/daicity.cpp index 0f56a9dd7e..d9605f4cb3 100644 --- a/ai/default/daicity.cpp +++ b/ai/default/daicity.cpp @@ -12,10 +12,8 @@ \____/ ********************************************************/ #ifdef HAVE_CONFIG_H -#include #endif -#include // pow #include // utility @@ -37,8 +35,6 @@ #include "plrhand.h" #include "srv_log.h" #include "unithand.h" -#include "unittools.h" - /* server/advisors */ #include "advbuilding.h" #include "advdata.h" @@ -54,7 +50,6 @@ /* ai/default */ #include "aidata.h" #include "aihand.h" -#include "ailog.h" #include "aiplayer.h" #include "aisettler.h" #include "aitools.h" diff --git a/ai/default/daidiplomacy.cpp b/ai/default/daidiplomacy.cpp index d58dac29a8..b129b71674 100644 --- a/ai/default/daidiplomacy.cpp +++ b/ai/default/daidiplomacy.cpp @@ -10,7 +10,6 @@ received a copy of the GNU General Public License along with Freeciv21. ***********************************************************************/ #ifdef HAVE_CONFIG_H -#include #endif #include @@ -38,11 +37,9 @@ received a copy of the GNU General Public License along with Freeciv21. #include "unitlist.h" // server -#include "citytools.h" #include "diplhand.h" #include "maphand.h" #include "notify.h" -#include "srv_log.h" /* server/advisors */ #include "advdata.h" diff --git a/ai/default/daidomestic.cpp b/ai/default/daidomestic.cpp index 164bb8d3bb..2d5f748daa 100644 --- a/ai/default/daidomestic.cpp +++ b/ai/default/daidomestic.cpp @@ -11,13 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include // pow, ceil -#include - // utility #include "log.h" @@ -25,7 +18,6 @@ #include "city.h" #include "game.h" #include "government.h" -#include "map.h" #include "movement.h" #include "traderoutes.h" #include "unit.h" @@ -44,7 +36,6 @@ #include "advbuilding.h" #include "advchoice.h" #include "advdata.h" -#include "autosettlers.h" #include "infracache.h" // adv_city // ai @@ -57,10 +48,7 @@ #include "aiplayer.h" #include "aitech.h" #include "aitools.h" -#include "aiunit.h" #include "daicity.h" -#include "daimilitary.h" - #include "daidomestic.h" /** diff --git a/ai/default/daieffects.cpp b/ai/default/daieffects.cpp index 8cf2eff6e8..a303a76a59 100644 --- a/ai/default/daieffects.cpp +++ b/ai/default/daieffects.cpp @@ -8,10 +8,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "city.h" #include "effects.h" diff --git a/ai/default/daimilitary.cpp b/ai/default/daimilitary.cpp index 1b0c25a1a1..8fc0c8e556 100644 --- a/ai/default/daimilitary.cpp +++ b/ai/default/daimilitary.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility @@ -34,9 +30,6 @@ #include "pf_tools.h" // server -#include "citytools.h" -#include "cityturn.h" -#include "srv_log.h" #include "srv_main.h" /* server/advisors */ @@ -44,7 +37,6 @@ #include "advchoice.h" #include "advdata.h" #include "advtools.h" -#include "autosettlers.h" #include "infracache.h" // adv_city // ai @@ -69,6 +61,7 @@ #include "daieffects.h" #include "daimilitary.h" +#include "srv_log.h" static int assess_danger(struct ai_type *ait, struct city *pcity, const struct civ_map *dmap, diff --git a/ai/difficulty.cpp b/ai/difficulty.cpp index 8131aa2dec..1409ef5a79 100644 --- a/ai/difficulty.cpp +++ b/ai/difficulty.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility #include "astring.h" diff --git a/ai/handicaps.cpp b/ai/handicaps.cpp index 67937a34e0..589ac85613 100644 --- a/ai/handicaps.cpp +++ b/ai/handicaps.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility #include "shared.h" diff --git a/client/attribute.cpp b/client/attribute.cpp index 74a735fb56..29d5f686d2 100644 --- a/client/attribute.cpp +++ b/client/attribute.cpp @@ -10,10 +10,6 @@ with Freeciv21. If not, see https://www.gnu.org/licenses/. ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility diff --git a/client/audio.cpp b/client/audio.cpp index e72b0746d3..fd1282a20b 100644 --- a/client/audio.cpp +++ b/client/audio.cpp @@ -15,10 +15,7 @@ received a copy of the GNU General Public License along with Freeciv21. #include #include -#include #include -#include - // utility #include "capability.h" #include "fcintl.h" @@ -26,7 +23,6 @@ received a copy of the GNU General Public License along with Freeciv21. #include "rand.h" #include "registry.h" #include "shared.h" -#include "support.h" // client #include "audio_none.h" diff --git a/client/audio_none.cpp b/client/audio_none.cpp index 05a3f4b765..4a235240bc 100644 --- a/client/audio_none.cpp +++ b/client/audio_none.cpp @@ -9,16 +9,10 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include #include "support.h" #include "audio.h" -#include "gui_main_g.h" #include "audio_none.h" diff --git a/client/canvas.cpp b/client/canvas.cpp index f197f35fce..c1d3478540 100644 --- a/client/canvas.cpp +++ b/client/canvas.cpp @@ -19,21 +19,16 @@ \_____ _____/ \ / *****/ #include "canvas.h" -#include // Qt #include #include #include -#include "client_main.h" -#include "mapview_common.h" -#include "tilespec.h" // qt-client #include "colors.h" #include "colors_common.h" #include "fc_client.h" #include "fonts.h" -#include "qtg_cxxside.h" #include "sprite.h" /** diff --git a/client/chatline.cpp b/client/chatline.cpp index c1bac8b4cc..cc405d16cd 100644 --- a/client/chatline.cpp +++ b/client/chatline.cpp @@ -32,11 +32,9 @@ #include "game.h" #include "mapview_common.h" // gui-qt -#include "colors.h" #include "dialogs.h" #include "fc_client.h" #include "fonts.h" -#include "gui_main.h" #include "icons.h" #include "mapview.h" #include "messagewin.h" diff --git a/client/chatline_common.cpp b/client/chatline_common.cpp index 3133e20b4c..7338e98d0a 100644 --- a/client/chatline_common.cpp +++ b/client/chatline_common.cpp @@ -11,18 +11,12 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include -#include // utility #include "fcintl.h" #include "fcthread.h" -#include "log.h" // common #include "featured_text.h" @@ -33,8 +27,6 @@ // client #include "client_main.h" -#include "options.h" - #include "chatline_common.h" Q_GLOBAL_STATIC(QMutex, ow_mutex); diff --git a/client/citybar.cpp b/client/citybar.cpp index e8639942af..d8c2a54ae3 100644 --- a/client/citybar.cpp +++ b/client/citybar.cpp @@ -19,7 +19,6 @@ // utility #include "bugs.h" #include "fcintl.h" -#include "log.h" // common #include "city.h" diff --git a/client/citydlg.cpp b/client/citydlg.cpp index bf9baf22ba..dac51d2014 100644 --- a/client/citydlg.cpp +++ b/client/citydlg.cpp @@ -40,14 +40,10 @@ #include "governor.h" #include "mapctrl_common.h" #include "mapview_common.h" -#include "mapview_g.h" -#include "sprite.h" -#include "text.h" #include "tilespec.h" // gui-qt #include "canvas.h" #include "cityrep.h" // hIcon -#include "colors.h" #include "fc_client.h" #include "fonts.h" #include "hudwidget.h" @@ -55,6 +51,7 @@ #include "mapview.h" #include "page_game.h" #include "qtg_cxxside.h" +#include "text.h" #include "tooltips.h" #include "top_bar.h" diff --git a/client/citydlg_common.cpp b/client/citydlg_common.cpp index a2b2a239dd..dd4c98a8a5 100644 --- a/client/citydlg_common.cpp +++ b/client/citydlg_common.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility @@ -27,17 +23,13 @@ #include "culture.h" #include "game.h" #include "specialist.h" -#include "unitlist.h" /* client/include */ #include "citydlg_g.h" -#include "mapview_g.h" - // client #include "citydlg_common.h" #include "client_main.h" // for can_client_issue_orders() #include "climap.h" -#include "control.h" #include "mapview_common.h" #include "options.h" // for concise_city_production #include "tilespec.h" // for tileset_is_isometric(tileset) diff --git a/client/cityrepdata.cpp b/client/cityrepdata.cpp index 5e70c3915c..a5876025aa 100644 --- a/client/cityrepdata.cpp +++ b/client/cityrepdata.cpp @@ -11,13 +11,8 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include -#include #include #include @@ -31,7 +26,6 @@ #include "city.h" #include "culture.h" #include "game.h" -#include "map.h" #include "specialist.h" #include "unitlist.h" diff --git a/client/client_main.cpp b/client/client_main.cpp index 2678ed2946..ba5f6af74d 100644 --- a/client/client_main.cpp +++ b/client/client_main.cpp @@ -32,7 +32,6 @@ #include // utility -#include "bitvector.h" #include "capstr.h" #include "dataio.h" #include "deprecations.h" @@ -41,8 +40,6 @@ #include "fcintl.h" #include "log.h" #include "rand.h" -#include "registry.h" -#include "support.h" // common #include "ai.h" @@ -50,9 +47,6 @@ #include "fc_interface.h" #include "game.h" #include "helpdata.h" // boot_help_texts() -#include "idex.h" -#include "map.h" -#include "mapimg.h" #include "net_types.h" #include "packets.h" #include "player.h" @@ -61,7 +55,6 @@ #include "version.h" /* client/include */ -#include "citydlg_g.h" #include "dialogs_g.h" #include "diplodlg_g.h" #include "gui_main_g.h" @@ -69,7 +62,6 @@ #include "mapview_g.h" #include "menu_g.h" #include "pages_g.h" -#include "repodlgs_g.h" #include "voteinfo_bar_g.h" // client diff --git a/client/climap.cpp b/client/climap.cpp index c3a463afcc..70c42c45ed 100644 --- a/client/climap.cpp +++ b/client/climap.cpp @@ -8,10 +8,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "map.h" #include "shared.h" diff --git a/client/climisc.cpp b/client/climisc.cpp index 06bd57acaa..21d9b86950 100644 --- a/client/climisc.cpp +++ b/client/climisc.cpp @@ -16,18 +16,12 @@ used throughout the client. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include -#include #include #include // utility -#include "bitvector.h" #include "fcintl.h" #include "log.h" #include "support.h" @@ -49,7 +43,6 @@ #include "citydlg_g.h" #include "cityrep_g.h" #include "dialogs_g.h" -#include "gui_main_g.h" #include "mapview_g.h" // client @@ -59,12 +52,10 @@ #include "climap.h" #include "climisc.h" #include "control.h" -#include "mapctrl_common.h" #include "mapview_common.h" #include "messagewin_common.h" #include "options.h" #include "packhand.h" -#include "repodlgs_common.h" #include "tilespec.h" // gui-qt diff --git a/client/clinet.cpp b/client/clinet.cpp index 6a1605f6b7..236bfd2108 100644 --- a/client/clinet.cpp +++ b/client/clinet.cpp @@ -22,33 +22,22 @@ // utility #include "capstr.h" -#include "dataio.h" #include "fcintl.h" #include "log.h" -#include "registry.h" -#include "support.h" // common -#include "game.h" #include "packets.h" -#include "version.h" // client #include "attribute.h" #include "chatline_common.h" #include "client_main.h" -#include "climisc.h" #include "clinet.h" #include "connectdlg_common.h" #include "dialogs_g.h" // popdown_races_dialog() #include "governor.h" -#include "mapview_common.h" // unqueue_mapview_update -#include "menu_g.h" #include "options.h" #include "packhand.h" -#include "pages_g.h" -#include "plrdlg_common.h" -#include "repodlgs_g.h" // gui-qt #include "qtg_cxxside.h" diff --git a/client/colors.cpp b/client/colors.cpp index 461a71bafc..802ab2a989 100644 --- a/client/colors.cpp +++ b/client/colors.cpp @@ -9,12 +9,9 @@ **************************************************************************/ #include -// utility -#include "rgbcolor.h" // gui-qt #include "colors.h" #include "colors_g.h" -#include "qtg_cxxside.h" research_color *research_color::m_instance = 0; diff --git a/client/colors_common.cpp b/client/colors_common.cpp index f35e5d81eb..baf2552033 100644 --- a/client/colors_common.cpp +++ b/client/colors_common.cpp @@ -10,12 +10,7 @@ https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility -#include "fcintl.h" #include "log.h" #include "shared.h" diff --git a/client/connectdlg.cpp b/client/connectdlg.cpp index 9707c98fcd..a1f1db5ad4 100644 --- a/client/connectdlg.cpp +++ b/client/connectdlg.cpp @@ -14,7 +14,6 @@ #include "chatline_common.h" #include "packhand_gen.h" // gui-qt -#include "connectdlg.h" #include "fc_client.h" #include "page_network.h" #include "pages_g.h" diff --git a/client/connectdlg_common.cpp b/client/connectdlg_common.cpp index 21ccae745e..56e2e8bbad 100644 --- a/client/connectdlg_common.cpp +++ b/client/connectdlg_common.cpp @@ -20,23 +20,15 @@ #include #include -#include #include -#include -#include #ifdef FREECIV_MSWINDOWS #include #endif // utility -#include "capability.h" -#include "deprecations.h" -#include "fciconv.h" #include "fcintl.h" #include "log.h" -#include "net_types.h" -#include "rand.h" #include "registry.h" #include "shared.h" #include "support.h" @@ -52,6 +44,7 @@ // gui-qt #include "qtg_cxxside.h" +#include "rand.h" #define WAIT_BETWEEN_TRIES 100000 // usecs #define NUMBER_OF_TRIES 500 diff --git a/client/control.cpp b/client/control.cpp index ead01d1163..7802862188 100644 --- a/client/control.cpp +++ b/client/control.cpp @@ -11,33 +11,25 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include // utility #include "bitvector.h" #include "fcintl.h" #include "log.h" -#include "timing.h" // common #include "combat.h" #include "game.h" #include "map.h" #include "movement.h" -#include "path.h" #include "path_finder.h" #include "unitlist.h" /* common/aicore */ -#include "path_finding.h" /* client/include */ #include "citydlg_g.h" #include "dialogs_g.h" -#include "gui_main_g.h" #include "mapctrl_g.h" #include "mapview_g.h" #include "menu_g.h" diff --git a/client/diplodlg.cpp b/client/diplodlg.cpp index 7030d9b46c..fe01a8b70b 100644 --- a/client/diplodlg.cpp +++ b/client/diplodlg.cpp @@ -32,7 +32,6 @@ #include "client_main.h" #include "colors_common.h" // gui-qt -#include "colors.h" #include "diplodlg_g.h" #include "fc_client.h" #include "icons.h" diff --git a/client/editor.cpp b/client/editor.cpp index ee942b3244..bcf49dfc9c 100644 --- a/client/editor.cpp +++ b/client/editor.cpp @@ -11,12 +11,9 @@ **************************************************************************/ #ifdef HAVE_CONFIG_H -#include #endif #include -#include -#include // utility #include "bitvector.h" @@ -27,7 +24,6 @@ // common #include "game.h" #include "map.h" -#include "movement.h" #include "packets.h" // client @@ -153,7 +149,7 @@ static void tool_init(enum editor_tool_type ett, const char *name, int flags, { struct editor_tool *tool; - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES) { return; } @@ -272,7 +268,7 @@ void editor_set_tool(enum editor_tool_type ett) return; } - if (!(ett < NUM_EDITOR_TOOL_TYPES)) { + if (ett >= NUM_EDITOR_TOOL_TYPES) { return; } @@ -297,8 +293,8 @@ enum editor_tool_type editor_get_tool() void editor_tool_set_mode(enum editor_tool_type ett, enum editor_tool_mode etm) { - if (editor == nullptr || !(ett < NUM_EDITOR_TOOL_TYPES) - || !(etm < NUM_EDITOR_TOOL_MODES) || !editor_tool_has_mode(ett, etm)) { + if (editor == nullptr || ett >= NUM_EDITOR_TOOL_TYPES + || etm >= NUM_EDITOR_TOOL_MODES || !editor_tool_has_mode(ett, etm)) { return; } @@ -311,8 +307,8 @@ void editor_tool_set_mode(enum editor_tool_type ett, bool editor_tool_has_mode(enum editor_tool_type ett, enum editor_tool_mode etm) { - if (editor == nullptr || !(ett < NUM_EDITOR_TOOL_TYPES) - || !(etm < NUM_EDITOR_TOOL_MODES)) { + if (editor == nullptr || ett >= NUM_EDITOR_TOOL_TYPES + || etm >= NUM_EDITOR_TOOL_MODES) { return false; } @@ -332,7 +328,7 @@ bool editor_tool_has_mode(enum editor_tool_type ett, */ enum editor_tool_mode editor_tool_get_mode(enum editor_tool_type ett) { - if (editor == nullptr || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (editor == nullptr || ett >= NUM_EDITOR_TOOL_TYPES) { return NUM_EDITOR_TOOL_MODES; } return editor->tools[ett].mode; @@ -353,7 +349,7 @@ bool editor_is_active() { return can_conn_edit(&client.conn); } */ bool editor_tool_is_usable(enum editor_tool_type ett) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES) { return false; } @@ -379,7 +375,7 @@ bool editor_tool_is_usable(enum editor_tool_type ett) */ bool editor_tool_has_value(enum editor_tool_type ett) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES) { return false; } return editor->tools[ett].flags & ETF_HAS_VALUE; @@ -391,7 +387,7 @@ bool editor_tool_has_value(enum editor_tool_type ett) */ void editor_tool_set_value(enum editor_tool_type ett, int value) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES) + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES || !editor_tool_has_value(ett)) { return; } @@ -403,7 +399,7 @@ void editor_tool_set_value(enum editor_tool_type ett, int value) */ int editor_tool_get_value(enum editor_tool_type ett) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES) + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES || !editor_tool_has_value(ett)) { return 0; } @@ -1160,7 +1156,7 @@ void editor_apply_tool_to_selection() */ const char *editor_tool_get_name(enum editor_tool_type ett) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES) { return ""; } @@ -1208,7 +1204,7 @@ const char *editor_tool_get_value_name(enum editor_tool_type emt, int value) */ bool editor_tool_has_size(enum editor_tool_type ett) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES) { return false; } return editor->tools[ett].flags & ETF_HAS_SIZE; @@ -1219,7 +1215,7 @@ bool editor_tool_has_size(enum editor_tool_type ett) */ int editor_tool_get_size(enum editor_tool_type ett) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES) { return 1; } return editor->tools[ett].size; @@ -1230,7 +1226,7 @@ int editor_tool_get_size(enum editor_tool_type ett) */ void editor_tool_set_size(enum editor_tool_type ett, int size) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES) { return; } editor->tools[ett].size = MAX(1, size); @@ -1242,7 +1238,7 @@ void editor_tool_set_size(enum editor_tool_type ett, int size) */ bool editor_tool_has_count(enum editor_tool_type ett) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES) { return false; } return editor->tools[ett].flags & ETF_HAS_COUNT; @@ -1253,7 +1249,7 @@ bool editor_tool_has_count(enum editor_tool_type ett) */ int editor_tool_get_count(enum editor_tool_type ett) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES) { return 1; } return editor->tools[ett].count; @@ -1264,7 +1260,7 @@ int editor_tool_get_count(enum editor_tool_type ett) */ void editor_tool_set_count(enum editor_tool_type ett, int count) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES) { return; } editor->tools[ett].count = MAX(1, count); @@ -1278,7 +1274,7 @@ QPixmap *editor_tool_get_sprite(enum editor_tool_type ett) { const struct editor_sprites *sprites; - if (!tileset || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (!tileset || ett >= NUM_EDITOR_TOOL_TYPES) { return nullptr; } @@ -1328,7 +1324,7 @@ QPixmap *editor_tool_get_sprite(enum editor_tool_type ett) */ const char *editor_tool_get_tooltip(enum editor_tool_type ett) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES) + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES || !editor->tools[ett].tooltip) { return ""; } @@ -1342,7 +1338,7 @@ const char *editor_tool_get_tooltip(enum editor_tool_type ett) */ int editor_tool_get_applied_player(enum editor_tool_type ett) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES) { return -1; } return editor->tools[ett].applied_player_no; @@ -1353,7 +1349,7 @@ int editor_tool_get_applied_player(enum editor_tool_type ett) */ void editor_tool_set_applied_player(enum editor_tool_type ett, int player_no) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES) { return; } editor->tools[ett].applied_player_no = player_no; @@ -1365,7 +1361,7 @@ void editor_tool_set_applied_player(enum editor_tool_type ett, int player_no) */ bool editor_tool_has_applied_player(enum editor_tool_type ett) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES) { return false; } return editor->tools[ett].flags & ETF_HAS_APPLIED_PLAYER; @@ -1377,7 +1373,7 @@ bool editor_tool_has_applied_player(enum editor_tool_type ett) */ bool editor_tool_has_value_erase(enum editor_tool_type ett) { - if (!editor || !(ett < NUM_EDITOR_TOOL_TYPES)) { + if (!editor || ett >= NUM_EDITOR_TOOL_TYPES) { return false; } return editor->tools[ett].flags & ETF_HAS_VALUE_ERASE; diff --git a/client/endgamereport.cpp b/client/endgamereport.cpp index 936897c85e..02de7e4124 100644 --- a/client/endgamereport.cpp +++ b/client/endgamereport.cpp @@ -16,7 +16,6 @@ // common #include "nation.h" // client -#include "repodlgs_common.h" #include "sprite.h" // gui-qt #include "fc_client.h" diff --git a/client/fc_client.cpp b/client/fc_client.cpp index 59195dffc3..d433cff1f8 100644 --- a/client/fc_client.cpp +++ b/client/fc_client.cpp @@ -11,11 +11,7 @@ #include "fc_client.h" // Qt #include -#include -#include -#include #include -#include #include #include #include @@ -26,7 +22,6 @@ #include "fcintl.h" // common #include "climisc.h" -#include "game.h" // client #include "chatline.h" #include "chatline_common.h" @@ -49,7 +44,6 @@ #include "page_pregame.h" #include "page_scenario.h" #include "sprite.h" -#include "tileset_debugger.h" #include "top_bar.h" #include "voteinfo_bar.h" diff --git a/client/global_worklist.cpp b/client/global_worklist.cpp index 57b986ea66..24e0cad589 100644 --- a/client/global_worklist.cpp +++ b/client/global_worklist.cpp @@ -10,10 +10,6 @@ /o) (o/\ \_ General Public License along with Freeciv21. \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility diff --git a/client/goto.cpp b/client/goto.cpp index 61f1417247..86e0311810 100644 --- a/client/goto.cpp +++ b/client/goto.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // Qt @@ -23,10 +19,7 @@ // common #include "game.h" #include "map.h" -#include "movement.h" #include "packets.h" -#include "path.h" -#include "path_finder.h" #include "pf_tools.h" #include "road.h" #include "unit.h" @@ -40,6 +33,7 @@ // client #include "goto.h" #include "mapctrl_common.h" +#include "path_finder.h" // Logging category for goto Q_LOGGING_CATEGORY(goto_category, "freeciv.goto") diff --git a/client/gui_main.cpp b/client/gui_main.cpp index ce126eb378..5a14a372a5 100644 --- a/client/gui_main.cpp +++ b/client/gui_main.cpp @@ -13,11 +13,9 @@ #endif // AUDIO_SDL #include "gui_main.h" -#include // Qt #include // utility -#include "fciconv.h" #include "log.h" // client #include "client_main.h" diff --git a/client/layer_background.cpp b/client/layer_background.cpp index a6cf7dc2d5..1dcc59727f 100644 --- a/client/layer_background.cpp +++ b/client/layer_background.cpp @@ -16,7 +16,6 @@ #include "client_main.h" #include "colors_common.h" #include "control.h" // unit_is_in_focus -#include "game.h" #include "sprite_g.h" #include "tilespec.h" diff --git a/client/luaconsole_common.cpp b/client/luaconsole_common.cpp index b430d4ff93..6e5708f07e 100644 --- a/client/luaconsole_common.cpp +++ b/client/luaconsole_common.cpp @@ -9,13 +9,7 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include -#include - // utility #include "fcintl.h" diff --git a/client/luascript/api_client_base.cpp b/client/luascript/api_client_base.cpp index 570ee25a6a..8e12dcaa61 100644 --- a/client/luascript/api_client_base.cpp +++ b/client/luascript/api_client_base.cpp @@ -8,10 +8,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "featured_text.h" diff --git a/client/luascript/script_client.cpp b/client/luascript/script_client.cpp index 95cd65553d..db648fc652 100644 --- a/client/luascript/script_client.cpp +++ b/client/luascript/script_client.cpp @@ -8,12 +8,7 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include -#include #include extern "C" { diff --git a/client/mapctrl.cpp b/client/mapctrl.cpp index d7f8ae7ea8..e9a932af8d 100644 --- a/client/mapctrl.cpp +++ b/client/mapctrl.cpp @@ -10,7 +10,6 @@ // Qt #include -#include #include // common #include "control.h" diff --git a/client/mapctrl_common.cpp b/client/mapctrl_common.cpp index f3e373e54e..be35bf18cb 100644 --- a/client/mapctrl_common.cpp +++ b/client/mapctrl_common.cpp @@ -8,10 +8,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // qsort // utility @@ -26,16 +22,12 @@ // client #include "chatline_common.h" -#include "cityrep_g.h" #include "client_main.h" #include "climisc.h" #include "control.h" -#include "editor.h" -#include "fcintl.h" #include "goto.h" #include "governor.h" #include "mapctrl_common.h" -#include "mapctrl_g.h" #include "mapview.h" #include "mapview_g.h" #include "minimap_panel.h" diff --git a/client/mapview.cpp b/client/mapview.cpp index bb66d083da..33595690f6 100644 --- a/client/mapview.cpp +++ b/client/mapview.cpp @@ -17,10 +17,6 @@ // utility #include "log.h" -// common -#include "calendar.h" -#include "game.h" -#include "map.h" // client #include "citybar.h" #include "citydlg_g.h" @@ -32,19 +28,16 @@ #include "mapview_common.h" #include "mapview_g.h" #include "minimap_panel.h" -#include "overview_common.h" #include "sprite.h" #include "text.h" #include "tilespec.h" // gui-qt -#include "canvas.h" #include "colors.h" #include "fc_client.h" #include "fonts.h" #include "hudwidget.h" #include "mapview.h" #include "messagewin.h" -#include "minimap.h" #include "page_game.h" #include "qtg_cxxside.h" #include "sciencedlg.h" diff --git a/client/mapview_common.cpp b/client/mapview_common.cpp index 71d755b6bb..ec942ffe7b 100644 --- a/client/mapview_common.cpp +++ b/client/mapview_common.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include #include @@ -44,21 +40,19 @@ #include "gui_main_g.h" #include "mapctrl_g.h" #include "mapview_g.h" -#include "sprite_g.h" // client #include "citydlg_common.h" -#include "client_main.h" #include "climap.h" #include "control.h" #include "editor.h" -#include "goto.h" #include "mapview_common.h" #include "overview_common.h" #include "tilespec.h" // gui-qt #include "canvas.h" +#include "client_main.h" #include "qtg_cxxside.h" Q_LOGGING_CATEGORY(graphics_category, "freeciv.graphics") @@ -2522,7 +2516,7 @@ void mapdeco_add_gotoline(const struct tile *ptile, enum direction8 dir, const struct tile *ptile_dest; bool changed; - if (!ptile || !(dir <= direction8_max())) { + if (!ptile || dir > direction8_max()) { return; } ptile_dest = mapstep(&(wld.map), ptile, dir); @@ -2562,7 +2556,7 @@ void mapdeco_remove_gotoline(const struct tile *ptile, enum direction8 dir, struct gotoline_counter *pglc; bool changed = false; - if (!ptile || !(dir <= direction8_max())) { + if (!ptile || dir > direction8_max()) { return; } @@ -2643,7 +2637,7 @@ bool mapdeco_is_gotoline_set(const struct tile *ptile, enum direction8 dir, { struct gotoline_counter *pglc; - if (!ptile || !(dir <= direction8_max())) { + if (!ptile || dir > direction8_max()) { return false; } diff --git a/client/menu.cpp b/client/menu.cpp index b1f50bdf8f..a05bdc04dd 100644 --- a/client/menu.cpp +++ b/client/menu.cpp @@ -14,10 +14,8 @@ #include #include #include -#include #include #include -#include #include #include // utility @@ -47,11 +45,8 @@ #include "repodlgs_g.h" #include "tilespec.h" // gui-qt -#include "canvas.h" -#include "chatline.h" #include "dialogs.h" #include "fc_client.h" -#include "fonts.h" #include "gotodlg.h" #include "gui_main.h" #include "hudwidget.h" diff --git a/client/messagewin.cpp b/client/messagewin.cpp index b13ede837e..6ef71cfff0 100644 --- a/client/messagewin.cpp +++ b/client/messagewin.cpp @@ -26,7 +26,6 @@ // gui-qt #include "fc_client.h" -#include "icons.h" #include "mapview.h" #include "page_game.h" #include "sprite.h" diff --git a/client/messagewin_common.cpp b/client/messagewin_common.cpp index 0c610982b1..8183a90fa4 100644 --- a/client/messagewin_common.cpp +++ b/client/messagewin_common.cpp @@ -10,10 +10,6 @@ with Freeciv21. If not, see https://www.gnu.org/licenses/. ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility @@ -21,8 +17,6 @@ // common #include "featured_text.h" -#include "map.h" - /* client/include */ #include "citydlg_g.h" #include "mapview_g.h" diff --git a/client/minimap.cpp b/client/minimap.cpp index 4cb7e60306..65d2fafc43 100644 --- a/client/minimap.cpp +++ b/client/minimap.cpp @@ -15,7 +15,6 @@ #include #include #include -#include // client #include "client_main.h" @@ -25,7 +24,6 @@ // gui-qt #include "fc_client.h" #include "mapview.h" -#include "menu.h" #include "page_game.h" #include "qtg_cxxside.h" diff --git a/client/music.cpp b/client/music.cpp index 15d1253899..7b6deaca71 100644 --- a/client/music.cpp +++ b/client/music.cpp @@ -9,14 +9,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - // utility #include "connection.h" #include "log.h" diff --git a/client/options.cpp b/client/options.cpp index a9610ad236..6eb0f76227 100644 --- a/client/options.cpp +++ b/client/options.cpp @@ -15,11 +15,8 @@ #include #endif -#include #include #include -#include - // Qt #include #include @@ -41,7 +38,6 @@ #include "gui_main_g.h" #include "menu_g.h" #include "optiondlg_g.h" -#include "ratesdlg_g.h" #include "repodlgs_g.h" #include "voteinfo_bar_g.h" @@ -61,8 +57,6 @@ #include "overview_common.h" #include "packhand_gen.h" #include "plrdlg_common.h" -#include "repodlgs_common.h" -#include "servers.h" #include "themes_common.h" #include "tilespec.h" diff --git a/client/overview_common.cpp b/client/overview_common.cpp index 3a79453431..8ebc636eef 100644 --- a/client/overview_common.cpp +++ b/client/overview_common.cpp @@ -9,10 +9,6 @@ received a copy of the GNU General Public License along with Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // floor // utility diff --git a/client/packhand.cpp b/client/packhand.cpp index 150943edce..e5457dda61 100644 --- a/client/packhand.cpp +++ b/client/packhand.cpp @@ -21,7 +21,6 @@ // utility #include "bitvector.h" -#include "capability.h" #include "fcintl.h" #include "log.h" #include "rand.h" diff --git a/client/page_game.cpp b/client/page_game.cpp index 9b461f3a83..949b38ce48 100644 --- a/client/page_game.cpp +++ b/client/page_game.cpp @@ -27,7 +27,6 @@ // client #include "civstatus.h" #include "client_main.h" -#include "climisc.h" #include "mapview_common.h" #include "text.h" // gui-qt - Eye of Storm diff --git a/client/page_network.cpp b/client/page_network.cpp index 533c070668..4552f2447f 100644 --- a/client/page_network.cpp +++ b/client/page_network.cpp @@ -17,7 +17,6 @@ #include "chatline_common.h" #include "client_main.h" #include "clinet.h" -#include "connectdlg_common.h" // gui-qt #include "dialogs.h" #include "fc_client.h" diff --git a/client/page_pregame.cpp b/client/page_pregame.cpp index f37ce4efc6..e3f6c6bc37 100644 --- a/client/page_pregame.cpp +++ b/client/page_pregame.cpp @@ -25,7 +25,6 @@ // client #include "client_main.h" // gui-qt -#include "canvas.h" #include "chatline.h" #include "colors.h" #include "dialogs.h" @@ -33,7 +32,6 @@ #include "icons.h" #include "pregameoptions.h" #include "sprite.h" -#include "voteinfo_bar.h" page_pregame::page_pregame(QWidget *parent, fc_client *gui) : QWidget(parent) { diff --git a/client/plrdlg.cpp b/client/plrdlg.cpp index 2332cc30dd..ee4afc063d 100644 --- a/client/plrdlg.cpp +++ b/client/plrdlg.cpp @@ -17,7 +17,6 @@ #include "fcintl.h" // common #include "colors_common.h" -#include "game.h" #include "government.h" #include "nation.h" #include "research.h" diff --git a/client/pregameoptions.cpp b/client/pregameoptions.cpp index 74047b9447..672235878e 100644 --- a/client/pregameoptions.cpp +++ b/client/pregameoptions.cpp @@ -15,33 +15,21 @@ // Qt #include #include -#include #include -#include -#include #include #include -#include -// utility #include "fcintl.h" // common #include "chatline_common.h" #include "colors_common.h" #include "connectdlg_common.h" -#include "game.h" // client #include "client_main.h" #include "climisc.h" // gui-qt -#include "canvas.h" -#include "chatline.h" -#include "colors.h" #include "dialogs.h" #include "fc_client.h" #include "icons.h" -#include "page_pregame.h" -#include "sprite.h" -#include "voteinfo_bar.h" void option_dialog_popup(const char *name, const struct option_set *poptset); /** diff --git a/client/repodlgs_common.cpp b/client/repodlgs_common.cpp index b7ae37dfcb..5e4c509ded 100644 --- a/client/repodlgs_common.cpp +++ b/client/repodlgs_common.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "log.h" @@ -27,15 +23,11 @@ /* client/include */ #include "citydlg_common.h" -#include "repodlgs_g.h" // client #include "client_main.h" -#include "connectdlg_common.h" // is_server_running() #include "control.h" #include "options.h" -#include "packhand_gen.h" - #include "repodlgs_common.h" /** diff --git a/client/reqtree.cpp b/client/reqtree.cpp index f67671bff5..210e3a6e1a 100644 --- a/client/reqtree.cpp +++ b/client/reqtree.cpp @@ -9,13 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - // utility #include "log.h" diff --git a/client/sciencedlg.cpp b/client/sciencedlg.cpp index e0a097da0e..03c42291e8 100644 --- a/client/sciencedlg.cpp +++ b/client/sciencedlg.cpp @@ -27,7 +27,6 @@ #include "sprite.h" #include "text.h" // gui-qt -#include "canvas.h" #include "citydlg.h" #include "fc_client.h" #include "page_game.h" diff --git a/client/servers.cpp b/client/servers.cpp index 59e89e234b..c23ce10dbd 100644 --- a/client/servers.cpp +++ b/client/servers.cpp @@ -18,7 +18,6 @@ // Qt #include #include -#include #include #include #include diff --git a/client/shortcuts.cpp b/client/shortcuts.cpp index de10543233..7655f0b632 100644 --- a/client/shortcuts.cpp +++ b/client/shortcuts.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include // client #include "options.h" diff --git a/client/spaceshipdlg.cpp b/client/spaceshipdlg.cpp index fcc6a5c13c..18a79442b5 100644 --- a/client/spaceshipdlg.cpp +++ b/client/spaceshipdlg.cpp @@ -20,7 +20,6 @@ #include "mapview_common.h" #include "spaceshipdlg_g.h" // gui-qt -#include "canvas.h" #include "fc_client.h" #include "page_game.h" #include "qtg_cxxside.h" diff --git a/client/sprite.cpp b/client/sprite.cpp index 041adfa712..95aac239bc 100644 --- a/client/sprite.cpp +++ b/client/sprite.cpp @@ -13,11 +13,8 @@ #include // utility #include "log.h" -#include // gui-qt -#include "colors.h" #include "fc_client.h" -#include "qtg_cxxside.h" #include "sprite.h" /** diff --git a/client/text.cpp b/client/text.cpp index 60c6f4a8ab..5ef6ccafd1 100644 --- a/client/text.cpp +++ b/client/text.cpp @@ -9,16 +9,13 @@ **************************************************************************/ #ifdef HAVE_CONFIG_H -#include #endif #include // ceil -#include #include // utility #include "astring.h" -#include "bitvector.h" #include "fcintl.h" #include "log.h" #include "nation.h" diff --git a/client/themes_common.cpp b/client/themes_common.cpp index 8145cbd2a9..2deb382ce5 100644 --- a/client/themes_common.cpp +++ b/client/themes_common.cpp @@ -9,15 +9,11 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ #ifdef HAVE_CONFIG_H -#include #endif -#include -#include // utility #include "log.h" -#include "shared.h" #include "support.h" /* client/include */ diff --git a/client/tilespec.cpp b/client/tilespec.cpp index 2d3020c985..95e842505c 100644 --- a/client/tilespec.cpp +++ b/client/tilespec.cpp @@ -17,10 +17,6 @@ original author: David Pfitzner ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include #include @@ -28,11 +24,9 @@ #include #include #include -#include #include // exit #include -// utility #include "bitvector.h" #include "capability.h" #include "deprecations.h" @@ -62,13 +56,9 @@ /* client/include */ #include "citydlg_g.h" -#include "dialogs_g.h" -#include "gui_main_g.h" #include "mapview_g.h" // for update_map_canvas_visible #include "menu_g.h" #include "sprite_g.h" -#include "themes_g.h" - // client #include "citybar.h" #include "citydlg_common.h" // for generate_citydlg_dimensions() @@ -85,7 +75,6 @@ #include "layer_special.h" #include "layer_terrain.h" #include "options.h" // for fill_xxx -#include "themes_common.h" #include "tilespec.h" // gui-qt diff --git a/client/top_bar.cpp b/client/top_bar.cpp index d9a605ec71..c56ca2d9cb 100644 --- a/client/top_bar.cpp +++ b/client/top_bar.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -29,7 +28,6 @@ #include "nation.h" #include "research.h" // client -#include "citydlg_g.h" #include "client_main.h" #include "climisc.h" #include "ratesdlg_g.h" @@ -43,8 +41,6 @@ #include "sprite.h" #include "top_bar.h" -#include - /** * Constructor */ diff --git a/client/turn_done_button.cpp b/client/turn_done_button.cpp index 30d2225b1d..295eeda82d 100644 --- a/client/turn_done_button.cpp +++ b/client/turn_done_button.cpp @@ -20,8 +20,6 @@ #include #include -#include - namespace { /** * Constants used when drawing the button diff --git a/client/unitselect.cpp b/client/unitselect.cpp index 57b0caa0aa..9d6dbeaa7f 100644 --- a/client/unitselect.cpp +++ b/client/unitselect.cpp @@ -29,7 +29,6 @@ #include "fonts.h" #include "mapview.h" #include "page_game.h" -#include "qtg_cxxside.h" /** Contructor for units_select diff --git a/client/update_queue.cpp b/client/update_queue.cpp index 02026cbbbf..cf75f5c7b8 100644 --- a/client/update_queue.cpp +++ b/client/update_queue.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include @@ -24,7 +20,6 @@ // common #include "city.h" -#include "connection.h" #include "player.h" /* client/include */ @@ -40,7 +35,6 @@ // client #include "client_main.h" #include "connectdlg_common.h" -#include "options.h" #include "plrdlg_common.h" #include "tilespec.h" #include "update_queue.h" diff --git a/client/voteinfo.cpp b/client/voteinfo.cpp index c325de6ae1..439211fc43 100644 --- a/client/voteinfo.cpp +++ b/client/voteinfo.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility @@ -28,7 +24,6 @@ // client #include "client_main.h" -#include "clinet.h" #include "options.h" #include "voteinfo.h" diff --git a/client/widgetdecorations.cpp b/client/widgetdecorations.cpp index f88f7e042c..20fda8aefc 100644 --- a/client/widgetdecorations.cpp +++ b/client/widgetdecorations.cpp @@ -19,7 +19,6 @@ // gui-qt #include "fc_client.h" #include "icons.h" -#include "page_game.h" /**************************************************************************** Scale widget allowing scaling other widgets, shown in right top corner diff --git a/common/achievements.cpp b/common/achievements.cpp index 77f19c8377..c753187c6b 100644 --- a/common/achievements.cpp +++ b/common/achievements.cpp @@ -13,10 +13,6 @@ #include #include -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "log.h" diff --git a/common/actions.cpp b/common/actions.cpp index 6d64b63f61..b3a87edbba 100644 --- a/common/actions.cpp +++ b/common/actions.cpp @@ -9,10 +9,6 @@ received a copy of the GNU General Public License along with Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // ceil, floor #include @@ -3159,8 +3155,8 @@ static enum fc_tristate is_action_possible( return TRI_MAYBE; } - if (!(target_city->shield_stock - < city_production_build_shield_cost(target_city))) { + if (target_city->shield_stock + >= city_production_build_shield_cost(target_city)) { return TRI_NO; } diff --git a/common/aicore/aiactions.cpp b/common/aicore/aiactions.cpp index 7a4bfce4bb..7c40518af7 100644 --- a/common/aicore/aiactions.cpp +++ b/common/aicore/aiactions.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "unittype.h" diff --git a/common/aicore/aisupport.cpp b/common/aicore/aisupport.cpp index 3b6485a1e5..815050f5de 100644 --- a/common/aicore/aisupport.cpp +++ b/common/aicore/aisupport.cpp @@ -10,7 +10,6 @@ **************************************************************************/ #ifdef HAVE_CONFIG_H -#include #endif // utility @@ -24,7 +23,6 @@ #include "map.h" #include "player.h" #include "spaceship.h" -#include "tech.h" #include "unitlist.h" #include "victory.h" diff --git a/common/aicore/caravan.cpp b/common/aicore/caravan.cpp index 33077bf957..b96bc52748 100644 --- a/common/aicore/caravan.cpp +++ b/common/aicore/caravan.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // common diff --git a/common/aicore/citymap.cpp b/common/aicore/citymap.cpp index 200a65202b..1de59e1d81 100644 --- a/common/aicore/citymap.cpp +++ b/common/aicore/citymap.cpp @@ -9,12 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include - // utility #include "log.h" #include "support.h" diff --git a/common/aicore/cm.cpp b/common/aicore/cm.cpp index d719d855a1..d1e55d2e31 100644 --- a/common/aicore/cm.cpp +++ b/common/aicore/cm.cpp @@ -8,10 +8,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include @@ -19,7 +15,6 @@ #include // utility -#include "fcintl.h" #include "shared.h" #include "support.h" #include "timing.h" diff --git a/common/aicore/path_finding.cpp b/common/aicore/path_finding.cpp index 4b8f048bac..785182c5be 100644 --- a/common/aicore/path_finding.cpp +++ b/common/aicore/path_finding.cpp @@ -8,21 +8,14 @@ a copy of the GNU General Public License along with Freeciv21. If not, see https://www.gnu.org/licenses/. **************************************************************************/ - -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "bitvector.h" #include "genhash.h" #include "log.h" -#include "support.h" // common #include "game.h" #include "map.h" -#include "movement.h" /* common/aicore */ #include "pf_tools.h" @@ -38,6 +31,7 @@ #define SPECPQ_TAG map_index #define SPECPQ_DATA_TYPE int #define SPECPQ_PRIORITY_TYPE int +#include "movement.h" #include "specpq.h" #define INITIAL_QUEUE_SIZE 100 diff --git a/common/aicore/pf_tools.cpp b/common/aicore/pf_tools.cpp index 02c9d25290..518afa7a85 100644 --- a/common/aicore/pf_tools.cpp +++ b/common/aicore/pf_tools.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility @@ -21,7 +17,6 @@ // common #include "base.h" -#include "combat.h" #include "game.h" #include "movement.h" #include "tile.h" diff --git a/common/base.cpp b/common/base.cpp index 8459fd7175..d488ddea0a 100644 --- a/common/base.cpp +++ b/common/base.cpp @@ -9,10 +9,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "extras.h" #include "game.h" diff --git a/common/borders.cpp b/common/borders.cpp index 3d0968fbfa..f8f0d39a81 100644 --- a/common/borders.cpp +++ b/common/borders.cpp @@ -9,10 +9,6 @@ received a copy of the GNU General Public License along with Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "log.h" diff --git a/common/calendar.cpp b/common/calendar.cpp index b49d8f283a..d6836fa30e 100644 --- a/common/calendar.cpp +++ b/common/calendar.cpp @@ -9,10 +9,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "game.h" #include "victory.h" diff --git a/common/capstr.cpp b/common/capstr.cpp index 84e598462d..b18ab40d31 100644 --- a/common/capstr.cpp +++ b/common/capstr.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // getenv() // gen_headers diff --git a/common/citizens.cpp b/common/citizens.cpp index 06cd63874f..86273d9cd8 100644 --- a/common/citizens.cpp +++ b/common/citizens.cpp @@ -9,10 +9,6 @@ received a copy of the GNU General Public License along with Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "log.h" #include "rand.h" diff --git a/common/city.cpp b/common/city.cpp index 35425afd4f..8dd5b521b1 100644 --- a/common/city.cpp +++ b/common/city.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // pow, sqrt, exp #include #include diff --git a/common/clientutils.cpp b/common/clientutils.cpp index 1c8a97234b..1c47168e67 100644 --- a/common/clientutils.cpp +++ b/common/clientutils.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "extras.h" #include "fc_types.h" diff --git a/common/combat.cpp b/common/combat.cpp index 11346423df..3dc0cb0fa4 100644 --- a/common/combat.cpp +++ b/common/combat.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility diff --git a/common/culture.cpp b/common/culture.cpp index d5ab951f26..350dc953d8 100644 --- a/common/culture.cpp +++ b/common/culture.cpp @@ -9,10 +9,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "city.h" #include "effects.h" diff --git a/common/diptreaty.cpp b/common/diptreaty.cpp index 326bda2186..9f07c6b8f2 100644 --- a/common/diptreaty.cpp +++ b/common/diptreaty.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "log.h" diff --git a/common/disaster.cpp b/common/disaster.cpp index 7e36f68fb2..e75dc1877f 100644 --- a/common/disaster.cpp +++ b/common/disaster.cpp @@ -9,10 +9,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" diff --git a/common/effects.cpp b/common/effects.cpp index 520fc277ce..4ce7b9e536 100644 --- a/common/effects.cpp +++ b/common/effects.cpp @@ -8,11 +8,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: received a copy of the GNU General Public License along with :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include #include // utility @@ -24,7 +19,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. // common #include "city.h" -#include "game.h" #include "government.h" #include "improvement.h" #include "map.h" diff --git a/common/events.cpp b/common/events.cpp index 0148405031..ad83a193f5 100644 --- a/common/events.cpp +++ b/common/events.cpp @@ -11,11 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include #include // utility diff --git a/common/extras.cpp b/common/extras.cpp index d96c8b48e4..df0b886e16 100644 --- a/common/extras.cpp +++ b/common/extras.cpp @@ -9,10 +9,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "rand.h" diff --git a/common/fc_interface.cpp b/common/fc_interface.cpp index d0e5cee34b..14c40a013e 100644 --- a/common/fc_interface.cpp +++ b/common/fc_interface.cpp @@ -9,18 +9,12 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "shared.h" // common #include "player.h" #include "tile.h" -#include "vision.h" - #include "fc_interface.h" /* Struct with functions pointers; the functions are defined in diff --git a/common/featured_text.cpp b/common/featured_text.cpp index dd7692d1ef..ae262293ed 100644 --- a/common/featured_text.cpp +++ b/common/featured_text.cpp @@ -10,10 +10,6 @@ /o) (o/\ \_ General Public License along with Freeciv21. \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include diff --git a/common/game.cpp b/common/game.cpp index 6c2bc775e2..4118e4dedd 100644 --- a/common/game.cpp +++ b/common/game.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "log.h" @@ -29,7 +25,6 @@ #include "actions.h" #include "ai.h" #include "city.h" -#include "connection.h" #include "disaster.h" #include "extras.h" #include "government.h" @@ -40,16 +35,12 @@ #include "packets.h" #include "player.h" #include "research.h" -#include "spaceship.h" #include "specialist.h" #include "style.h" #include "tech.h" #include "terrain.h" #include "traderoutes.h" #include "unit.h" -#include "unitlist.h" -#include "victory.h" - #include "game.h" struct civ_game game; diff --git a/common/government.cpp b/common/government.cpp index ff9ab02c37..1f15047f13 100644 --- a/common/government.cpp +++ b/common/government.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "iterator.h" diff --git a/common/helpdata.cpp b/common/helpdata.cpp index af6bcdff28..f80162f142 100644 --- a/common/helpdata.cpp +++ b/common/helpdata.cpp @@ -23,7 +23,6 @@ #include #include -#include #include // utility diff --git a/common/idex.cpp b/common/idex.cpp index caf8045260..6cb985fd8d 100644 --- a/common/idex.cpp +++ b/common/idex.cpp @@ -25,10 +25,6 @@ so can use pointers to pcity->id etc. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "log.h" diff --git a/common/improvement.cpp b/common/improvement.cpp index 2badb7bfc2..0b3bf55924 100644 --- a/common/improvement.cpp +++ b/common/improvement.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "log.h" @@ -23,11 +19,8 @@ // common #include "game.h" -#include "map.h" -#include "tech.h" -#include "victory.h" - #include "improvement.h" +#include "victory.h" /************************************************************************** All the city improvements: diff --git a/common/map.cpp b/common/map.cpp index f91610c155..a519e02314 100644 --- a/common/map.cpp +++ b/common/map.cpp @@ -12,15 +12,10 @@ \____/ ********************************************************/ #include - -#ifdef HAVE_CONFIG_H -#include -#endif #include #include // qstrlen // utility -#include "fcintl.h" #include "iterator.h" #include "log.h" #include "rand.h" @@ -36,8 +31,6 @@ #include "packets.h" #include "road.h" #include "unit.h" -#include "unitlist.h" - #include "map.h" static struct startpos *startpos_new(struct tile *ptile); diff --git a/common/mapimg.cpp b/common/mapimg.cpp index b3e1f1c2dd..85f8b1a4b4 100644 --- a/common/mapimg.cpp +++ b/common/mapimg.cpp @@ -9,10 +9,6 @@ received a copy of the GNU General Public License along with Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #ifdef HAVE_MAPIMG_MAGICKWAND @@ -27,7 +23,6 @@ received a copy of the GNU General Public License along with Freeciv21. // common #include "calendar.h" -#include "connection.h" #include "fc_types.h" #include "game.h" #include "map.h" diff --git a/common/metaknowledge.cpp b/common/metaknowledge.cpp index 6a2aaf4c1f..19841a2594 100644 --- a/common/metaknowledge.cpp +++ b/common/metaknowledge.cpp @@ -9,10 +9,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "diptreaty.h" #include "game.h" diff --git a/common/movement.cpp b/common/movement.cpp index d390158676..190b6d29f5 100644 --- a/common/movement.cpp +++ b/common/movement.cpp @@ -9,22 +9,14 @@ received a copy of the GNU General Public License along with Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility #include "bitvector.h" -#include "fcintl.h" #include "log.h" #include "shared.h" #include "support.h" - // common -#include "base.h" -#include "effects.h" #include "fc_types.h" #include "game.h" #include "map.h" diff --git a/common/multipliers.cpp b/common/multipliers.cpp index f22a5a35b4..103d0b0eb7 100644 --- a/common/multipliers.cpp +++ b/common/multipliers.cpp @@ -9,10 +9,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" diff --git a/common/nation.cpp b/common/nation.cpp index 3f2ba5e610..d593329c23 100644 --- a/common/nation.cpp +++ b/common/nation.cpp @@ -15,10 +15,6 @@ Functions for handling the nations. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "support.h" @@ -28,7 +24,6 @@ #include "game.h" #include "government.h" #include "player.h" -#include "tech.h" #include "traits.h" #include "nation.h" diff --git a/common/networking/connection.cpp b/common/networking/connection.cpp index eceaddfcf9..f5cf47ab43 100644 --- a/common/networking/connection.cpp +++ b/common/networking/connection.cpp @@ -11,9 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif // Qt #include diff --git a/common/networking/dataio_raw.cpp b/common/networking/dataio_raw.cpp index 76705816f7..0fd8f3060b 100644 --- a/common/networking/dataio_raw.cpp +++ b/common/networking/dataio_raw.cpp @@ -19,24 +19,14 @@ * data". */ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include #include #include -#include -#include #include // Qt #include // utility -#include "bitvector.h" -#include "capability.h" -#include "log.h" #include "support.h" // common diff --git a/common/networking/packets.cpp b/common/networking/packets.cpp index a28d7815a0..30bb4aa3c2 100644 --- a/common/networking/packets.cpp +++ b/common/networking/packets.cpp @@ -11,13 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include #include // utility @@ -28,10 +21,7 @@ // commmon #include "dataio.h" -#include "events.h" #include "game.h" -#include "map.h" - #include "packets.h" #include @@ -203,50 +193,49 @@ int send_packet_data(struct connection *pc, unsigned char *data, int len, pc->outgoing_packet_notify(pc, packet_type, len, result); } - if (true) { - int size = len; - - if (conn_compression_frozen(pc)) { - size_t old_size; + int size = len; + if (conn_compression_frozen(pc)) { + size_t old_size; - /* Keep this a decent amount less than MAX_LEN_BUFFER to avoid the - * (remote) possibility of trying to dump MAX_LEN_BUFFER to the - * network in one go */ + /* Keep this a decent amount less than MAX_LEN_BUFFER to avoid the + * (remote) possibility of trying to dump MAX_LEN_BUFFER to the + * network in one go */ #define MAX_LEN_COMPRESS_QUEUE (MAX_LEN_BUFFER / 2) - FC_STATIC_ASSERT(MAX_LEN_COMPRESS_QUEUE < MAX_LEN_BUFFER, - compress_queue_maxlen_too_big); - - /* If this packet would cause us to overfill the queue, flush - * everything that's in there already before queuing this one */ - if (MAX_LEN_COMPRESS_QUEUE - < byte_vector_size(&pc->compression.queue) + len) { - log_compress2( - "COMPRESS: huge queue, forcing to flush (%lu/%lu)", - (long unsigned) byte_vector_size(&pc->compression.queue), - (long unsigned) MAX_LEN_COMPRESS_QUEUE); - if (!conn_compression_flush(pc)) { - return -1; - } - byte_vector_reserve(&pc->compression.queue, 0); + FC_STATIC_ASSERT(MAX_LEN_COMPRESS_QUEUE < MAX_LEN_BUFFER, + compress_queue_maxlen_too_big); + + /* If this packet would cause us to overfill the queue, flush + * everything that's in there already before queuing this one */ + if (MAX_LEN_COMPRESS_QUEUE + < byte_vector_size(&pc->compression.queue) + len) { + log_compress2("COMPRESS: huge queue, forcing to flush (%lu/%lu)", + (long unsigned) byte_vector_size(&pc->compression.queue), + (long unsigned) MAX_LEN_COMPRESS_QUEUE); + if (!conn_compression_flush(pc)) { + return -1; } - - old_size = byte_vector_size(&pc->compression.queue); - byte_vector_reserve(&pc->compression.queue, old_size + len); - memcpy(pc->compression.queue.p + old_size, data, len); - log_compress2("COMPRESS: putting %s into the queue", - packet_name(packet_type)); - } else { - stat_size_alone += size; - log_compress("COMPRESS: sending %s alone (%d bytes total)", - packet_name(packet_type), stat_size_alone); - connection_send_data(pc, data, len); + byte_vector_reserve(&pc->compression.queue, 0); } - log_compress2("COMPRESS: STATS: alone=%d compression-expand=%d " - "compression (before/after) = %d/%d", - stat_size_alone, stat_size_no_compression, - stat_size_uncompressed, stat_size_compressed); - } + old_size = byte_vector_size(&pc->compression.queue); + byte_vector_reserve(&pc->compression.queue, old_size + len); + memcpy(pc->compression.queue.p + old_size, data, len); + log_compress2("COMPRESS: putting %s into the queue", + packet_name(packet_type)); + } else { + stat_size_alone += size; + log_compress("COMPRESS: sending %s alone (%d bytes total)", + packet_name(packet_type), stat_size_alone); + connection_send_data(pc, data, len); + } + log_compress2("COMPRESS: STATS: alone=%d compression-expand=%d " + "compression (before/after) = %d/%d", + stat_size_alone, stat_size_no_compression, + stat_size_uncompressed, stat_size_compressed); + log_compress2("COMPRESS: STATS: alone=%d compression-expand=%d " + "compression (before/after) = %d/%d", + stat_size_alone, stat_size_no_compression, + stat_size_uncompressed, stat_size_compressed); #if PACKET_SIZE_STATISTICS { diff --git a/common/player.cpp b/common/player.cpp index 4ee400572f..2c808bb411 100644 --- a/common/player.cpp +++ b/common/player.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include @@ -38,7 +34,6 @@ #include "nation.h" #include "research.h" #include "rgbcolor.h" -#include "tech.h" #include "unit.h" #include "unitlist.h" #include "vision.h" diff --git a/common/reqtext.cpp b/common/reqtext.cpp index 86389bf179..acbf1e8adc 100644 --- a/common/reqtext.cpp +++ b/common/reqtext.cpp @@ -9,10 +9,6 @@ received a copy of the GNU General Public License along with Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "astring.h" #include "fcintl.h" diff --git a/common/requirements.cpp b/common/requirements.cpp index d0d4ee8678..3687e2f303 100644 --- a/common/requirements.cpp +++ b/common/requirements.cpp @@ -8,10 +8,6 @@ a copy of the GNU General Public License along with Freeciv21. If not, see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "log.h" diff --git a/common/research.cpp b/common/research.cpp index 593ae302c7..346fa591fc 100644 --- a/common/research.cpp +++ b/common/research.cpp @@ -8,10 +8,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: received a copy of the GNU General Public License along with :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "iterator.h" diff --git a/common/rgbcolor.cpp b/common/rgbcolor.cpp index 4eb9d44eda..a39e5bd60c 100644 --- a/common/rgbcolor.cpp +++ b/common/rgbcolor.cpp @@ -9,10 +9,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility @@ -21,9 +17,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. #include "registry.h" // common -#include "fc_interface.h" -#include "game.h" - #include "rgbcolor.h" /** diff --git a/common/road.cpp b/common/road.cpp index d745b76ad0..f49c548e2f 100644 --- a/common/road.cpp +++ b/common/road.cpp @@ -9,19 +9,11 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "extras.h" #include "fc_types.h" #include "game.h" #include "map.h" -#include "movement.h" -#include "name_translation.h" -#include "unittype.h" - #include "road.h" /** diff --git a/common/scriptcore/api_common_intl.cpp b/common/scriptcore/api_common_intl.cpp index ec3df10eef..22d71035bc 100644 --- a/common/scriptcore/api_common_intl.cpp +++ b/common/scriptcore/api_common_intl.cpp @@ -8,10 +8,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" diff --git a/common/scriptcore/api_common_utilities.cpp b/common/scriptcore/api_common_utilities.cpp index 9d7c35dba5..11040f9a0d 100644 --- a/common/scriptcore/api_common_utilities.cpp +++ b/common/scriptcore/api_common_utilities.cpp @@ -10,10 +10,6 @@ https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // Sol @@ -22,17 +18,16 @@ // utilities #include "deprecations.h" #include "fcintl.h" -#include "log.h" #include "rand.h" // common -#include "map.h" #include "version.h" /* common/scriptcore */ #include "luascript.h" #include "api_common_utilities.h" +#include "map.h" /** Generate random number. diff --git a/common/scriptcore/api_game_effects.cpp b/common/scriptcore/api_game_effects.cpp index 8a0b922694..ced57fcc81 100644 --- a/common/scriptcore/api_game_effects.cpp +++ b/common/scriptcore/api_game_effects.cpp @@ -8,10 +8,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" diff --git a/common/scriptcore/api_game_find.cpp b/common/scriptcore/api_game_find.cpp index cf98e7a24c..27d1a20aad 100644 --- a/common/scriptcore/api_game_find.cpp +++ b/common/scriptcore/api_game_find.cpp @@ -8,17 +8,12 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" // common #include "idex.h" #include "map.h" -#include "movement.h" /* common/scriptcore */ #include "luascript.h" diff --git a/common/scriptcore/api_game_methods.cpp b/common/scriptcore/api_game_methods.cpp index a894778e18..2db4757075 100644 --- a/common/scriptcore/api_game_methods.cpp +++ b/common/scriptcore/api_game_methods.cpp @@ -8,10 +8,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "deprecations.h" #include "fcintl.h" diff --git a/common/scriptcore/api_game_specenum.cpp b/common/scriptcore/api_game_specenum.cpp index 348987efbc..8740674288 100644 --- a/common/scriptcore/api_game_specenum.cpp +++ b/common/scriptcore/api_game_specenum.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include /* dependencies/lua */ diff --git a/common/scriptcore/luascript.cpp b/common/scriptcore/luascript.cpp index 97189bdc55..1b68ae2ba7 100644 --- a/common/scriptcore/luascript.cpp +++ b/common/scriptcore/luascript.cpp @@ -8,16 +8,10 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include -#include #include // Qt -#include /* dependencies/lua */ extern "C" { diff --git a/common/scriptcore/luascript_func.cpp b/common/scriptcore/luascript_func.cpp index 7c227afd0c..4acbb3c619 100644 --- a/common/scriptcore/luascript_func.cpp +++ b/common/scriptcore/luascript_func.cpp @@ -8,10 +8,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include /* dependencies/lua */ diff --git a/common/scriptcore/luascript_signal.cpp b/common/scriptcore/luascript_signal.cpp index aedfaefb6d..2ec93f6be8 100644 --- a/common/scriptcore/luascript_signal.cpp +++ b/common/scriptcore/luascript_signal.cpp @@ -33,10 +33,6 @@ If the value is 'true' the current signal emission will be stopped. *****************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "deprecations.h" @@ -91,12 +87,8 @@ static struct signal *signal_new(int nargs, enum api_types *parg_types) */ static void signal_destroy(struct signal *psignal) { - if (psignal->arg_types) { - delete[] psignal->arg_types; - } - if (psignal->depr_msg) { - delete[] psignal->depr_msg; - } + delete[] psignal->arg_types; + delete[] psignal->depr_msg; while (!psignal->callbacks->isEmpty()) { signal_callback_destroy(psignal->callbacks->takeFirst()); } diff --git a/common/server_settings.cpp b/common/server_settings.cpp index 33754d68ca..80873b80fd 100644 --- a/common/server_settings.cpp +++ b/common/server_settings.cpp @@ -9,10 +9,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "fc_interface.h" diff --git a/common/spaceship.cpp b/common/spaceship.cpp index 01025bb591..9079c5b456 100644 --- a/common/spaceship.cpp +++ b/common/spaceship.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "shared.h" // TRUE, FALSE #include "spaceship.h" diff --git a/common/specialist.cpp b/common/specialist.cpp index db46f8c3a6..1177f13b58 100644 --- a/common/specialist.cpp +++ b/common/specialist.cpp @@ -10,10 +10,6 @@ https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "log.h" diff --git a/common/style.cpp b/common/style.cpp index 52273ef68b..df75f5eaf9 100644 --- a/common/style.cpp +++ b/common/style.cpp @@ -10,10 +10,6 @@ https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" diff --git a/common/team.cpp b/common/team.cpp index e4bcadcafc..49d97fde67 100644 --- a/common/team.cpp +++ b/common/team.cpp @@ -14,8 +14,6 @@ #include #endif -#include - // utility #include "fcintl.h" #include "log.h" diff --git a/common/tech.cpp b/common/tech.cpp index 1b82806ff3..e4e3e488df 100644 --- a/common/tech.cpp +++ b/common/tech.cpp @@ -11,12 +11,7 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include -#include // exit #include // utility @@ -28,8 +23,6 @@ // common #include "game.h" -#include "research.h" - #include "tech.h" struct advance_req_iter { diff --git a/common/terrain.cpp b/common/terrain.cpp index 5a8ae68bfd..a03720f4f5 100644 --- a/common/terrain.cpp +++ b/common/terrain.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "log.h" // fc_assert diff --git a/common/tile.cpp b/common/tile.cpp index 774d0842e0..4a19906757 100644 --- a/common/tile.cpp +++ b/common/tile.cpp @@ -11,7 +11,6 @@ **************************************************************************/ #ifdef HAVE_CONFIG_H -#include #endif #include @@ -24,7 +23,6 @@ #include "fc_interface.h" #include "game.h" #include "map.h" -#include "movement.h" #include "road.h" #include "unit.h" #include "unitlist.h" diff --git a/common/traderoutes.cpp b/common/traderoutes.cpp index 7580f7a407..aa95f3edde 100644 --- a/common/traderoutes.cpp +++ b/common/traderoutes.cpp @@ -9,10 +9,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "log.h" diff --git a/common/unit.cpp b/common/unit.cpp index 39c683fc85..abaade3389 100644 --- a/common/unit.cpp +++ b/common/unit.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "bitvector.h" #include "fcintl.h" @@ -24,7 +20,6 @@ // common #include "actions.h" #include "ai.h" -#include "base.h" #include "city.h" #include "game.h" #include "log.h" @@ -32,9 +27,6 @@ #include "movement.h" #include "packets.h" #include "player.h" -#include "road.h" -#include "tech.h" -#include "traderoutes.h" #include "unitlist.h" #include "unit.h" diff --git a/common/unitlist.cpp b/common/unitlist.cpp index 5e380b96c5..c4a35418c1 100644 --- a/common/unitlist.cpp +++ b/common/unitlist.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "log.h" diff --git a/common/unittype.cpp b/common/unittype.cpp index f2f1dd4f65..56506fa634 100644 --- a/common/unittype.cpp +++ b/common/unittype.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // ceil #include diff --git a/common/version.cpp b/common/version.cpp index 1ce4adb0d1..8fdbe7f02c 100644 --- a/common/version.cpp +++ b/common/version.cpp @@ -21,8 +21,6 @@ #include "support.h" // common -#include "fc_types.h" - #include "version.h" #ifdef GITREV diff --git a/common/victory.cpp b/common/victory.cpp index cbf413e2d8..17efe8e887 100644 --- a/common/victory.cpp +++ b/common/victory.cpp @@ -9,10 +9,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "game.h" diff --git a/common/vision.cpp b/common/vision.cpp index 31e6654c54..20ef5d6a24 100644 --- a/common/vision.cpp +++ b/common/vision.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "log.h" #include "shared.h" diff --git a/common/workertask.cpp b/common/workertask.cpp index 6c0bab30f4..7f7a7bcaa8 100644 --- a/common/workertask.cpp +++ b/common/workertask.cpp @@ -9,16 +9,8 @@ received a copy of the GNU General Public License along with Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -// utility -#include "log.h" // common -#include "city.h" - #include "workertask.h" /** diff --git a/common/worklist.cpp b/common/worklist.cpp index 48fcb71e3d..67a63b4a53 100644 --- a/common/worklist.cpp +++ b/common/worklist.cpp @@ -11,11 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include #include // utility diff --git a/server/actiontools.cpp b/server/actiontools.cpp index 22956f3cd2..25a051dd27 100644 --- a/server/actiontools.cpp +++ b/server/actiontools.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "rand.h" diff --git a/server/advisors/advbuilding.cpp b/server/advisors/advbuilding.cpp index 45e129ac91..faaf45a741 100644 --- a/server/advisors/advbuilding.cpp +++ b/server/advisors/advbuilding.cpp @@ -11,17 +11,10 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -// utility -#include "rand.h" // common #include "ai.h" #include "city.h" -#include "effects.h" #include "game.h" #include "movement.h" #include "player.h" @@ -33,7 +26,6 @@ // server #include "citytools.h" -#include "plrhand.h" #include "srv_log.h" /* server/advisors */ diff --git a/server/advisors/advchoice.cpp b/server/advisors/advchoice.cpp index 5f09e3283a..607eae35ba 100644 --- a/server/advisors/advchoice.cpp +++ b/server/advisors/advchoice.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "support.h" diff --git a/server/advisors/advcity.cpp b/server/advisors/advcity.cpp index e81a652e19..cd5afd0421 100644 --- a/server/advisors/advcity.cpp +++ b/server/advisors/advcity.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "city.h" #include "fc_types.h" diff --git a/server/advisors/advdata.cpp b/server/advisors/advdata.cpp index 32565d55d6..81318c258d 100644 --- a/server/advisors/advdata.cpp +++ b/server/advisors/advdata.cpp @@ -8,10 +8,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "log.h" @@ -31,11 +27,9 @@ /* common/aicore */ #include "aisupport.h" #include "path_finding.h" -#include "pf_tools.h" // server #include "cityturn.h" -#include "diplhand.h" #include "maphand.h" #include "plrhand.h" #include "srv_log.h" @@ -45,7 +39,6 @@ #include "advbuilding.h" #include "advcity.h" #include "advtools.h" -#include "autosettlers.h" // ai #include "handicaps.h" diff --git a/server/advisors/advgoto.cpp b/server/advisors/advgoto.cpp index cd048ba662..82bfe08f2e 100644 --- a/server/advisors/advgoto.cpp +++ b/server/advisors/advgoto.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "ai.h" #include "combat.h" diff --git a/server/advisors/advruleset.cpp b/server/advisors/advruleset.cpp index 49bd1fe9c7..92baf4fcd6 100644 --- a/server/advisors/advruleset.cpp +++ b/server/advisors/advruleset.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "base.h" #include "effects.h" diff --git a/server/advisors/advspace.cpp b/server/advisors/advspace.cpp index d4c72dae2c..7f748c6f74 100644 --- a/server/advisors/advspace.cpp +++ b/server/advisors/advspace.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "government.h" #include "packets.h" diff --git a/server/advisors/advtools.cpp b/server/advisors/advtools.cpp index 8da80528fb..f12e0e9c4e 100644 --- a/server/advisors/advtools.cpp +++ b/server/advisors/advtools.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include "advtools.h" diff --git a/server/advisors/autoexplorer.cpp b/server/advisors/autoexplorer.cpp index 53aad2874c..f7779263f2 100644 --- a/server/advisors/autoexplorer.cpp +++ b/server/advisors/autoexplorer.cpp @@ -9,14 +9,9 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // log // utility -#include "bitvector.h" #include "log.h" // common diff --git a/server/advisors/autosettlers.cpp b/server/advisors/autosettlers.cpp index 8dd1355265..1870c89c0a 100644 --- a/server/advisors/autosettlers.cpp +++ b/server/advisors/autosettlers.cpp @@ -11,16 +11,7 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - // utility -#include "fcintl.h" #include "log.h" #include "support.h" #include "timing.h" @@ -45,7 +36,6 @@ // server #include "citytools.h" #include "maphand.h" -#include "plrhand.h" #include "srv_log.h" #include "unithand.h" #include "unittools.h" diff --git a/server/advisors/infracache.cpp b/server/advisors/infracache.cpp index 0e04c06bea..840b948398 100644 --- a/server/advisors/infracache.cpp +++ b/server/advisors/infracache.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "city.h" #include "game.h" diff --git a/server/animals.cpp b/server/animals.cpp index fb2b9f75d2..50dda9504f 100644 --- a/server/animals.cpp +++ b/server/animals.cpp @@ -11,10 +11,6 @@ If not, see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "ai.h" #include "game.h" @@ -23,7 +19,6 @@ #include "nation.h" #include "player.h" #include "research.h" -#include "tech.h" #include "tile.h" #include "unittype.h" @@ -31,7 +26,6 @@ #include "aiiface.h" #include "plrhand.h" #include "srv_main.h" -#include "stdinhand.h" #include "techtools.h" #include "unittools.h" diff --git a/server/auth.cpp b/server/auth.cpp index ff9427715d..0959793036 100644 --- a/server/auth.cpp +++ b/server/auth.cpp @@ -9,18 +9,9 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - // utility #include "fcintl.h" #include "log.h" -#include "registry.h" #include "shared.h" #include "support.h" @@ -33,9 +24,7 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. // server #include "connecthand.h" -#include "fcdb.h" #include "notify.h" -#include "sernet.h" #include "srv_main.h" /* server/scripting */ diff --git a/server/barbarian.cpp b/server/barbarian.cpp index 68cc4f1cec..c6c8976a97 100644 --- a/server/barbarian.cpp +++ b/server/barbarian.cpp @@ -15,14 +15,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. with more ideas from Falk Hueffner ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - // utility #include "fcintl.h" #include "log.h" @@ -38,19 +30,15 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. #include "movement.h" #include "nation.h" #include "research.h" -#include "tech.h" #include "terrain.h" -#include "unitlist.h" // server #include "aiiface.h" #include "citytools.h" -#include "gamehand.h" #include "maphand.h" #include "notify.h" #include "plrhand.h" #include "srv_main.h" -#include "stdinhand.h" #include "techtools.h" #include "unithand.h" #include "unittools.h" diff --git a/server/citizenshand.cpp b/server/citizenshand.cpp index b4fc00842c..a6f6ed5455 100644 --- a/server/citizenshand.cpp +++ b/server/citizenshand.cpp @@ -9,10 +9,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "log.h" #include "rand.h" @@ -25,9 +21,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. #include "player.h" // server -#include "cityturn.h" -#include "sanitycheck.h" - #include "citizenshand.h" #define log_citizens log_debug diff --git a/server/cityhand.cpp b/server/cityhand.cpp index 82c3ad6f81..1b13c3b637 100644 --- a/server/cityhand.cpp +++ b/server/cityhand.cpp @@ -11,14 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - // utility #include "fcintl.h" #include "log.h" @@ -29,7 +21,6 @@ #include "city.h" #include "events.h" #include "game.h" -#include "idex.h" #include "map.h" #include "player.h" #include "specialist.h" diff --git a/server/citytools.cpp b/server/citytools.cpp index 6483b6c810..159333333a 100644 --- a/server/citytools.cpp +++ b/server/citytools.cpp @@ -11,17 +11,8 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include -#include -#include -#include - -// utility #include "bitvector.h" #include "fcintl.h" #include "log.h" @@ -31,11 +22,9 @@ // common #include "ai.h" -#include "base.h" #include "citizens.h" #include "city.h" #include "culture.h" -#include "events.h" #include "game.h" #include "government.h" #include "idex.h" @@ -78,7 +67,6 @@ /* server/advisors */ #include "advbuilding.h" #include "advgoto.h" -#include "autosettlers.h" #include "infracache.h" /* server/scripting */ @@ -87,9 +75,6 @@ // ai #include "handicaps.h" -// ai -#include "handicaps.h" - #include "citytools.h" // Queue for pending auto_arrange_workers() diff --git a/server/civserver.cpp b/server/civserver.cpp index 3fa161a864..f77146796f 100644 --- a/server/civserver.cpp +++ b/server/civserver.cpp @@ -15,14 +15,11 @@ #include #endif -#include #include #include #include #include -#include - #ifdef FREECIV_MSWINDOWS #include #endif @@ -47,7 +44,6 @@ // server #include "aiiface.h" #include "console.h" -#include "meta.h" #include "sernet.h" #include "server.h" #include "srv_main.h" diff --git a/server/commands.cpp b/server/commands.cpp index 3feb614eb7..d175f92414 100644 --- a/server/commands.cpp +++ b/server/commands.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" diff --git a/server/connecthand.cpp b/server/connecthand.cpp index b5e5de9cb1..7dd00e2f7a 100644 --- a/server/connecthand.cpp +++ b/server/connecthand.cpp @@ -43,7 +43,6 @@ #include "plrhand.h" #include "report.h" #include "ruleset.h" -#include "sernet.h" #include "settings.h" #include "srv_main.h" #include "stdinhand.h" diff --git a/server/console.cpp b/server/console.cpp index 921cdf4975..330f0dc14a 100644 --- a/server/console.cpp +++ b/server/console.cpp @@ -17,7 +17,6 @@ #include #include -#include // utility #include "deprecations.h" @@ -34,8 +33,6 @@ // server #include "notify.h" -#include "srv_main.h" - #include "console.h" static bool console_show_prompt = false; diff --git a/server/diplhand.cpp b/server/diplhand.cpp index 1537acc2ad..feb6598fa9 100644 --- a/server/diplhand.cpp +++ b/server/diplhand.cpp @@ -11,13 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - // utility #include "bitvector.h" #include "fcintl.h" @@ -28,12 +21,9 @@ #include "diptreaty.h" #include "events.h" #include "game.h" -#include "map.h" #include "packets.h" #include "player.h" #include "research.h" -#include "unit.h" - /* common/scriptcore */ #include "luascript_types.h" @@ -46,9 +36,6 @@ #include "techtools.h" #include "unittools.h" -/* server/advisors */ -#include "autosettlers.h" - /* server/scripting */ #include "script_server.h" diff --git a/server/diplomats.cpp b/server/diplomats.cpp index 179d3491c4..001772b9f5 100644 --- a/server/diplomats.cpp +++ b/server/diplomats.cpp @@ -11,15 +11,8 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - // utility #include "bitvector.h" -#include "fcintl.h" #include "log.h" #include "rand.h" @@ -28,9 +21,7 @@ #include "combat.h" #include "events.h" #include "game.h" -#include "government.h" #include "map.h" -#include "movement.h" #include "player.h" #include "research.h" #include "unitlist.h" @@ -50,6 +41,7 @@ #include "unittools.h" /* server/scripting */ +#include "movement.h" #include "script_server.h" /****************************************************************************/ diff --git a/server/edithand.cpp b/server/edithand.cpp index 494ff9d04d..e8116c5439 100644 --- a/server/edithand.cpp +++ b/server/edithand.cpp @@ -10,10 +10,6 @@ https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include // USHRT_MAX @@ -46,7 +42,6 @@ #include "notify.h" #include "plrhand.h" #include "sanitycheck.h" -#include "stdinhand.h" #include "techtools.h" #include "unittools.h" diff --git a/server/fcdb.cpp b/server/fcdb.cpp index 94f5f01c86..5b93ecbdd0 100644 --- a/server/fcdb.cpp +++ b/server/fcdb.cpp @@ -10,13 +10,8 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. ***********************************************************************/ #ifdef HAVE_CONFIG_H -#include #endif -#include -#include -#include - // Qt #include #include @@ -24,19 +19,11 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. // utility #include "fcintl.h" #include "log.h" -#include "shared.h" #include "support.h" // common -#include "connection.h" #include "packets.h" -// server -#include "connecthand.h" -#include "notify.h" -#include "sernet.h" -#include "srv_main.h" - /* server/scripting */ #include "script_fcdb.h" diff --git a/server/gamehand.cpp b/server/gamehand.cpp index c9e20a5f4b..8f6c92c8b6 100644 --- a/server/gamehand.cpp +++ b/server/gamehand.cpp @@ -11,18 +11,12 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // for remove() // utility -#include "capability.h" #include "fcintl.h" #include "log.h" #include "rand.h" -#include "registry.h" #include "shared.h" #include "support.h" @@ -31,7 +25,6 @@ #include "calendar.h" #include "events.h" #include "game.h" -#include "improvement.h" #include "movement.h" #include "nation.h" #include "packets.h" @@ -41,7 +34,6 @@ #include "connecthand.h" #include "maphand.h" #include "notify.h" -#include "plrhand.h" #include "srv_main.h" #include "stdinhand.h" #include "unittools.h" diff --git a/server/generator/fracture_map.cpp b/server/generator/fracture_map.cpp index 45ea570137..1eee755e5e 100644 --- a/server/generator/fracture_map.cpp +++ b/server/generator/fracture_map.cpp @@ -10,10 +10,6 @@ L_JJ \__JJ GNU General Public License along with Freeciv21. If not, see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "rand.h" diff --git a/server/generator/height_map.cpp b/server/generator/height_map.cpp index 4abf4ae76e..644c595575 100644 --- a/server/generator/height_map.cpp +++ b/server/generator/height_map.cpp @@ -8,10 +8,6 @@ a copy of the GNU General Public License along with Freeciv21. If not, see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "rand.h" diff --git a/server/generator/mapgen.cpp b/server/generator/mapgen.cpp index 3e5ed6f3bc..57ddae7e9b 100644 --- a/server/generator/mapgen.cpp +++ b/server/generator/mapgen.cpp @@ -16,11 +16,8 @@ #endif #include -#include #include #include -#include - // utility #include "bitvector.h" #include "fcintl.h" diff --git a/server/generator/mapgen_topology.cpp b/server/generator/mapgen_topology.cpp index ff8c8f8f79..5eec7af80e 100644 --- a/server/generator/mapgen_topology.cpp +++ b/server/generator/mapgen_topology.cpp @@ -8,10 +8,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: received a copy of the GNU General Public License along with :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // sqrt // utility diff --git a/server/generator/mapgen_utils.cpp b/server/generator/mapgen_utils.cpp index 50087ec1c6..75cb1269a7 100644 --- a/server/generator/mapgen_utils.cpp +++ b/server/generator/mapgen_utils.cpp @@ -8,10 +8,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: received a copy of the GNU General Public License along with :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "log.h" @@ -20,7 +16,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. // common #include "map.h" -#include "packets.h" #include "terrain.h" #include "tile.h" @@ -552,7 +547,7 @@ struct terrain *pick_ocean(int depth, bool frozen) { if (terrain_type_terrain_class(pterrain) == TC_OCEAN && TERRAIN_OCEAN_DEPTH_MINIMUM <= pterrain->property[MG_OCEAN_DEPTH] - && !!frozen == terrain_has_flag(pterrain, TER_FROZEN) + && frozen == terrain_has_flag(pterrain, TER_FROZEN) && !terrain_has_flag(pterrain, TER_NOT_GENERATED)) { int match = abs(depth - pterrain->property[MG_OCEAN_DEPTH]); diff --git a/server/generator/startpos.cpp b/server/generator/startpos.cpp index 3aa2b3cc3a..b9d3cbcc50 100644 --- a/server/generator/startpos.cpp +++ b/server/generator/startpos.cpp @@ -11,10 +11,6 @@ If not, see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include // sqrt, HUGE_VAL @@ -31,7 +27,6 @@ #include "maphand.h" /* server/generator */ -#include "mapgen_topology.h" #include "mapgen_utils.h" #include "startpos.h" #include "temperature_map.h" diff --git a/server/generator/temperature_map.cpp b/server/generator/temperature_map.cpp index 960ce6a58a..e1c98a6edb 100644 --- a/server/generator/temperature_map.cpp +++ b/server/generator/temperature_map.cpp @@ -9,10 +9,6 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utilities #include "log.h" diff --git a/server/handchat.cpp b/server/handchat.cpp index 5a955a0df5..3174669923 100644 --- a/server/handchat.cpp +++ b/server/handchat.cpp @@ -11,12 +11,7 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include -#include #include // utility diff --git a/server/infrapts.cpp b/server/infrapts.cpp index cdf5869418..fcc4bd41fa 100644 --- a/server/infrapts.cpp +++ b/server/infrapts.cpp @@ -10,10 +10,6 @@ the GNU General Public License along with Freeciv21. If not, see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "map.h" diff --git a/server/maphand.cpp b/server/maphand.cpp index 76e2d398b3..c25f623625 100644 --- a/server/maphand.cpp +++ b/server/maphand.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility diff --git a/server/meta.cpp b/server/meta.cpp index 048e30dd0d..bbf5e4bbf2 100644 --- a/server/meta.cpp +++ b/server/meta.cpp @@ -15,12 +15,6 @@ #include #endif -#include -#include -#include -#include -#include - // Qt #include #include @@ -39,10 +33,7 @@ // common #include "capstr.h" #include "connection.h" -#include "dataio.h" #include "game.h" -#include "map.h" -#include "nation.h" #include "version.h" // server @@ -52,6 +43,7 @@ #include "srv_main.h" #include "meta.h" +#include "nation.h" static bool server_is_open = false; static bool persistent_meta_connection = false; diff --git a/server/mood.cpp b/server/mood.cpp index 56ab43ef6b..ff44e12590 100644 --- a/server/mood.cpp +++ b/server/mood.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "fc_types.h" #include "game.h" diff --git a/server/notify.cpp b/server/notify.cpp index 54ad0afb63..f1f28666f4 100644 --- a/server/notify.cpp +++ b/server/notify.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility diff --git a/server/plrhand.cpp b/server/plrhand.cpp index 96687e8211..fdf14b5d6a 100644 --- a/server/plrhand.cpp +++ b/server/plrhand.cpp @@ -11,15 +11,8 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - // utility #include "bitvector.h" -#include "fcintl.h" #include "log.h" #include "rand.h" #include "shared.h" @@ -31,9 +24,7 @@ #include "diptreaty.h" #include "government.h" #include "map.h" -#include "movement.h" #include "multipliers.h" -#include "nation.h" #include "packets.h" #include "player.h" #include "research.h" @@ -42,9 +33,6 @@ #include "tech.h" #include "unitlist.h" -/* common/scriptcore */ -#include "luascript_types.h" - // server #include "aiiface.h" #include "barbarian.h" @@ -57,7 +45,6 @@ #include "mood.h" #include "notify.h" #include "plrhand.h" -#include "sernet.h" #include "spacerace.h" #include "spaceship.h" #include "srv_main.h" @@ -68,8 +55,6 @@ /* server/advisors */ #include "advdata.h" -#include "autosettlers.h" - /* server/scripting */ #include "script_server.h" diff --git a/server/report.cpp b/server/report.cpp index 919c56564b..48e44060f0 100644 --- a/server/report.cpp +++ b/server/report.cpp @@ -42,7 +42,6 @@ #include "version.h" // server -#include "citytools.h" #include "plrhand.h" #include "score.h" #include "srv_main.h" diff --git a/server/rscompat.cpp b/server/rscompat.cpp index d99fc9a99a..27858e1836 100644 --- a/server/rscompat.cpp +++ b/server/rscompat.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // ANSI #ifdef HAVE_STRING_H #include diff --git a/server/rssanity.cpp b/server/rssanity.cpp index 59812dc231..cdd53d4fdc 100644 --- a/server/rssanity.cpp +++ b/server/rssanity.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "deprecations.h" #include "fcintl.h" @@ -25,7 +21,6 @@ #include "effects.h" #include "game.h" #include "government.h" -#include "map.h" #include "movement.h" #include "multipliers.h" #include "nation.h" diff --git a/server/ruleset.cpp b/server/ruleset.cpp index 514e0f32a3..a8dd99c2b2 100644 --- a/server/ruleset.cpp +++ b/server/ruleset.cpp @@ -11,16 +11,10 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include -#include #include #include -// utility #include "bitvector.h" #include "deprecations.h" #include "fcintl.h" @@ -33,7 +27,6 @@ #include "actions.h" #include "ai.h" #include "base.h" -#include "capability.h" #include "city.h" #include "effects.h" #include "extras.h" @@ -55,11 +48,8 @@ #include "style.h" #include "tech.h" #include "traderoutes.h" -#include "unit.h" -#include "unittype.h" // server -#include "citytools.h" #include "notify.h" #include "plrhand.h" #include "rscompat.h" diff --git a/server/sanitycheck.cpp b/server/sanitycheck.cpp index b9203d5bdf..70e03bf171 100644 --- a/server/sanitycheck.cpp +++ b/server/sanitycheck.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "bitvector.h" #include "log.h" @@ -34,7 +30,6 @@ #include "unitlist.h" // server -#include "citytools.h" #include "cityturn.h" // city_repair_size() #include "maphand.h" #include "plrhand.h" diff --git a/server/savegame/savecompat.cpp b/server/savegame/savecompat.cpp index a0aeddc465..cb85b66a84 100644 --- a/server/savegame/savecompat.cpp +++ b/server/savegame/savecompat.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "capability.h" #include "fcintl.h" @@ -1215,22 +1211,19 @@ static void compat_load_020600(struct loaddata *loading, // Add diplstate type order. secfile_insert_int(loading->file, DS_LAST, "savefile.diplstate_type_size"); - if (DS_LAST > 0) { - const char **modname; - int i; - int j; - - i = 0; - modname = new const char *[DS_LAST](); - - for (j = 0; j < DS_LAST; j++) { - modname[i++] = diplstate_type_name(static_cast(j)); - } - - secfile_insert_str_vec(loading->file, modname, DS_LAST, - "savefile.diplstate_type_vector"); - delete[] modname; + const char **modname; + int i; + int j; + i = 0; + modname = new const char *[DS_LAST](); + for (j = 0; j < DS_LAST; j++) { + modname[i++] = diplstate_type_name(static_cast(j)); } + secfile_insert_str_vec(loading->file, modname, DS_LAST, + "savefile.diplstate_type_vector"); + delete[] modname; + secfile_insert_str_vec(loading->file, modname, DS_LAST, + "savefile.diplstate_type_vector"); /* Fix save games from legacy freeciv versions with a bug that made it view * "Never met" as closer than "Peace" or "Alliance". */ @@ -1439,23 +1432,19 @@ static void insert_server_side_agent(struct loaddata *loading, // Add server side agent order. secfile_insert_int(loading->file, SSA_COUNT, "savefile.server_side_agent_size"); - if (SSA_COUNT > 0) { - const char **modname; - int i; - int j; - - i = 0; - modname = new const char *[SSA_COUNT](); - - for (j = 0; j < SSA_COUNT; j++) { - modname[i++] = - server_side_agent_name(static_cast(j)); - } - - secfile_insert_str_vec(loading->file, modname, SSA_COUNT, - "savefile.server_side_agent_list"); - delete[] modname; + const char **modname; + int i; + int j; + i = 0; + modname = new const char *[SSA_COUNT](); + for (j = 0; j < SSA_COUNT; j++) { + modname[i++] = server_side_agent_name(static_cast(j)); } + secfile_insert_str_vec(loading->file, modname, SSA_COUNT, + "savefile.server_side_agent_list"); + delete[] modname; + secfile_insert_str_vec(loading->file, modname, SSA_COUNT, + "savefile.server_side_agent_list"); // Insert server_side_agent unit field. player_slots_iterate(pslot) diff --git a/server/savegame/savegame2.cpp b/server/savegame/savegame2.cpp index ea568bec7c..e9d84c80f9 100644 --- a/server/savegame/savegame2.cpp +++ b/server/savegame/savegame2.cpp @@ -62,7 +62,6 @@ #include -#include #include #include #include @@ -78,12 +77,9 @@ #include "registry.h" #include "shared.h" #include "support.h" // bool type -#include "timing.h" - // common #include "achievements.h" #include "ai.h" -#include "bitvector.h" #include "capability.h" #include "citizens.h" #include "city.h" @@ -120,8 +116,6 @@ #include "settings.h" #include "spacerace.h" #include "srv_main.h" -#include "stdinhand.h" -#include "techtools.h" #include "unittools.h" /* server/advisors */ @@ -130,7 +124,6 @@ #include "infracache.h" /* server/generator */ -#include "mapgen.h" #include "mapgen_utils.h" /* server/scripting */ @@ -141,6 +134,7 @@ #include "difficulty.h" #include "savegame2.h" +#include "techtools.h" extern bool sg_success; @@ -3189,7 +3183,7 @@ static void sg_load_player_main(struct loaddata *loading, struct player *plr) "Undefined value '%c' within '%s.structure'.", st[i], prefix) - if (!(st[i] == '0')) + if (st[i] != '0') { BV_SET(ship->structure, i); } diff --git a/server/savegame/savegame3.cpp b/server/savegame/savegame3.cpp index fee9017349..6eab6b8048 100644 --- a/server/savegame/savegame3.cpp +++ b/server/savegame/savegame3.cpp @@ -68,7 +68,6 @@ #include #include -#include #include #include #include @@ -89,8 +88,6 @@ // common #include "achievements.h" #include "ai.h" -#include "bitvector.h" -#include "capability.h" #include "citizens.h" #include "city.h" #include "game.h" @@ -109,7 +106,6 @@ #include "version.h" // server -#include "barbarian.h" #include "citizenshand.h" #include "citytools.h" #include "cityturn.h" @@ -122,11 +118,9 @@ #include "ruleset.h" #include "sanitycheck.h" #include "savecompat.h" -#include "score.h" #include "settings.h" #include "spacerace.h" #include "srv_main.h" -#include "stdinhand.h" #include "techtools.h" #include "unittools.h" @@ -136,7 +130,6 @@ #include "infracache.h" /* server/generator */ -#include "mapgen.h" #include "mapgen_utils.h" /* server/scripting */ @@ -146,6 +139,7 @@ #include "aitraits.h" #include "difficulty.h" +#include "capability.h" #include "savegame3.h" extern bool sg_success; diff --git a/server/savegame/savemain.cpp b/server/savegame/savemain.cpp index 39443293b5..a4710c8170 100644 --- a/server/savegame/savemain.cpp +++ b/server/savegame/savemain.cpp @@ -16,7 +16,6 @@ #endif // Qt -#include #include #include diff --git a/server/score.cpp b/server/score.cpp index bb99ccf200..f4965ba2e4 100644 --- a/server/score.cpp +++ b/server/score.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include #include diff --git a/server/scripting/api_server_base.cpp b/server/scripting/api_server_base.cpp index b93c5c1c2e..f7aff42c60 100644 --- a/server/scripting/api_server_base.cpp +++ b/server/scripting/api_server_base.cpp @@ -8,10 +8,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - /* common/scriptcore */ #include "luascript.h" diff --git a/server/scripting/api_server_edit.cpp b/server/scripting/api_server_edit.cpp index 86009c91f1..068756f63e 100644 --- a/server/scripting/api_server_edit.cpp +++ b/server/scripting/api_server_edit.cpp @@ -8,20 +8,14 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "rand.h" // common -#include "map.h" #include "movement.h" #include "research.h" #include "unittype.h" - /* common/scriptcore */ #include "api_game_find.h" #include "luascript.h" @@ -39,9 +33,6 @@ #include "techtools.h" #include "unittools.h" -/* server/scripting */ -#include "script_server.h" - /* server/generator */ #include "mapgen_utils.h" diff --git a/server/scripting/api_server_game_methods.cpp b/server/scripting/api_server_game_methods.cpp index 597033c51e..e4dc283c6d 100644 --- a/server/scripting/api_server_game_methods.cpp +++ b/server/scripting/api_server_game_methods.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" diff --git a/server/scripting/api_server_luadata.cpp b/server/scripting/api_server_luadata.cpp index dcd5d3354c..12ea372ee8 100644 --- a/server/scripting/api_server_luadata.cpp +++ b/server/scripting/api_server_luadata.cpp @@ -8,10 +8,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "registry_ini.h" diff --git a/server/scripting/api_server_notify.cpp b/server/scripting/api_server_notify.cpp index d2ee33acea..28f6a737f2 100644 --- a/server/scripting/api_server_notify.cpp +++ b/server/scripting/api_server_notify.cpp @@ -8,10 +8,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "featured_text.h" #include "research.h" diff --git a/server/scripting/script_fcdb.cpp b/server/scripting/script_fcdb.cpp index 5661e37e8b..f709ef4a8c 100644 --- a/server/scripting/script_fcdb.cpp +++ b/server/scripting/script_fcdb.cpp @@ -16,10 +16,6 @@ /* dependencies/lua */ #include "lua.h" -#include "lualib.h" - -/* dependencies/tolua */ -#include "tolua.h" // utility #include "log.h" diff --git a/server/scripting/script_server.cpp b/server/scripting/script_server.cpp index a494469b86..c722b3e884 100644 --- a/server/scripting/script_server.cpp +++ b/server/scripting/script_server.cpp @@ -8,12 +8,7 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include -#include #include #include diff --git a/server/sernet.cpp b/server/sernet.cpp index 6345d49f62..d814b8e30c 100644 --- a/server/sernet.cpp +++ b/server/sernet.cpp @@ -15,24 +15,16 @@ #include #endif -#include -#include -#include #include -#include // Qt #include -#include #include #include #include #include // utility -#include "capability.h" -#include "fciconv.h" -#include "fcintl.h" #include "log.h" #include "shared.h" #include "support.h" @@ -49,15 +41,13 @@ // server #include "aiiface.h" -#include "auth.h" #include "connecthand.h" -#include "console.h" -#include "meta.h" #include "plrhand.h" #include "srv_main.h" #include "stdinhand.h" #include "voting.h" +#include "meta.h" #include "sernet.h" static struct connection connections[MAX_NUM_CONNECTIONS]; diff --git a/server/spacerace.cpp b/server/spacerace.cpp index 978a440ca2..9bccef26d8 100644 --- a/server/spacerace.cpp +++ b/server/spacerace.cpp @@ -11,15 +11,9 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include // utility #include "fcintl.h" -#include "log.h" #include "shared.h" // common @@ -33,8 +27,6 @@ // server #include "notify.h" #include "plrhand.h" -#include "srv_main.h" - #include "spacerace.h" /** diff --git a/server/srv_log.cpp b/server/srv_log.cpp index ba02cf8502..314b7a2fd5 100644 --- a/server/srv_log.cpp +++ b/server/srv_log.cpp @@ -11,15 +11,8 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - // utility #include "shared.h" -#include "support.h" #include "timing.h" // common @@ -32,7 +25,6 @@ // server #include "notify.h" -#include "srv_main.h" /* server/advisors */ #include "advdata.h" diff --git a/server/srv_main.cpp b/server/srv_main.cpp index 610074eea1..c9f0aa3e35 100644 --- a/server/srv_main.cpp +++ b/server/srv_main.cpp @@ -15,12 +15,7 @@ #include #endif -#include -#include -#include #include -#include - // Qt #include #include @@ -29,12 +24,10 @@ // utility #include "bitvector.h" #include "bugs.h" -#include "capability.h" #include "fciconv.h" #include "fcintl.h" #include "log.h" #include "rand.h" -#include "registry.h" #include "support.h" #include "timing.h" @@ -44,7 +37,6 @@ // common #include "achievements.h" #include "calendar.h" -#include "capstr.h" #include "city.h" #include "culture.h" #include "dataio.h" @@ -52,7 +44,6 @@ #include "events.h" #include "fc_interface.h" #include "game.h" -#include "government.h" #include "map.h" #include "mapimg.h" #include "multipliers.h" @@ -80,7 +71,6 @@ #include "edithand.h" #include "fcdb.h" #include "gamehand.h" -#include "handchat.h" #include "maphand.h" #include "meta.h" #include "notify.h" @@ -95,7 +85,6 @@ #include "srv_log.h" #include "stdinhand.h" #include "techtools.h" -#include "unithand.h" #include "unittools.h" #include "voting.h" @@ -110,7 +99,6 @@ #include "savemain.h" /* server/scripting */ -#include "luascript_types.h" #include "script_server.h" /* server/generator */ diff --git a/server/stdinhand.cpp b/server/stdinhand.cpp index dd8746118a..6ae08ddf00 100644 --- a/server/stdinhand.cpp +++ b/server/stdinhand.cpp @@ -39,9 +39,6 @@ #include "timing.h" // common -#include "capability.h" -#include "events.h" -#include "fc_types.h" // LINE_BREAK #include "featured_text.h" #include "game.h" #include "map.h" @@ -56,20 +53,13 @@ // server #include "aiiface.h" -#include "citytools.h" -#include "connecthand.h" #include "diplhand.h" #include "gamehand.h" -#include "mapgen.h" #include "maphand.h" #include "meta.h" #include "notify.h" #include "plrhand.h" -#include "report.h" -#include "ruleset.h" #include "sanitycheck.h" -#include "score.h" -#include "sernet.h" #include "settings.h" #include "srv_log.h" #include "srv_main.h" @@ -85,8 +75,9 @@ // ai #include "difficulty.h" -#include "handicaps.h" +#include "connecthand.h" +#include "ruleset.h" #include "stdinhand.h" #define OPTION_NAME_SPACE 25 @@ -3356,20 +3347,15 @@ static bool observe_command(struct connection *caller, char *str, bool check) /* if the connection is already attached to a player, * unattach and cleanup old player (rename, remove, etc) */ - if (true) { - char name[MAX_LEN_NAME]; - - if (pplayer) { - // if pconn->playing is removed, we'll lose pplayer - sz_strlcpy(name, player_name(pplayer)); - } - - connection_detach(pconn, true); - - if (pplayer) { - // find pplayer again, the pointer might have been changed - pplayer = player_by_name(name); - } + char name[MAX_LEN_NAME]; + if (pplayer) { + // if pconn->playing is removed, we'll lose pplayer + sz_strlcpy(name, player_name(pplayer)); + } + connection_detach(pconn, true); + if (pplayer) { + // find pplayer again, the pointer might have been changed + pplayer = player_by_name(name); } // attach pconn to new player as an observer or as global observer diff --git a/server/techtools.cpp b/server/techtools.cpp index 1ddc2b5796..fa7bde0731 100644 --- a/server/techtools.cpp +++ b/server/techtools.cpp @@ -8,15 +8,10 @@ _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. :X: received a copy of the GNU General Public License along with :X: Freeciv21. If not, see https://www.gnu.org/licenses/. ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "fcintl.h" #include "log.h" #include "rand.h" -#include "shared.h" #include "support.h" // common diff --git a/server/unithand.cpp b/server/unithand.cpp index 535382c84e..9e904fb8f7 100644 --- a/server/unithand.cpp +++ b/server/unithand.cpp @@ -11,11 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include #include #include @@ -49,7 +44,6 @@ // server #include "actiontools.h" -#include "barbarian.h" #include "citizenshand.h" #include "citytools.h" #include "cityturn.h" @@ -59,17 +53,13 @@ #include "plrhand.h" #include "sanitycheck.h" #include "spacerace.h" -#include "srv_main.h" #include "techtools.h" #include "unittools.h" -/* server/advisors */ -#include "autoexplorer.h" -#include "autosettlers.h" - /* server/scripting */ #include "script_server.h" +#include "autosettlers.h" #include "unithand.h" // An explanation why an action isn't enabled. @@ -1208,7 +1198,7 @@ static struct ane_expl *expl_act_not_enabl(struct unit *punit, && !utype_can_do_act_when_ustate(unit_type_get(punit), act_id, USP_TRANSPORTING, true)) { explnat->kind = ANEK_IS_TRANSPORTING; - } else if (!(0 < get_transporter_occupancy(punit)) + } else if (0 >= get_transporter_occupancy(punit) && !utype_can_do_act_when_ustate(unit_type_get(punit), act_id, USP_TRANSPORTING, false)) { explnat->kind = ANEK_IS_NOT_TRANSPORTING; diff --git a/server/unittools.cpp b/server/unittools.cpp index be8afdafee..ccda5f7ad5 100644 --- a/server/unittools.cpp +++ b/server/unittools.cpp @@ -11,13 +11,8 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include -#include #include #include @@ -48,10 +43,6 @@ #include "unitlist.h" #include "unittype.h" -/* common/scriptcore */ -#include "luascript_signal.h" -#include "luascript_types.h" - // aicore #include "path_finding.h" #include "pf_tools.h" @@ -62,11 +53,8 @@ // server #include "actiontools.h" #include "aiiface.h" -#include "barbarian.h" #include "citytools.h" #include "cityturn.h" -#include "diplhand.h" -#include "gamehand.h" #include "maphand.h" #include "notify.h" #include "plrhand.h" @@ -118,6 +106,7 @@ struct autoattack_prob { #define SPECLIST_TAG autoattack_prob #define SPECLIST_TYPE struct autoattack_prob +#include "gamehand.h" #include "speclist.h" #define autoattack_prob_list_iterate_safe(autoattack_prob_list, _aap_, \ diff --git a/server/voting.cpp b/server/voting.cpp index d6955cf65b..ad9cf4386c 100644 --- a/server/voting.cpp +++ b/server/voting.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility @@ -23,7 +19,6 @@ #include "support.h" // common -#include "capability.h" #include "connection.h" #include "packets.h" #include "player.h" diff --git a/tools/civmanual.cpp b/tools/civmanual.cpp index ca7edec0ef..06ec84ca3b 100644 --- a/tools/civmanual.cpp +++ b/tools/civmanual.cpp @@ -14,10 +14,6 @@ #endif #include -#include -#include -#include -#include #include #include @@ -27,7 +23,6 @@ // utility #include "astring.h" -#include "capability.h" #include "fciconv.h" #include "fcintl.h" #include "log.h" @@ -50,21 +45,14 @@ #include "version.h" // server -#include "citytools.h" #include "commands.h" -#include "connecthand.h" -#include "console.h" -#include "diplhand.h" -#include "gamehand.h" -#include "plrhand.h" -#include "report.h" #include "ruleset.h" #include "sernet.h" #include "settings.h" #include "srv_main.h" -#include "stdinhand.h" /* tools/shared */ +#include "console.h" #include "tools_fc_interface.h" enum manuals { diff --git a/tools/fcmp/download.cpp b/tools/fcmp/download.cpp index 587c511f3f..bec4d3626d 100644 --- a/tools/fcmp/download.cpp +++ b/tools/fcmp/download.cpp @@ -30,7 +30,6 @@ // utility #include "capability.h" #include "fcintl.h" -#include "log.h" #include "netfile.h" #include "registry.h" diff --git a/tools/fcmp/modinst.cpp b/tools/fcmp/modinst.cpp index c98e50d67d..646cd8732e 100644 --- a/tools/fcmp/modinst.cpp +++ b/tools/fcmp/modinst.cpp @@ -21,9 +21,7 @@ #include "fciconv.h" #include "fcintl.h" #include "log.h" -#include "net_types.h" #include "rand.h" -#include "registry.h" #include "support.h" // common diff --git a/tools/fcmp/mpcli.cpp b/tools/fcmp/mpcli.cpp index 06e7f00a86..7909bdbf32 100644 --- a/tools/fcmp/mpcli.cpp +++ b/tools/fcmp/mpcli.cpp @@ -22,9 +22,7 @@ #include // utility -#include "fciconv.h" #include "fcintl.h" -#include "log.h" // common #include "version.h" diff --git a/tools/fcmp/mpcmdline.cpp b/tools/fcmp/mpcmdline.cpp index 169d767861..c954c56351 100644 --- a/tools/fcmp/mpcmdline.cpp +++ b/tools/fcmp/mpcmdline.cpp @@ -11,18 +11,11 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include // utility -#include "fciconv.h" #include "fcintl.h" -#include "support.h" - // common #include "version.h" diff --git a/tools/fcmp/mpdb.cpp b/tools/fcmp/mpdb.cpp index b13425bbaa..e04d32432d 100644 --- a/tools/fcmp/mpdb.cpp +++ b/tools/fcmp/mpdb.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility diff --git a/tools/fcmp/mpgui_qt.cpp b/tools/fcmp/mpgui_qt.cpp index bcf19ef48e..aa6965030e 100644 --- a/tools/fcmp/mpgui_qt.cpp +++ b/tools/fcmp/mpgui_qt.cpp @@ -27,13 +27,9 @@ #include #include #include -#include // utility -#include "fciconv.h" #include "fcintl.h" -#include "log.h" - // common #include "version.h" diff --git a/tools/fcmp/mpgui_qt_worker.cpp b/tools/fcmp/mpgui_qt_worker.cpp index 99e27418b7..1185dd5439 100644 --- a/tools/fcmp/mpgui_qt_worker.cpp +++ b/tools/fcmp/mpgui_qt_worker.cpp @@ -12,24 +12,15 @@ \____/ ********************************************************/ #ifdef HAVE_CONFIG_H -#include #endif // Qt #include -#include #include #include -#include -#include -#include -#include // utility #include "fcintl.h" -#include "log.h" -#include "registry.h" - // modinst #include "download.h" #include "mpgui_qt.h" diff --git a/tools/ruledit/conversion_log.cpp b/tools/ruledit/conversion_log.cpp index 0768a404ae..8400dec2be 100644 --- a/tools/ruledit/conversion_log.cpp +++ b/tools/ruledit/conversion_log.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include diff --git a/tools/ruledit/edit_utype.cpp b/tools/ruledit/edit_utype.cpp index 470c3dda4e..f715c4ff02 100644 --- a/tools/ruledit/edit_utype.cpp +++ b/tools/ruledit/edit_utype.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include diff --git a/tools/ruledit/effect_edit.cpp b/tools/ruledit/effect_edit.cpp index a18febbddb..1900e34dab 100644 --- a/tools/ruledit/effect_edit.cpp +++ b/tools/ruledit/effect_edit.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include @@ -32,8 +28,6 @@ // ruledit #include "ruledit.h" #include "ruledit_qt.h" -#include "validity.h" - #include "effect_edit.h" /** diff --git a/tools/ruledit/req_edit.cpp b/tools/ruledit/req_edit.cpp index 34c89a2812..f3d4004e27 100644 --- a/tools/ruledit/req_edit.cpp +++ b/tools/ruledit/req_edit.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include diff --git a/tools/ruledit/req_vec_fix.cpp b/tools/ruledit/req_vec_fix.cpp index 6cb086ce4e..4c0880d640 100644 --- a/tools/ruledit/req_vec_fix.cpp +++ b/tools/ruledit/req_vec_fix.cpp @@ -18,7 +18,6 @@ #include #include #include -#include // ruledit #include "ruledit_qt.h" diff --git a/tools/ruledit/requirers_dlg.cpp b/tools/ruledit/requirers_dlg.cpp index 4c3dea5f91..882ac7c361 100644 --- a/tools/ruledit/requirers_dlg.cpp +++ b/tools/ruledit/requirers_dlg.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include diff --git a/tools/ruledit/requirers_dlg.h b/tools/ruledit/requirers_dlg.h index 57b20d4f19..6761a3b720 100644 --- a/tools/ruledit/requirers_dlg.h +++ b/tools/ruledit/requirers_dlg.h @@ -39,4 +39,4 @@ private slots: void close_now(); }; -#endif // FC__REQUIRERS_DIALOG_H +#endif // FC__REQUIRERS_DLG_H diff --git a/tools/ruledit/ruledit.cpp b/tools/ruledit/ruledit.cpp index edf23ed41c..216f567c01 100644 --- a/tools/ruledit/ruledit.cpp +++ b/tools/ruledit/ruledit.cpp @@ -18,7 +18,6 @@ // ANSI #include -#include #ifdef FREECIV_MSWINDOWS #include @@ -32,7 +31,6 @@ #include "fciconv.h" #include "fcintl.h" #include "log.h" -#include "registry.h" // common #include "fc_interface.h" diff --git a/tools/ruledit/tab_building.cpp b/tools/ruledit/tab_building.cpp index b42069558c..ec88e6f9ef 100644 --- a/tools/ruledit/tab_building.cpp +++ b/tools/ruledit/tab_building.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include @@ -22,11 +18,9 @@ #include #include #include -#include // utility #include "fcintl.h" -#include "log.h" // common #include "game.h" diff --git a/tools/ruledit/tab_enablers.cpp b/tools/ruledit/tab_enablers.cpp index df024ba5d9..beb35b59e8 100644 --- a/tools/ruledit/tab_enablers.cpp +++ b/tools/ruledit/tab_enablers.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include @@ -22,7 +18,6 @@ #include #include #include -#include #include // utility @@ -36,8 +31,6 @@ // ruledit #include "ruledit.h" #include "ruledit_qt.h" -#include "validity.h" - #include "tab_enablers.h" class fix_enabler_item : public req_vec_fix_item { diff --git a/tools/ruledit/tab_extras.cpp b/tools/ruledit/tab_extras.cpp index bdd75fd69c..625f56b41d 100644 --- a/tools/ruledit/tab_extras.cpp +++ b/tools/ruledit/tab_extras.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include @@ -22,11 +18,9 @@ #include #include #include -#include // utility #include "fcintl.h" -#include "log.h" // common #include "extras.h" diff --git a/tools/ruledit/tab_good.cpp b/tools/ruledit/tab_good.cpp index 6965e9fd2f..f0f6b09faf 100644 --- a/tools/ruledit/tab_good.cpp +++ b/tools/ruledit/tab_good.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include diff --git a/tools/ruledit/tab_gov.cpp b/tools/ruledit/tab_gov.cpp index e53142ffad..56cc545a77 100644 --- a/tools/ruledit/tab_gov.cpp +++ b/tools/ruledit/tab_gov.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include @@ -22,11 +18,9 @@ #include #include #include -#include // utility #include "fcintl.h" -#include "log.h" // common #include "game.h" diff --git a/tools/ruledit/tab_misc.cpp b/tools/ruledit/tab_misc.cpp index a9b766f312..cd9060c026 100644 --- a/tools/ruledit/tab_misc.cpp +++ b/tools/ruledit/tab_misc.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include @@ -26,11 +22,8 @@ // utility #include "fcintl.h" -#include "log.h" -#include "registry.h" // common -#include "achievements.h" #include "game.h" #include "government.h" #include "multipliers.h" @@ -45,6 +38,7 @@ #include "ruledit_qt.h" #include "rulesave.h" +#include "achievements.h" #include "tab_misc.h" /** diff --git a/tools/ruledit/tab_multiplier.cpp b/tools/ruledit/tab_multiplier.cpp index e4fc1f340d..42dc894fc8 100644 --- a/tools/ruledit/tab_multiplier.cpp +++ b/tools/ruledit/tab_multiplier.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include @@ -26,7 +22,6 @@ // utility #include "fcintl.h" -#include "log.h" // common #include "game.h" diff --git a/tools/ruledit/tab_nation.cpp b/tools/ruledit/tab_nation.cpp index 29c32f36c2..fe2215adfe 100644 --- a/tools/ruledit/tab_nation.cpp +++ b/tools/ruledit/tab_nation.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include diff --git a/tools/ruledit/tab_tech.cpp b/tools/ruledit/tab_tech.cpp index fa18adca7b..098d5b9e9e 100644 --- a/tools/ruledit/tab_tech.cpp +++ b/tools/ruledit/tab_tech.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include diff --git a/tools/ruledit/tab_terrains.cpp b/tools/ruledit/tab_terrains.cpp index a2983faee4..c1dfbd1c1c 100644 --- a/tools/ruledit/tab_terrains.cpp +++ b/tools/ruledit/tab_terrains.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include @@ -26,7 +22,6 @@ // utility #include "fcintl.h" -#include "log.h" // common #include "game.h" diff --git a/tools/ruledit/tab_unit.cpp b/tools/ruledit/tab_unit.cpp index fad421ee50..b584d43a6e 100644 --- a/tools/ruledit/tab_unit.cpp +++ b/tools/ruledit/tab_unit.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // Qt #include #include @@ -26,7 +22,6 @@ // utility #include "fcintl.h" -#include "log.h" // common #include "game.h" diff --git a/tools/ruledit/univ_value.cpp b/tools/ruledit/univ_value.cpp index 8e1c435ae2..69f0307a8f 100644 --- a/tools/ruledit/univ_value.cpp +++ b/tools/ruledit/univ_value.cpp @@ -11,16 +11,11 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "achievements.h" #include "game.h" #include "government.h" #include "nation.h" -#include "requirements.h" #include "server_settings.h" #include "specialist.h" #include "style.h" diff --git a/tools/ruledit/validity.cpp b/tools/ruledit/validity.cpp index 29670e5b2c..7f0a2a768d 100644 --- a/tools/ruledit/validity.cpp +++ b/tools/ruledit/validity.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "support.h" diff --git a/tools/ruleup.cpp b/tools/ruleup.cpp index 2c86d28d6c..abbd7bd14d 100644 --- a/tools/ruleup.cpp +++ b/tools/ruleup.cpp @@ -15,8 +15,6 @@ #include #endif -#include - #ifdef FREECIV_MSWINDOWS #include #endif diff --git a/tools/ruleutil/comments.cpp b/tools/ruleutil/comments.cpp index 8b8fefeeb9..96efc228d4 100644 --- a/tools/ruleutil/comments.cpp +++ b/tools/ruleutil/comments.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "registry.h" #include "section_file.h" diff --git a/tools/ruleutil/rulesave.cpp b/tools/ruleutil/rulesave.cpp index 1d69ededc8..c9ddc40e5e 100644 --- a/tools/ruleutil/rulesave.cpp +++ b/tools/ruleutil/rulesave.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "registry.h" diff --git a/tools/shared/tools_fc_interface.cpp b/tools/shared/tools_fc_interface.cpp index 9f8a5d1e3e..8b419074e8 100644 --- a/tools/shared/tools_fc_interface.cpp +++ b/tools/shared/tools_fc_interface.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // common #include "fc_interface.h" diff --git a/utility/bitvector.cpp b/utility/bitvector.cpp index c663c03cc2..4f93a675b5 100644 --- a/utility/bitvector.cpp +++ b/utility/bitvector.cpp @@ -11,22 +11,11 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include -#include -#include #include -#include -#include // utility -#include "fciconv.h" #include "fcintl.h" -#include "rand.h" - #include "bitvector.h" /* bv_* - static bitvectors; used for data which where the length is diff --git a/utility/capability.cpp b/utility/capability.cpp index ccccd0b9e9..6a5da8db2f 100644 --- a/utility/capability.cpp +++ b/utility/capability.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility diff --git a/utility/distribute.cpp b/utility/distribute.cpp index 2d1617cec2..cc8a12546b 100644 --- a/utility/distribute.cpp +++ b/utility/distribute.cpp @@ -9,10 +9,6 @@ see https://www.gnu.org/licenses/. **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility #include "log.h" // fc_assert diff --git a/utility/fcbacktrace.cpp b/utility/fcbacktrace.cpp index 133e94f9b9..e8cf2b02f9 100644 --- a/utility/fcbacktrace.cpp +++ b/utility/fcbacktrace.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif // HAVE_CONFIG_H - #include #include @@ -24,8 +20,6 @@ // utility #include "log.h" -#include "shared.h" - #include "fcbacktrace.h" // We don't want backtrace-spam to testmatic logs diff --git a/utility/fciconv.cpp b/utility/fciconv.cpp index 5bc2b6edd7..57d0aad64d 100644 --- a/utility/fciconv.cpp +++ b/utility/fciconv.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include #include @@ -25,7 +24,6 @@ // utility #include "fciconv.h" #include "fcintl.h" -#include "log.h" #include "support.h" static QTextCodec *localCodec; diff --git a/utility/genhash.cpp b/utility/genhash.cpp index 5b75be86e7..f7781e7439 100644 --- a/utility/genhash.cpp +++ b/utility/genhash.cpp @@ -55,10 +55,6 @@ necessary by making and populating a new table. ****************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility diff --git a/utility/genlist.cpp b/utility/genlist.cpp index 6abfa1557d..e23aaac19d 100644 --- a/utility/genlist.cpp +++ b/utility/genlist.cpp @@ -11,18 +11,12 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include // utility #include "fcthread.h" #include "log.h" #include "rand.h" -#include "shared.h" // array_shuffle - #include "genlist.h" /** diff --git a/utility/inputfile.cpp b/utility/inputfile.cpp index c3827960fc..df638ca3d9 100644 --- a/utility/inputfile.cpp +++ b/utility/inputfile.cpp @@ -63,14 +63,7 @@ ***********************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include -#include -#include - // Qt #include diff --git a/utility/iterator.cpp b/utility/iterator.cpp index cd19b0c657..fd477d32e9 100644 --- a/utility/iterator.cpp +++ b/utility/iterator.cpp @@ -11,13 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - -// utility -#include "shared.h" - #include "iterator.h" /** diff --git a/utility/log.cpp b/utility/log.cpp index db3e4546fc..cef07da24b 100644 --- a/utility/log.cpp +++ b/utility/log.cpp @@ -15,16 +15,10 @@ #include #endif -#include -#include -#include -#include -#include #include // Qt -#include #include #include #include @@ -36,13 +30,8 @@ #endif // utility -#include "fciconv.h" #include "fcintl.h" -#include "fcthread.h" #include "shared.h" -#include "support.h" - -#include "deprecations.h" #include "log.h" Q_LOGGING_CATEGORY(assert_category, "freeciv.assert") diff --git a/utility/rand.cpp b/utility/rand.cpp index 2123b67f5a..32e3b98e36 100644 --- a/utility/rand.cpp +++ b/utility/rand.cpp @@ -16,10 +16,6 @@ C++ standard library. *************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "log.h" diff --git a/utility/registry.cpp b/utility/registry.cpp index c81ef54b9a..143425a936 100644 --- a/utility/registry.cpp +++ b/utility/registry.cpp @@ -11,10 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "registry.h" /** diff --git a/utility/registry_ini.cpp b/utility/registry_ini.cpp index 8ea76772d5..f2602aa836 100644 --- a/utility/registry_ini.cpp +++ b/utility/registry_ini.cpp @@ -147,10 +147,6 @@ - The number of entries is fixed when the hash table is built. - Now uses hash.c **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // KArchive #include diff --git a/utility/section_file.cpp b/utility/section_file.cpp index f5cfa6020d..fb780d83ec 100644 --- a/utility/section_file.cpp +++ b/utility/section_file.cpp @@ -10,10 +10,6 @@ /o) (o/\ \_ General Public License along with Freeciv21. \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - // utility #include "registry.h" #include "section_file.h" diff --git a/utility/shared.cpp b/utility/shared.cpp index b8ed748b81..5ec055b974 100644 --- a/utility/shared.cpp +++ b/utility/shared.cpp @@ -15,14 +15,12 @@ #include #endif -#include #include #include #include #include #include #include -#include #ifdef FREECIV_MSWINDOWS #define ALWAYS_ROOT @@ -1407,7 +1405,7 @@ bool make_dir(const char *pathname) auto str = QString::fromUtf8(path); // We can always create a directory with an empty name -- it's the current // folder. - auto r = str.isEmpty() ? true : QDir().mkpath(str); + auto r = str.isEmpty() || QDir().mkpath(str); delete[] path; return r; } diff --git a/utility/support.cpp b/utility/support.cpp index e7296607ae..16585fec93 100644 --- a/utility/support.cpp +++ b/utility/support.cpp @@ -41,9 +41,6 @@ #include #endif -#include -#include -#include #include // ceil() #include #include @@ -69,7 +66,6 @@ // utility #include "fciconv.h" -#include "fcintl.h" #include "log.h" #include "support.h" diff --git a/utility/timing.cpp b/utility/timing.cpp index 5672d6aa90..21e432269b 100644 --- a/utility/timing.cpp +++ b/utility/timing.cpp @@ -11,9 +11,6 @@ \_____/ / If not, see https://www.gnu.org/licenses/. \____/ ********************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif #include "timing.h" #include