Skip to content

Commit dfa6de2

Browse files
committed
Replaced static_assert with COMPILE_ASSERT
1 parent 299208d commit dfa6de2

File tree

646 files changed

+4022
-4022
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

646 files changed

+4022
-4022
lines changed

game/common/havok/hkArray.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ struct hkArrayBase
88
int m_size;
99
unsigned int m_capacityAndFlags;
1010
};
11-
static_assert(sizeof(hkArrayBase<void*>) == 0xC);
11+
COMPILE_ASSERT(sizeof(hkArrayBase<void*>) == 0xC);
1212

1313
template <typename t_type, typename t_allocator = void>
1414
struct hkArray :
@@ -21,7 +21,7 @@ struct hkArray :
2121
//const t_type& operator[](int i) const;
2222
t_type& operator[](int i);
2323
};
24-
static_assert(sizeof(hkArray<void*>) == 0xC);
24+
COMPILE_ASSERT(sizeof(hkArray<void*>) == 0xC);
2525

2626
template <typename t_type, int t_count, typename t_allocator = void>
2727
struct hkInplaceArray :

game/common/havok/hkMath.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,32 @@ struct hkVector4
1111
{
1212
__m128 m_quad;
1313
};
14-
static_assert(sizeof(hkVector4) == 0x10);
14+
COMPILE_ASSERT(sizeof(hkVector4) == 0x10);
1515

1616
struct hkQuaternion
1717
{
1818
hkVector4 vector;
1919
};
20-
static_assert(sizeof(hkQuaternion) == 0x10);
20+
COMPILE_ASSERT(sizeof(hkQuaternion) == 0x10);
2121

2222
struct hkMatrix3
2323
{
2424
hkVector4 forward;
2525
hkVector4 left;
2626
hkVector4 up;
2727
};
28-
static_assert(sizeof(hkMatrix3) == 0x30);
28+
COMPILE_ASSERT(sizeof(hkMatrix3) == 0x30);
2929

3030
struct hkRotation
3131
{
3232
hkMatrix3 matrix;
3333
};
34-
static_assert(sizeof(hkRotation) == 0x30);
34+
COMPILE_ASSERT(sizeof(hkRotation) == 0x30);
3535

3636
struct hkTransform
3737
{
3838
hkRotation rotation;
3939
hkVector4 translation;
4040
};
41-
static_assert(sizeof(hkTransform) == 0x40);
41+
COMPILE_ASSERT(sizeof(hkTransform) == 0x40);
4242

game/common/havok/hkMonitor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ struct hkMonitorStream
1010
hkPadSpu<char*> m_capacityMinus16;
1111
hkBool m_isBufferAllocatedOnTheHeap;
1212
};
13-
static_assert(sizeof(hkMonitorStream) == 0x14);
13+
COMPILE_ASSERT(sizeof(hkMonitorStream) == 0x14);
1414

game/common/havok/hkThread.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ struct hkThreadMemory
2121
char* m_base;
2222
char* m_end;
2323
};
24-
static_assert(sizeof(Stack) == 0x10);
24+
COMPILE_ASSERT(sizeof(Stack) == 0x10);
2525

2626
struct FreeList
2727
{
2828
struct FreeElem
2929
{
3030
FreeElem* m_next;
3131
};
32-
static_assert(sizeof(FreeElem) == 0x4);
32+
COMPILE_ASSERT(sizeof(FreeElem) == 0x4);
3333

3434
FreeElem* m_head;
3535
int m_numElem;
3636
};
37-
static_assert(sizeof(FreeList) == 0x8);
37+
COMPILE_ASSERT(sizeof(FreeList) == 0x8);
3838

3939
byte __data4[0xC];
4040
hkMemory* m_memory;
@@ -48,4 +48,4 @@ struct hkThreadMemory
4848
char m_small_size_to_row_lut[512 + 1];
4949
int m_large_size_to_row_lut[10];
5050
};
51-
static_assert(sizeof(hkThreadMemory) == 0x330);
51+
COMPILE_ASSERT(sizeof(hkThreadMemory) == 0x330);

game/common/havok/hkWorld.hpp

Lines changed: 98 additions & 98 deletions
Large diffs are not rendered by default.

