Skip to content

Commit

Permalink
IWYU 20190629 (#31990)
Browse files Browse the repository at this point in the history
* Add IWYU pragma: keep

* Run IWYU and astyle

* Run IWYU a second time

* Prevent #include <cxxabi.h>

Unclear why IWYU thinks this is needed.  It isn't, and it causes
problems on Visual Studio.
  • Loading branch information
jbytheway authored and ZhilkinSerg committed Jul 1, 2019
1 parent e286c52 commit 4321c02
Show file tree
Hide file tree
Showing 291 changed files with 811 additions and 498 deletions.
3 changes: 1 addition & 2 deletions src/action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@
#include "optional.h"
#include "output.h"
#include "path_info.h"
#include "player.h"
#include "translations.h"
#include "trap.h"
#include "ui.h"
#include "vehicle.h"
#include "vpart_position.h"
#include "creature.h"
#include "cursesdef.h"
#include "enums.h"
#include "item.h"
#include "ret_val.h"
#include "type_id.h"
#include "point.h"

class inventory;

Expand Down
3 changes: 0 additions & 3 deletions src/active_item_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
#include <algorithm>
#include <utility>

#include "colony.h"
#include "debug.h"
#include "item.h"
#include "item_stack.h"
#include "safe_reference.h"

void active_item_cache::remove( const item *it )
Expand Down
8 changes: 4 additions & 4 deletions src/active_item_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

#include <list>
#include <unordered_map>
#include <vector>

#include "colony.h"
#include "enums.h"
#include "item.h"
#include "item_stack.h"
#include "safe_reference.h"
#include "point.h"

class item;

// A struct used to uniquely identify an item within a submap or vehicle.
struct item_reference {
Expand Down
8 changes: 6 additions & 2 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@
#include "type_id.h"
#include "event.h"
#include "options.h"

class npc;
#include "colony.h"
#include "color.h"
#include "flat_set.h"
#include "game_constants.h"
#include "point.h"
#include "weather.h"

#define dbg(x) DebugLog((x),D_GAME) << __FILE__ << ":" << __LINE__ << ": "

Expand Down
11 changes: 7 additions & 4 deletions src/activity_item_handling.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#include "activity_handlers.h" // IWYU pragma: associated

#include <climits>
#include <cstddef>
#include <algorithm>
#include <cassert>
#include <list>
#include <vector>
#include <iterator>
#include <memory>
#include <set>
#include <string>
#include <utility>

Expand Down Expand Up @@ -44,10 +41,16 @@
#include "character.h"
#include "game_constants.h"
#include "inventory.h"
#include "item_stack.h"
#include "line.h"
#include "units.h"
#include "type_id.h"
#include "flat_set.h"
#include "int_id.h"
#include "item_location.h"
#include "point.h"
#include "string_id.h"

struct construction_category;

void cancel_aim_processing();

Expand Down
1 change: 1 addition & 0 deletions src/activity_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "translations.h"
#include "player.h"
#include "player_activity.h"
#include "string_formatter.h"

// activity_type functions
static std::map< activity_id, activity_type > activity_type_all;
Expand Down
8 changes: 7 additions & 1 deletion src/advanced_inv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@
#include "item.h"
#include "optional.h"
#include "ret_val.h"
#include "string_id.h"
#include "type_id.h"
#include "clzones.h"
#include "colony.h"
#include "enums.h"
#include "faction.h"
#include "item_location.h"
#include "map_selector.h"
#include "pimpl.h"

#if defined(__ANDROID__)
# include <SDL_keyboard.h>
Expand Down
1 change: 0 additions & 1 deletion src/advanced_inv.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <vector>

#include "cursesdef.h"
#include "enums.h"
#include "point.h"
#include "units.h"

Expand Down
3 changes: 2 additions & 1 deletion src/animation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
#include "weather.h"
#include "creature.h"
#include "cursesdef.h"
#include "enums.h"
#include "game_constants.h"
#include "posix_time.h"
#include "translations.h"
#include "type_id.h"
#include "explosion.h"
#include "point.h"

#if defined(TILES)
#include <memory>
Expand Down
2 changes: 2 additions & 0 deletions src/armor_layers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <string>
#include <vector>
#include <iterator>
#include <cstddef>

#include "avatar.h"
#include "cata_utility.h"
Expand All @@ -17,6 +18,7 @@
#include "string_formatter.h"
#include "translations.h"
#include "debug.h"
#include "enums.h"

namespace
{
Expand Down
1 change: 0 additions & 1 deletion src/auto_pickup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "options.h"
#include "output.h"
#include "path_info.h"
#include "player.h"
#include "string_formatter.h"
#include "string_input_popup.h"
#include "translations.h"
Expand Down
34 changes: 33 additions & 1 deletion src/avatar.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
#include "avatar.h"

#include <limits.h>
#include <stdlib.h>
#include <algorithm>
#include <list>
#include <map>
#include <memory>
#include <ostream>
#include <set>
#include <tuple>
#include <unordered_map>
#include <utility>

#include "action.h"
#include "bionics.h"
#include "calendar.h"
#include "character.h"
#include "creature.h"
#include "effect.h"
#include "enums.h"
#include "filesystem.h"
Expand All @@ -31,6 +42,27 @@
#include "ui.h"
#include "vehicle.h"
#include "vpart_position.h"
#include "color.h"
#include "compatibility.h"
#include "debug.h"
#include "game_constants.h"
#include "item_location.h"
#include "iuse.h"
#include "mtype.h"
#include "optional.h"
#include "output.h"
#include "pathfinding.h"
#include "pimpl.h"
#include "player_activity.h"
#include "rng.h"
#include "stomach.h"
#include "string_formatter.h"
#include "string_id.h"
#include "translations.h"
#include "units.h"

class JsonIn;
class JsonOut;

const efftype_id effect_contacts( "contacts" );
const efftype_id effect_sleep( "sleep" );
Expand Down
23 changes: 22 additions & 1 deletion src/avatar.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,31 @@
#ifndef AVATAR_H
#define AVATAR_H

#include <stddef.h>
#include <iosfwd>
#include <string>
#include <unordered_set>
#include <vector>

#include "enums.h"
#include "player.h"

#include "magic_teleporter_list.h"
#include "calendar.h"
#include "item.h"
#include "map_memory.h"
#include "pldata.h"
#include "point.h"

class JsonIn;
class JsonObject;
class JsonOut;
class mission;
class npc;
namespace debug_menu
{
class mission_debug;
} // namespace debug_menu
struct points_left;

class avatar : public player
{
Expand Down
24 changes: 23 additions & 1 deletion src/avatar_action.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#include "avatar_action.h"

#include <stdlib.h>
#include <algorithm>
#include <functional>
#include <memory>
#include <ostream>
#include <set>
#include <string>
#include <utility>
#include <vector>

#include "action.h"
#include "avatar.h"
#include "creature.h"
Expand All @@ -16,14 +26,26 @@
#include "npc.h"
#include "options.h"
#include "output.h"
#include "player.h"
#include "projectile.h"
#include "ranged.h"
#include "translations.h"
#include "type_id.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vpart_position.h"
#include "bodypart.h"
#include "cursesdef.h"
#include "debug.h"
#include "enums.h"
#include "game_constants.h"
#include "gun_mode.h"
#include "int_id.h"
#include "inventory.h"
#include "item_location.h"
#include "mtype.h"
#include "player_activity.h"
#include "ret_val.h"
#include "rng.h"

#define dbg(x) DebugLog((x),D_SDL) << __FILE__ << ":" << __LINE__ << ": "

Expand Down
5 changes: 2 additions & 3 deletions src/avatar_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
#ifndef AVATAR_ACTION_H
#define AVATAR_ACTION_H

#include "enums.h"
#include <limits.h>

#include "optional.h"
#include "point.h"

class avatar;
class item;
class map;

struct point;
struct targeting_data;

namespace avatar_action
Expand Down
2 changes: 1 addition & 1 deletion src/ballistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "messages.h"
#include "monster.h"
#include "options.h"
#include "player.h"
#include "projectile.h"
#include "rng.h"
#include "sounds.h"
Expand All @@ -33,6 +32,7 @@
#include "translations.h"
#include "units.h"
#include "type_id.h"
#include "point.h"

const efftype_id effect_bounced( "bounced" );

Expand Down
6 changes: 2 additions & 4 deletions src/basecamp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
#include <utility>

#include "avatar.h"
#include "craft_command.h"
#include "output.h"
#include "string_formatter.h"
#include "translations.h"
#include "enums.h"
#include "game.h"
#include "inventory.h"
#include "item.h"
Expand All @@ -26,15 +24,15 @@
#include "recipe_dictionary.h"
#include "recipe_groups.h"
#include "requirements.h"
#include "rng.h"
#include "skill.h"
#include "string_input_popup.h"
#include "faction_camp.h"
#include "calendar.h"
#include "color.h"
#include "compatibility.h"
#include "string_id.h"
#include "type_id.h"
#include "flat_set.h"
#include "line.h"

const std::string base_camps::faction_encode_short( const std::string &type )
{
Expand Down
3 changes: 1 addition & 2 deletions src/basecamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
#include <list>
#include <memory>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <string>

#include "enums.h"
#include "inventory.h"
#include "point.h"

class JsonIn;
class JsonOut;
Expand Down
6 changes: 6 additions & 0 deletions src/behavior.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#include "behavior.h"

#include <assert.h>
#include <list>
#include <set>
#include <unordered_map>
#include <utility>

#include "behavior_oracle.h"
#include "behavior_strategy.h"
#include "generic_factory.h"
#include "debug.h"
#include "json.h"

using namespace behavior;

Expand Down
Loading

0 comments on commit 4321c02

Please sign in to comment.