Skip to content

Commit

Permalink
Fix Clang's more sensitive header order and forward declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
Zegeri committed Sep 24, 2018
1 parent 2c243df commit 04893d8
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/utils/xrMiscMath/vector3d_ext.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "pch.hpp"
#include "xrCore/_vector3d_ext.h"
#include "xrCommon/math_funcs_inline.h"
#include "xrCore/_vector3d_ext.h"

float dotproduct(const Fvector& v1, const Fvector& v2)
{
Expand Down
2 changes: 1 addition & 1 deletion src/xrAICore/AISpaceBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include "AISpaceBase.hpp"
#include "Navigation/game_graph.h"
#include "Navigation/level_graph.h"
#include "Navigation/graph_engine.h"
#include "Navigation/PatrolPath/patrol_path_storage.h"
#include "Navigation/graph_engine.h"

AISpaceBase::AISpaceBase() { GEnv.AISpace = this; }
AISpaceBase::~AISpaceBase()
Expand Down
2 changes: 0 additions & 2 deletions src/xrAICore/Components/problem_solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#include "xrCore/Containers/AssociativeVector.hpp"
#include "Common/object_broker.h"

class CGraphEngine;

template <typename _operator_condition, typename _condition_state, typename _operator, typename _condition_evaluator,
typename _operator_id_type, bool _reverse_search = false, typename _operator_ptr = _operator*,
typename _condition_evaluator_ptr = _condition_evaluator*>
Expand Down
4 changes: 4 additions & 0 deletions src/xrAICore/Components/problem_solver_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

#pragma once

#ifndef AI_COMPILER
#include "xrAICore/Navigation/graph_engine.h"
#endif

#define TEMPLATE_SPECIALIZATION \
template <typename _operator_condition, typename _operator, typename _condition_state, \
typename _condition_evaluator, typename _operator_id_type, bool _reverse_search, typename _operator_ptr, \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include "ai/monsters/control_movement_base.h"
#include "ai/monsters/control_path_builder_base.h"

#include "ai/monsters/states/monster_state_rest.h"
#include "ai/monsters/states/monster_state_attack.h"
#include "ai/monsters/states/monster_state_rest.h"
#include "ai/monsters/states/monster_state_panic.h"
#include "ai/monsters/states/monster_state_eat.h"
#include "ai/monsters/states/monster_state_hear_int_sound.h"
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/ai/monsters/dog/dog_state_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#include "ai/monsters/control_direction_base.h"
#include "ai/monsters/control_movement_base.h"
#include "ai/monsters/control_path_builder_base.h"
#include "ai/monsters/states/monster_state_hitted.h"
#include "ai/monsters/states/monster_state_controlled.h"
#include "ai/monsters/states/monster_state_help_sound.h"
#include "ai/monsters/states/monster_state_hear_int_sound.h"
#include "ai/monsters/states/monster_state_hitted.h"
#include "ai/monsters/group_states/group_state_attack.h"
#include "ai/monsters/group_states/group_state_rest.h"
#include "ai/monsters/group_states/group_state_eat.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "state_custom_action.h"
#include "cover_point.h"
#include "ai/monsters/monster_cover_manager.h"
#include "ai/monsters/ai_monster_squad.h"
#include "ai/monsters/ai_monster_squad_manager.h"

#define TEMPLATE_SPECIALIZATION \
template <typename _Object\
Expand Down
1 change: 1 addition & 0 deletions src/xrGame/aimers_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define AIMERS_BASE_H_INCLUDED

#include "Include/xrRender/animation_motion.h"
#include "animation_movement_controller.h"
#include "Common/Noncopyable.hpp"

class CGameObject;
Expand Down
42 changes: 21 additions & 21 deletions src/xrGame/debug_text_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@
#ifndef AI_DEBUG_TEXT_TREE_H_INCLUDED
#define AI_DEBUG_TEXT_TREE_H_INCLUDED

IC xr_string __cdecl make_xrstr(pcstr format, ...)
{
va_list args;
va_start(args, format);

char temp[4096];
vsprintf(temp, format, args);

va_end(args);
return xr_string(temp);
}

IC xr_string __cdecl make_xrstr(bool b) { return b ? "+" : "-"; }
IC xr_string __cdecl make_xrstr(float f) { return make_xrstr("%f", f); }
IC xr_string __cdecl make_xrstr(s32 d) { return make_xrstr("%i", d); }
IC xr_string __cdecl make_xrstr(u32 d) { return make_xrstr("%u", d); }
IC xr_string __cdecl make_xrstr(s64 d) { return make_xrstr("%i", d); }
IC xr_string __cdecl make_xrstr(u64 d) { return make_xrstr("%u", d); }
IC xr_string __cdecl make_xrstr(Fvector3 v) { return make_xrstr("[%f][%f][%f]", v.x, v.y, v.z); }
IC xr_string __cdecl make_xrstr(const xr_string& s) { return s; }

namespace debug
{
class text_tree
Expand Down Expand Up @@ -79,25 +100,4 @@ void log_text_tree(text_tree& tree);
#include "debug_text_tree_inline.h"

} // namespace debug

IC xr_string __cdecl make_xrstr(pcstr format, ...)
{
va_list args;
va_start(args, format);

char temp[4096];
vsprintf(temp, format, args);

va_end(args);
return xr_string(temp);
}

IC xr_string __cdecl make_xrstr(bool b) { return b ? "+" : "-"; }
IC xr_string __cdecl make_xrstr(float f) { return make_xrstr("%f", f); }
IC xr_string __cdecl make_xrstr(s32 d) { return make_xrstr("%i", d); }
IC xr_string __cdecl make_xrstr(u32 d) { return make_xrstr("%u", d); }
IC xr_string __cdecl make_xrstr(s64 d) { return make_xrstr("%i", d); }
IC xr_string __cdecl make_xrstr(u64 d) { return make_xrstr("%u", d); }
IC xr_string __cdecl make_xrstr(Fvector3 v) { return make_xrstr("[%f][%f][%f]", v.x, v.y, v.z); }
IC xr_string __cdecl make_xrstr(const xr_string& s) { return s; }
#endif // defined(AI_DEBUG_TEXT_TREE_H_INCLUDED)
3 changes: 2 additions & 1 deletion src/xrGame/memory_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

#pragma once

#include "enemy_manager.h"

class CVisualMemoryManager;
class CSoundMemoryManager;
class CHitMemoryManager;
class CEnemyManager;
class CItemManager;
class CDangerManager;
class CCustomMonster;
Expand Down
3 changes: 1 addition & 2 deletions src/xrGame/space_restriction_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
#pragma once

#include "restriction_space.h"

class CSpaceRestrictionBase;
#include "space_restriction_base.h"

class CSpaceRestrictionBridge : public RestrictionSpace::CTimeIntrusiveBase
{
Expand Down
4 changes: 2 additions & 2 deletions src/xrPhysics/ActorCameraCollision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include "xrEngine/CameraBase.h"
#include "xrEngine/GameMtlLib.h"

#include "PHWorld.h"
#include "PHCollideValidator.h"
#include "PHShell.h"
#include "matrix_utils.h"
#include "IPhysicsShellHolder.h"
#include "xrEngine/xr_object.h" //--#SM+#--
#include "GeometryBits.h"
#include "PHWorld.h"
#include "PHCollideValidator.h"

#ifdef DEBUG
#include "debug_output.h"
Expand Down
1 change: 1 addition & 0 deletions src/xrPhysics/PhysicsExternalCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "xrPhysics/xrPhysics.h"
#include "xrCore/_types.h"
#include "xrCore/_matrix.h"
#include "MathUtils.h"

struct dContactGeom;
struct dContact;
Expand Down

0 comments on commit 04893d8

Please sign in to comment.