Skip to content

Commit e62906c

Browse files
committed
use #pragma once instead of #ifndef-#define in xrPhysics
1 parent d6ee7a1 commit e62906c

40 files changed

+45
-149
lines changed

src/xrPhysics/BlockAllocator.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef BLOCK_ALLOCATOR_H
2-
#define BLOCK_ALLOCATOR_H
1+
#pragma once
2+
33
template <class T, u32 block_size>
44
class CBlockAllocator
55
{
@@ -87,5 +87,3 @@ class CBlockAllocator
8787
//IC void construct(u32 position) { xr_allocator_t<T>().construct(pointer(position)); }
8888
//IC void construct_back() { xr_allocator_t<T>().construct(back_pointer()); }
8989
};
90-
91-
#endif

src/xrPhysics/CycleConstStorage.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#pragma once
2-
#ifndef CYCLE_CONST_STORAGE_H
3-
#define CYCLE_CONST_STORAGE_H
42

53
template <class T, int size>
64
class CCycleConstStorage
@@ -19,4 +17,3 @@ class CCycleConstStorage
1917
IC T& operator[](int i) { return array[position(i)]; }
2018
IC const T& operator[](int i) const { return array[position(i)]; }
2119
};
22-
#endif

src/xrPhysics/DisablingParams.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma once
2-
#ifndef DISABLING_PARAMS_H
3-
#define DISABLING_PARAMS_H
2+
43
#include "xrPhysics.h"
54

65
// fwd. decl.
@@ -29,5 +28,3 @@ struct SAllDDWParams
2928
};
3029

3130
extern SAllDDWParams worldDisablingParams;
32-
33-
#endif

src/xrPhysics/ElevatorState.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef ELEVATOR_STAETE
2-
#define ELEVATOR_STAETE
1+
#pragma once
32

43
#include "IElevatorState.h"
54
class CPHCharacter;
@@ -62,5 +61,3 @@ class CElevatorState : public IElevatorState
6261
public:
6362
void NetRelcase(IPhysicsShellHolder* O);
6463
};
65-
66-
#endif

src/xrPhysics/ExtendedGeom.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef EXTENDED_GEOM
2-
#define EXTENDED_GEOM
1+
#pragma once
32

43
#ifndef dSINGLE
54
#define dSINGLE
@@ -276,5 +275,3 @@ IC void dGeomUserDataClearCashedTries(dxGeom* geom)
276275
#ifdef DEBUG
277276
XRPHYSICS_API bool IsCyliderContact(const dContact& c);
278277
#endif
279-
280-
#endif

src/xrPhysics/Geometry.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma once
2-
#ifndef GEOMETRY_H
3-
#define GEOMETRY_H
2+
43
#include "PhysicsCommon.h"
54
#include "ExtendedGeom.h"
65
#include "MathUtilsOde.h"
@@ -193,4 +192,3 @@ class CCylinderGeom : public CODEGeom
193192
virtual void dbg_draw(float scale, u32 color, Flags32 flags) const;
194193
#endif
195194
};
196-
#endif // GEOMETRY_H

src/xrPhysics/IColisiondamageInfo.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef I_COLLISION_DAMAGE_INFO_H
2-
#define I_COLLISION_DAMAGE_INFO_H
1+
#pragma once
2+
33
// struct SCollisionHitCallback;
44
class ICollisionHitCallback;
55
class ICollisionDamageInfo
@@ -24,4 +24,3 @@ class ICollisionDamageInfo
2424
virtual ~ICollisionDamageInfo() {}
2525
#endif
2626
};
27-
#endif

src/xrPhysics/MathUtils.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma once
2-
#ifndef MATH_UTILS_H
3-
#define MATH_UTILS_H
2+
43
#include "xrCore/_fbox.h"
54
#include "xrCore/_obb.h"
65
#include "xrPhysics.h"
@@ -477,5 +476,3 @@ const float DET_CHECK_FATAL_EPS = 0.8f; // scale -35% !? ;)
477476
#else
478477
#define VERIFY_RMATRIX(M)
479478
#endif
480-
481-
#endif // include guard

src/xrPhysics/PHActivationShape.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#ifndef PH_ACTIVATION_SHAPE
2-
#define PH_ACTIVATION_SHAPE
3-
#endif
1+
#pragma once
42

53
#include "PHValideValues.h"
64
#include "PHObject.h"

src/xrPhysics/PHBaseBodyEffector.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef PH_BASE_BODY_EFFECTOR_H
2-
#define PH_BASE_BODY_EFFECTOR_H
1+
#pragma once
32

43
#include <ode/common.h>
54

@@ -11,4 +10,3 @@ class CPHBaseBodyEffector
1110
public:
1211
void Init(dBodyID body) { m_body = body; }
1312
};
14-
#endif

0 commit comments

Comments
 (0)