Skip to content

Commit

Permalink
Simplify Conditionals and remove unused include directives
Browse files Browse the repository at this point in the history
  • Loading branch information
psampathkumar committed Jun 26, 2022
1 parent d452418 commit 19305b2
Show file tree
Hide file tree
Showing 275 changed files with 130 additions and 1,558 deletions.
4 changes: 0 additions & 4 deletions ai/aitraits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
\_____/ / If not, see https://www.gnu.org/licenses/.
\____/ ********************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

// utility
#include "rand.h"

Expand Down
4 changes: 0 additions & 4 deletions ai/classic/classicai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
\_____/ / If not, see https://www.gnu.org/licenses/.
\____/ ********************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

// common
#include "ai.h"
#include "player.h"
Expand Down
9 changes: 1 addition & 8 deletions ai/default/aiair.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
see https://www.gnu.org/licenses/.
**************************************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

// utility
#include "log.h"

Expand All @@ -26,7 +22,6 @@
#include "unit.h"

// server
#include "citytools.h"
#include "maphand.h"
#include "srv_log.h"
#include "unithand.h"
Expand All @@ -40,13 +35,11 @@
#include "handicaps.h"

/* ai/default */
#include "aiair.h"
#include "ailog.h"
#include "aiplayer.h"
#include "aitools.h"
#include "aiunit.h"
#include "daicity.h"

#include "aiair.h"

class PFPath;
/**
Expand Down
5 changes: 0 additions & 5 deletions ai/default/aidata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@
see https://www.gnu.org/licenses/.
**************************************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

// common
#include "game.h"
#include "government.h"
#include "map.h"
#include "multipliers.h"
#include "research.h"

Expand Down
11 changes: 1 addition & 10 deletions ai/default/aidiplomat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
see https://www.gnu.org/licenses/.
**************************************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

// utility
#include "bitvector.h"
#include "log.h"
Expand All @@ -38,26 +34,24 @@
#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"

/* ai/default */
#include "aidata.h"
#include "aidiplomat.h"
#include "aiguard.h"
#include "aihand.h"
#include "ailog.h"
Expand All @@ -66,9 +60,6 @@
#include "aiunit.h"
#include "daiactions.h"
#include "daicity.h"
#include "daimilitary.h"

#include "aidiplomat.h"

#define LOG_DIPLOMAT LOG_DEBUG
#define LOG_DIPLOMAT_BUILD LOG_DEBUG
Expand Down
5 changes: 0 additions & 5 deletions ai/default/aiferry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
see https://www.gnu.org/licenses/.
**************************************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

// utility
#include "log.h"

Expand All @@ -29,7 +25,6 @@
/* server/advisors */
#include "advgoto.h"
#include "autoexplorer.h"
#include "autosettlers.h"

// server
#include "hand_gen.h"
Expand Down
5 changes: 0 additions & 5 deletions ai/default/aiguard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
see https://www.gnu.org/licenses/.
**************************************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

// utility
#include "log.h"

Expand All @@ -26,7 +22,6 @@
// ai
#include "ailog.h"
#include "aiplayer.h"
#include "aitools.h"
#include "aiunit.h"

#include "aiguard.h"
Expand Down
8 changes: 0 additions & 8 deletions ai/default/aihand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
\_____/ / If not, see https://www.gnu.org/licenses/.
\____/ ********************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

// utility
#include "distribute.h"
#include "log.h"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
6 changes: 0 additions & 6 deletions ai/default/aihunt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
see https://www.gnu.org/licenses/.
**************************************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

// utility
#include "bitvector.h"
#include "log.h"
Expand All @@ -32,7 +28,6 @@
#include "pf_tools.h"

// server
#include "citytools.h"
#include "srv_log.h"
#include "unithand.h"
#include "unittools.h"
Expand All @@ -41,7 +36,6 @@
#include "advdata.h"
#include "advgoto.h"
#include "advtools.h"
#include "autosettlers.h"

// ai
#include "handicaps.h"
Expand Down
6 changes: 0 additions & 6 deletions ai/default/ailog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
see https://www.gnu.org/licenses/.
**************************************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

#include <cstdarg>

// common
#include "map.h"
#include "nation.h"
Expand Down
8 changes: 0 additions & 8 deletions ai/default/aiparatrooper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <fc_config.h>
#endif

// utility
#include "log.h"

Expand All @@ -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"
Expand Down
5 changes: 0 additions & 5 deletions ai/default/aiplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,11 @@
\_____/ / If not, see https://www.gnu.org/licenses/.
\____/ ********************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

// common
#include "ai.h"
#include "city.h"
#include "game.h"
#include "multipliers.h"
#include "unit.h"
// server
#include "citytools.h"

Expand Down
8 changes: 0 additions & 8 deletions ai/default/aisettler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <fc_config.h>
#endif

#include <QHash>
#include <cstdio>
#include <cstring>

// utility
#include "log.h"
#include "support.h"
#include "timing.h"

Expand All @@ -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"
Expand Down
4 changes: 0 additions & 4 deletions ai/default/aitech.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
\_____/ / If not, see https://www.gnu.org/licenses/.
\____/ ********************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

#include <cstring>

// utility
Expand Down
11 changes: 1 addition & 10 deletions ai/default/aitools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
\_____/ / If not, see https://www.gnu.org/licenses/.
\____/ ********************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

// utility
#include "bitvector.h"
#include "log.h"
Expand All @@ -38,11 +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"
Expand All @@ -52,7 +45,6 @@
#include "advdata.h"
#include "advgoto.h"
#include "advtools.h"
#include "autosettlers.h"
#include "infracache.h" // adv_city

// ai
Expand All @@ -65,11 +57,10 @@
#include "ailog.h"
#include "aiplayer.h"
#include "aitech.h"
#include "aitools.h"
#include "aiunit.h"
#include "daimilitary.h"

#include "aitools.h"

class PFPath;
/**
Return the (untranslated) rule name of the ai_unit_task.
Expand Down
11 changes: 0 additions & 11 deletions ai/default/aiunit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,8 @@
\_____/ / If not, see https://www.gnu.org/licenses/.
\____/ ********************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

#include <cmath>

// utility
#include "bitvector.h"
#include "log.h"
#include "rand.h"
#include "registry.h"
#include "shared.h"
Expand All @@ -46,12 +39,9 @@
// 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"
Expand All @@ -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"
Expand Down
Loading

0 comments on commit 19305b2

Please sign in to comment.