game/common/incl.sys/fileio/fileio.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ struct osTIMER
77
int start;
88
int time;
99
};
10-
static_assert(sizeof(osTIMER) == 0x8);
10+
COMPILE_ASSERT(sizeof(osTIMER) == 0x8);
1111

1212
enum FIO_OPEN
1313
{
@@ -46,7 +46,7 @@ struct osASYNC_INFO
4646
int holdSignal;
4747
byte data[0x4A];
4848
};
49-
static_assert(sizeof(osASYNC_INFO) == 0x60);
49+
COMPILE_ASSERT(sizeof(osASYNC_INFO) == 0x60);
5050

5151
struct fioCHUNK_DESCR;
5252
struct fioFILE_BUFFER;
@@ -81,7 +81,7 @@ struct fioFILE
8181
int random_seed;
8282
dsFLAGS<FIO_OPEN, int> state;
8383
};
84-
static_assert(sizeof(fioFILE) == 0x24);
84+
COMPILE_ASSERT(sizeof(fioFILE) == 0x24);
8585

8686
struct fioFILE_DISK :
8787
public fioFILE
@@ -95,7 +95,7 @@ struct fioFILE_DISK :
9595
int bufSize;
9696
int bufSizeMax;
9797
};
98-
static_assert(sizeof(fioFILE_DISK) == 0x348);
98+
COMPILE_ASSERT(sizeof(fioFILE_DISK) == 0x348);
9999

100100
struct fioFILE_MEM :
101101
public fioFILE
@@ -108,4 +108,4 @@ struct fioFILE_MEM :
108108
osASYNC_FILE_HANDLE_DUMMY* fpAsync;
109109
osASYNC_INFO fpAsyncInfo;
110110
};
111-
static_assert(sizeof(fioFILE_MEM) == 0x9C);
111+
COMPILE_ASSERT(sizeof(fioFILE_MEM) == 0x9C);

game/common/lib_3dpart/fmod/src/sound_fmod.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct FMOD_REVERB_PROPERTIES
3636
float Density;
3737
unsigned int Flags;
3838
};
39-
static_assert(sizeof(FMOD_REVERB_PROPERTIES) == 0x7C);
39+
COMPILE_ASSERT(sizeof(FMOD_REVERB_PROPERTIES) == 0x7C);
4040

4141
struct HALO_CHANNEL;
4242

@@ -107,7 +107,7 @@ struct HALO_SOUND_SYSTEM
107107
byte __data80[0x12C];
108108
byte __data1AC[0x58];
109109
};
110-
static_assert(sizeof(HALO_SOUND_SYSTEM) == 0x204);
110+
COMPILE_ASSERT(sizeof(HALO_SOUND_SYSTEM) == 0x204);
111111

112112
namespace FMOD
113113
{
@@ -197,7 +197,7 @@ namespace FMOD
197197
EventSystemI_vtbl* __vftable /*VFT*/;
198198
byte __data[0xE0];
199199
};
200-
static_assert(sizeof(EventSystemI) == 0xE4);
200+
COMPILE_ASSERT(sizeof(EventSystemI) == 0xE4);
201201

202202
extern int32 __stdcall System_init(int system, int maxchannels, unsigned int flags, void* extradriverdata);
203203
};
@@ -257,7 +257,7 @@ namespace snd
257257
byte __data8[0x24];
258258
int listenersCount;
259259
};
260-
static_assert(sizeof(SYSTEM) == 0x30);
260+
COMPILE_ASSERT(sizeof(SYSTEM) == 0x30);
261261

262262
struct SYSTEM_FMOD :
263263
SYSTEM
@@ -288,7 +288,7 @@ namespace snd
288288
dsVECTOR<FMOD_REVERB_PROPERTIES, 8> auxPresets;
289289
dsVECTOR<dsTSTRING<char>, 8> auxPresetNames;
290290
};
291-
static_assert(sizeof(SYSTEM_FMOD) == 0x368);
291+
COMPILE_ASSERT(sizeof(SYSTEM_FMOD) == 0x368);
292292

293293
//extern int& THREAD_ID;
294294
//extern FMOD::System*& fmodOriginalSystem;

game/source/_force_includes/_force_included_macros.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ const int32 QWORD_BITS = SIZEOF_BITS(uns64);
6262

