Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run the codebase through IWYU #79239

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 2 additions & 6 deletions src/achievement.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "achievement.h"

#include <cstdlib>
#include <set>
#include <list>
#include <string>
#include <tuple>
#include <utility>
Expand All @@ -14,19 +14,15 @@
#include "enums.h"
#include "event.h"
#include "event_statistics.h"
#include "flexbuffer_json-inl.h"
#include "flexbuffer_json.h"
#include "flexbuffer_json-inl.h"
#include "generic_factory.h"
#include "init.h"
#include "json.h"
#include "json_error.h"
#include "past_achievements_info.h"
#include "stats_tracker.h"
#include "string_formatter.h"
#include "translations.h"

template <typename E> struct enum_traits;

static const achievement_id achievement_achievement_arcade_mode( "achievement_arcade_mode" );

// Some details about how achievements work
Expand Down
9 changes: 2 additions & 7 deletions src/achievement.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,10 @@
class JsonObject;
class JsonOut;
class achievements_tracker;
struct achievement_requirement;
template <typename E> struct enum_traits;

namespace cata
{
class event;
} // namespace cata
class requirement_watcher;
class stats_tracker;
struct achievement_requirement;
template <typename E> struct enum_traits;

enum class achievement_comparison : int {
equal,
Expand Down
3 changes: 3 additions & 0 deletions src/action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <climits>
#include <istream>
#include <iterator>
#include <locale>
#include <memory>
#include <optional>
#include <string>
Expand All @@ -13,6 +14,7 @@
#include "cached_options.h" // IWYU pragma: keep
#include "cata_utility.h"
#include "character.h"
#include "coordinates.h"
#include "creature.h"
#include "creature_tracker.h"
#include "debug.h"
Expand All @@ -26,6 +28,7 @@
#include "item_location.h"
#include "map.h"
#include "map_iterator.h"
#include "map_scale_constants.h"
#include "mapdata.h"
#include "memory_fast.h"
#include "messages.h"
Expand Down
2 changes: 2 additions & 0 deletions src/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
#include <optional>
#include <set>
#include <string>
#include <utility>
#include <vector>

#include "coords_fwd.h"
#include "point.h"

class input_context;
struct input_event;
Expand Down
1 change: 1 addition & 0 deletions src/active_item_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <vector>

#include "coordinates.h"
#include "point.h"
#include "safe_reference.h"

class item;
Expand Down
16 changes: 8 additions & 8 deletions src/activity_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
#include <cstdint>
#include <functional>
#include <initializer_list>
#include <iterator>
#include <list>
#include <map>
#include <optional>
#include <set>
#include <sstream>
#include <string>
#include <string_view>
#include <type_traits>
#include <unordered_set>
#include <utility>
#include <vector>
Expand All @@ -27,6 +25,7 @@
#include "avatar.h"
#include "avatar_action.h"
#include "bodypart.h"
#include "cached_options.h"
#include "calendar.h"
#include "cata_assert.h"
#include "cata_utility.h"
Expand All @@ -44,14 +43,13 @@
#include "event.h"
#include "event_bus.h"
#include "faction.h"
#include "field_type.h"
#include "fault.h"
#include "field_type.h"
#include "flag.h"
#include "flexbuffer_json-inl.h"
#include "flexbuffer_json.h"
#include "flexbuffer_json-inl.h"
#include "game.h"
#include "game_constants.h"
#include "game_inventory.h"
#include "gates.h"
#include "gun_mode.h"
#include "handle_liquid.h"
Expand All @@ -67,20 +65,21 @@
#include "iuse_actor.h"
#include "json.h"
#include "json_error.h"
#include "line.h"
#include "magic_enchantment.h"
#include "map.h"
#include "map_iterator.h"
#include "map_scale_constants.h"
#include "map_selector.h"
#include "mapdata.h"
#include "martialarts.h"
#include "memory_fast.h"
#include "messages.h"
#include "monster.h"
#include "morale_types.h"
#include "mtype.h"
#include "npc.h"
#include "options.h"
#include "output.h"
#include "overmap_ui.h"
#include "pickup.h"
#include "pimpl.h"
#include "player_activity.h"
Expand All @@ -92,14 +91,15 @@
#include "requirements.h"
#include "ret_val.h"
#include "rng.h"
#include "safe_reference.h"
#include "shearing.h"
#include "skill.h"
#include "sounds.h"
#include "string_formatter.h"
#include "translation.h"
#include "translations.h"
#include "trap.h"
#include "try_parse_integer.h"
#include "type_id.h"
#include "ui.h"
#include "uistate.h"
#include "units.h"
Expand Down
17 changes: 6 additions & 11 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <iterator>
#include <memory>
#include <optional>
#include <ostream>
Expand All @@ -15,11 +14,10 @@
#include <string>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>

#include "activity_actor.h"
#include "activity_type.h"
#include "advanced_inv.h"
#include "avatar.h"
#include "avatar_action.h"
#include "bionics.h"
Expand All @@ -32,19 +30,18 @@
#include "character_id.h"
#include "character_martial_arts.h"
#include "clzones.h"
#include "colony.h"
#include "color.h"
#include "construction.h"
#include "coordinates.h"
#include "creature.h"
#include "creature_tracker.h"
#include "cuboid_rectangle.h"
#include "debug.h"
#include "effect_on_condition.h"
#include "enums.h"
#include "event.h"
#include "event_bus.h"
#include "fault.h"
#include "field_type.h"
#include "flag.h"
#include "flexbuffer_json-inl.h"
#include "game.h"
Expand All @@ -58,33 +55,33 @@
#include "item.h"
#include "item_factory.h"
#include "item_location.h"
#include "item_stack.h"
#include "itype.h"
#include "iuse.h"
#include "iuse_actor.h"
#include "line.h"
#include "magic.h"
#include "magic_type.h"
#include "make_static.h"
#include "map.h"
#include "map_iterator.h"
#include "mapdata.h"
#include "martialarts.h"
#include "memory_fast.h"
#include "messages.h"
#include "mongroup.h"
#include "monster.h"
#include "mtype.h"
#include "npc.h"
#include "npc_opinion.h"
#include "omdata.h"
#include "output.h"
#include "overmap.h"
#include "overmap_ui.h"
#include "overmapbuffer.h"
#include "pimpl.h"
#include "player_activity.h"
#include "pocket_type.h"
#include "point.h"
#include "proficiency.h"
#include "recipe.h"
#include "recipe_dictionary.h"
#include "requirements.h"
#include "ret_val.h"
#include "rng.h"
Expand All @@ -104,8 +101,6 @@
#include "weakpoint.h"
#include "weather.h"

enum class creature_size : int;

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

static const activity_id ACT_ARMOR_LAYERS( "ACT_ARMOR_LAYERS" );
Expand Down
1 change: 0 additions & 1 deletion src/activity_handlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <map>
#include <optional>
#include <string>
#include <unordered_set>
#include <vector>

#include "coords_fwd.h"
Expand Down
6 changes: 4 additions & 2 deletions src/activity_item_handling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#include "activity_actor_definitions.h"
#include "activity_type.h"
#include "avatar.h"
#include "calendar.h"
#include "cata_utility.h"
#include "character.h"
#include "clzones.h"
#include "colony.h"
#include "construction.h"
#include "coordinates.h"
#include "craft_command.h"
#include "creature.h"
#include "creature_tracker.h"
Expand All @@ -45,6 +45,7 @@
#include "itype.h"
#include "map.h"
#include "map_iterator.h"
#include "map_scale_constants.h"
#include "map_selector.h"
#include "mapdata.h"
#include "messages.h"
Expand Down Expand Up @@ -75,6 +76,7 @@
#include "weather.h"

struct use_function;
using item_filter = std::function<bool( const item & )>;

static const activity_id ACT_BUILD( "ACT_BUILD" );
static const activity_id ACT_BUTCHER_FULL( "ACT_BUTCHER_FULL" );
Expand Down
5 changes: 3 additions & 2 deletions src/activity_type.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "activity_type.h"

#include <functional>
#include <list>
#include <map>
#include <string>
#include <unordered_map>
Expand All @@ -10,10 +11,10 @@
#include "activity_handlers.h"
#include "assign.h"
#include "debug.h"
#include "flexbuffer_json-inl.h"
#include "enums.h"
#include "flexbuffer_json.h"
#include "flexbuffer_json-inl.h"
#include "generic_factory.h"
#include "json_error.h"
#include "sounds.h"
#include "string_formatter.h"
#include "translations.h"
Expand Down
4 changes: 1 addition & 3 deletions src/activity_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <set>
#include <string>

#include "enums.h"
#include "game_constants.h"
#include "translation.h"
#include "type_id.h"
Expand All @@ -14,10 +13,9 @@ class Character;
class JsonObject;
class activity_type;
class player_activity;
enum class distraction_type : int;
template <typename T> struct enum_traits;

using activity_id = string_id<activity_type>;

/** @relates string_id */
template<>
const activity_type &string_id<activity_type>::obj() const;
Expand Down
6 changes: 2 additions & 4 deletions src/addiction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <map>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <utility>

Expand All @@ -17,14 +16,13 @@
#include "effect_on_condition.h"
#include "enums.h"
#include "flexbuffer_json-inl.h"
#include "flexbuffer_json.h"
#include "generic_factory.h"
#include "init.h"
#include "json_error.h"
#include "rng.h"
#include "talker.h"
#include "text_snippets.h"

class JsonObject;

static const efftype_id effect_hallu( "hallu" );
static const efftype_id effect_shakes( "shakes" );

Expand Down
3 changes: 2 additions & 1 deletion src/addiction.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
#include "translation.h"
#include "type_id.h"

class Character;
class JsonObject;
class JsonOut;

class Character;

struct add_type {
private:
translation _type_name;
Expand Down
Loading
Loading