Skip to content

Commit

Permalink
Merge pull request #79389 from moxian/small-iwyu-fixes
Browse files Browse the repository at this point in the history
a small handful of random insignificant code cleanups
  • Loading branch information
GuardianDll authored Jan 30, 2025
2 parents 97b05c5 + 7c2e8c8 commit 1d6506e
Show file tree
Hide file tree
Showing 19 changed files with 13 additions and 36 deletions.
1 change: 1 addition & 0 deletions src/activity_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
#include "translation.h"
#include "translations.h"
#include "trap.h"
#include "type_id.h"
#include "try_parse_integer.h"
#include "ui.h"
#include "uistate.h"
Expand Down
2 changes: 0 additions & 2 deletions src/activity_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class activity_type;
class player_activity;
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
2 changes: 0 additions & 2 deletions src/anatomy.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class Creature;
class JsonObject;
class anatomy;

using anatomy_id = string_id<anatomy>;

/**
* A structure that contains body parts.
* Keeps caches for weighted selections.
Expand Down
2 changes: 0 additions & 2 deletions src/basecamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ class zone_data;
struct MonsterGroupResult;
enum class farm_ops;

using faction_id = string_id<faction>;

const int work_day_hours = 10;
const int work_day_rest_hours = 8;
const int work_day_idle_hours = 6;
Expand Down
1 change: 0 additions & 1 deletion src/bodypart.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ struct localized_comparator;
template <typename E> struct enum_traits;
template <typename T> class generic_factory;

using bodypart_str_id = string_id<body_part_type>;
using bodypart_id = int_id<body_part_type>;

extern const bodypart_str_id body_part_head;
Expand Down
3 changes: 1 addition & 2 deletions src/build_reqs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ struct parameterized_build_reqs {
};

build_reqs get_build_reqs_for_furn_ter_ids(
const std::pair<std::map<ter_id, int>, std::map<furn_id, int>> &changed_ids,
ter_id const &base_ter = ter_str_id( "t_dirt" ).id() );
const std::pair<std::map<ter_id, int>, std::map<furn_id, int>> &changed_ids );

#endif // CATA_SRC_BUILD_REQS_H
1 change: 0 additions & 1 deletion src/cata_tiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class JsonObject;
class pixel_minimap;

extern void set_displaybuffer_rendertarget();
using ter_str_id = string_id<ter_t>;

/** Structures */
struct tile_type {
Expand Down
1 change: 0 additions & 1 deletion src/clzones.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class item;
class map;
struct construction;

using faction_id = string_id<faction>;
inline const faction_id your_fac( "your_followers" );
const std::string type_fac_hash_str = "__FAC__";

Expand Down
4 changes: 2 additions & 2 deletions src/construction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2517,9 +2517,9 @@ void finalize_constructions()
}

build_reqs get_build_reqs_for_furn_ter_ids(
const std::pair<std::map<ter_id, int>, std::map<furn_id, int>> &changed_ids,
ter_id const &base_ter )
const std::pair<std::map<ter_id, int>, std::map<furn_id, int>> &changed_ids )
{
ter_id const &base_ter = ter_t_dirt.id();
build_reqs total_reqs;

if( !finalized ) {
Expand Down
2 changes: 0 additions & 2 deletions src/creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ struct projectile_attack_results;
struct trap;
template <typename T> struct enum_traits;

using anatomy_id = string_id<anatomy>;

enum class creature_size : int {
// Keep it starting at 1 - damage done to monsters depends on it
// Squirrel, cat, human toddler
Expand Down
2 changes: 0 additions & 2 deletions src/faction.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class JsonValue;
class faction;
class npc;

using faction_id = string_id<faction>;

namespace npc_factions
{
void finalize();
Expand Down
5 changes: 2 additions & 3 deletions src/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ enum class mod : int;
} // namespace enchant_vals

using bodytype_id = std::string;
using faction_id = string_id<faction>;
class item_category;
struct islot_armor;
struct use_function;
Expand Down Expand Up @@ -3413,8 +3412,6 @@ inline bool is_crafting_component( const item &component )
*/
bool is_preferred_component( const item &component );

#endif // CATA_SRC_ITEM_H

struct disp_mod_by_barrel {
units::length barrel_length;
int dispersion_modifier;
Expand All @@ -3433,3 +3430,5 @@ struct disp_mod_by_barrel {
*/
std::vector<std::pair<const item *, int>> get_item_duplicate_counts(
const std::list<const item *> &items );

#endif // CATA_SRC_ITEM_H
2 changes: 0 additions & 2 deletions src/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ struct field_proc_data;

class PathfindingFlags;

using relic_procgen_id = string_id<relic_procgen_data>;

class map_stack : public item_stack
{
private:
Expand Down
4 changes: 1 addition & 3 deletions src/map_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
#include "mdarray.h"
#include "memory_fast.h"
#include "point.h" // IWYU pragma: keep
#include "type_id.h"

class JsonObject;
class JsonOut;
class JsonValue;

struct ter_t;
using ter_str_id = string_id<ter_t>;

class memorized_tile
{
public:
Expand Down
4 changes: 0 additions & 4 deletions src/mapdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
#include "units.h"
#include "value_ptr.h"

struct ter_t;

using ter_str_id = string_id<ter_t>;

class JsonObject;
class Character;
struct iexamine_actor;
Expand Down
4 changes: 0 additions & 4 deletions src/npc.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ struct pathfinding_settings;
enum game_message_type : int;
class gun_mode;

using bionic_id = string_id<bionic_data>;
using npc_class_id = string_id<npc_class>;
using mission_type_id = string_id<mission_type>;
using mfaction_id = int_id<monfaction>;
using overmap_location_str_id = string_id<overmap_location>;
using drop_location = std::pair<item_location, int>;
using drop_locations = std::list<drop_location>;
Expand Down
2 changes: 0 additions & 2 deletions src/relic.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ struct relic_charge_info;
struct relic_charge_template;
struct tripoint;

using relic_procgen_id = string_id<relic_procgen_data>;

class relic_procgen_data
{
public:
Expand Down
1 change: 0 additions & 1 deletion src/subbodypart.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class JsonValue;
struct sub_body_part_type;
struct body_part_type;

using sub_bodypart_str_id = string_id<sub_body_part_type>;
using sub_bodypart_id = int_id<sub_body_part_type>;

enum class side : int {
Expand Down
6 changes: 6 additions & 0 deletions src/type_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ struct ammo_effect;
using ammo_effect_id = int_id<ammo_effect>;
using ammo_effect_str_id = string_id<ammo_effect>;

class anatomy;
using anatomy_id = string_id<anatomy>;

struct attack_vector;
using attack_vector_id = string_id<attack_vector>;

Expand Down Expand Up @@ -273,6 +276,9 @@ using proficiency_category_id = string_id<proficiency_category>;
class proficiency;
using proficiency_id = string_id<proficiency>;

class relic_procgen_data;
using relic_procgen_id = string_id<relic_procgen_data>;

struct ter_t;
using ter_id = int_id<ter_t>;
using ter_str_id = string_id<ter_t>;
Expand Down

0 comments on commit 1d6506e

Please sign in to comment.