6363
//#define CHAR_MAX char(0x7F)
6464
#define UNSIGNED_CHAR_MAX ((uns8)-1)
65-
static_assert(UNSIGNED_CHAR_MAX == 0xFF);
65+
COMPILE_ASSERT(UNSIGNED_CHAR_MAX == 0xFF);
6666

6767
//#define SHORT_MAX int16(0x7FFF)
6868
#define UNSIGNED_SHORT_MAX ((uns16)-1)
69-
static_assert(UNSIGNED_SHORT_MAX == 0xFFFF);
69+
COMPILE_ASSERT(UNSIGNED_SHORT_MAX == 0xFFFF);
7070

7171
//#define LONG_MAX int32(0x7FFFFFFF)
7272
#define UNSIGNED_LONG_MAX ((uns32)-1)
73-
static_assert(UNSIGNED_LONG_MAX == 0xFFFFFFFF);
73+
COMPILE_ASSERT(UNSIGNED_LONG_MAX == 0xFFFFFFFF);
7474

7575
#define VALID_CONTROLLER(CONTROLLER) ((CONTROLLER) >= _controller0 && (CONTROLLER) < k_number_of_controllers)
7676

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
#pragma once
22

33
typedef char int8;
4-
static_assert(sizeof(int8) == 0x1);
4+
COMPILE_ASSERT(sizeof(int8) == 0x1);
55

66
typedef unsigned char uns8;
7-
static_assert(sizeof(uns8) == 0x1);
7+
COMPILE_ASSERT(sizeof(uns8) == 0x1);
88

99
typedef short int16;
10-
static_assert(sizeof(int16) == 0x2);
10+
COMPILE_ASSERT(sizeof(int16) == 0x2);
1111

1212
typedef unsigned short uns16;
13-
static_assert(sizeof(uns16) == 0x2);
13+
COMPILE_ASSERT(sizeof(uns16) == 0x2);
1414

1515
typedef long int32;
16-
static_assert(sizeof(int32) == 0x4);
16+
COMPILE_ASSERT(sizeof(int32) == 0x4);
1717

1818
typedef unsigned long uns32;
19-
static_assert(sizeof(uns32) == 0x4);
19+
COMPILE_ASSERT(sizeof(uns32) == 0x4);
2020

2121
typedef long long int64;
22-
static_assert(sizeof(int64) == 0x8);
22+
COMPILE_ASSERT(sizeof(int64) == 0x8);
2323

2424
typedef unsigned long long uns64;
25-
static_assert(sizeof(uns64) == 0x8);
25+
COMPILE_ASSERT(sizeof(uns64) == 0x8);
2626

2727
typedef float real32;
28-
static_assert(sizeof(real32) == 0x4);
28+
COMPILE_ASSERT(sizeof(real32) == 0x4);
2929

3030
typedef double real64;
31-
static_assert(sizeof(real64) == 0x8);
31+
COMPILE_ASSERT(sizeof(real64) == 0x8);
3232

3333
typedef unsigned char byte;
34-
static_assert(sizeof(byte) == 0x1);
34+
COMPILE_ASSERT(sizeof(byte) == 0x1);
3535

3636
typedef char utf8;
37-
static_assert(sizeof(utf8) == 0x1);
37+
COMPILE_ASSERT(sizeof(utf8) == 0x1);
3838

3939
typedef unsigned long tag;
40-
static_assert(sizeof(tag) == 0x4);
40+
COMPILE_ASSERT(sizeof(tag) == 0x4);
4141

4242
typedef long string_id;
43-
static_assert(sizeof(string_id) == 0x4);
43+
COMPILE_ASSERT(sizeof(string_id) == 0x4);
4444

game/source/ai/activities.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ struct s_posture_info
1010
bool disallow_targeting;
1111
bool debilitated;
1212
};
13-
static_assert(sizeof(s_posture_info) == 0x14);
13+
COMPILE_ASSERT(sizeof(s_posture_info) == 0x14);
1414

1515
extern e_ai_posture const(&g_activity_posture_variants)[k_activity_count][k_max_activity_variants];
1616
extern int32 const(&g_activity_names)[k_activity_count];

0 commit comments

Comments
 (0)