From af6e132b37e8b7e89e4c0c7a52e5bb81e4b1b9a8 Mon Sep 17 00:00:00 2001 From: bigbossbro08 Date: Sun, 10 May 2020 19:54:37 +0600 Subject: defined out asserts. --- src/control/Replay.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/control/Replay.h') diff --git a/src/control/Replay.h b/src/control/Replay.h index bf70a28a..ec39def8 100644 --- a/src/control/Replay.h +++ b/src/control/Replay.h @@ -108,7 +108,10 @@ class CReplay CMatrix camera_pos; CVector player_pos; }; + +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(tGeneralPacket) == 88, "tGeneralPacket: error"); +#endif struct tClockPacket { -- cgit v1.2.3 From c798e1bacdaabaf140ff3904948fd7cec46c09bb Mon Sep 17 00:00:00 2001 From: bigbossbro08 Date: Sun, 10 May 2020 21:49:33 +0600 Subject: Fixed typos and made all assert functions optional --- src/control/Replay.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/control/Replay.h') diff --git a/src/control/Replay.h b/src/control/Replay.h index ec39def8..66bee3bf 100644 --- a/src/control/Replay.h +++ b/src/control/Replay.h @@ -109,9 +109,7 @@ class CReplay CVector player_pos; }; -#ifdef CHECK_STRUCT_SIZES - static_assert(sizeof(tGeneralPacket) == 88, "tGeneralPacket: error"); -#endif + VALIDATE_SIZE(tGeneralPacket, 88); struct tClockPacket { @@ -121,7 +119,7 @@ class CReplay private: uint8 __align; }; - static_assert(sizeof(tClockPacket) == 4, "tClockPacket: error"); + VALIDATE_SIZE(tClockPacket, 4); struct tWeatherPacket { @@ -130,14 +128,14 @@ class CReplay uint8 new_weather; float interpolation; }; - static_assert(sizeof(tWeatherPacket) == 8, "tWeatherPacket: error"); + VALIDATE_SIZE(tWeatherPacket, 8); struct tTimerPacket { uint8 type; uint32 timer; }; - static_assert(sizeof(tTimerPacket) == 8, "tTimerPacket: error"); + VALIDATE_SIZE(tTimerPacket, 8); struct tPedHeaderPacket { @@ -148,7 +146,7 @@ class CReplay private: uint8 __align[3]; }; - static_assert(sizeof(tPedHeaderPacket) == 8, "tPedHeaderPacket: error"); + VALIDATE_SIZE(tPedHeaderPacket, 8); struct tBulletTracePacket { @@ -159,7 +157,7 @@ class CReplay CVector inf; CVector sup; }; - static_assert(sizeof(tBulletTracePacket) == 28, "tBulletTracePacket: error"); + VALIDATE_SIZE(tBulletTracePacket, 28); struct tEndOfFramePacket { @@ -167,7 +165,7 @@ class CReplay private: uint8 __align[3]; }; - static_assert(sizeof(tEndOfFramePacket) == 4, "tEndOfFramePacket: error"); + VALIDATE_SIZE(tEndOfFramePacket, 4); struct tPedUpdatePacket { @@ -180,7 +178,7 @@ class CReplay int8 assoc_group_id; uint8 weapon_model; }; - static_assert(sizeof(tPedUpdatePacket) == 40, "tPedUpdatePacket: error"); + VALIDATE_SIZE(tPedUpdatePacket, 40); struct tVehicleUpdatePacket { @@ -205,7 +203,7 @@ class CReplay uint8 primary_color; uint8 secondary_color; }; - static_assert(sizeof(tVehicleUpdatePacket) == 48, "tVehicleUpdatePacket: error"); + VALIDATE_SIZE(tVehicleUpdatePacket, 48); private: static uint8 Mode; -- cgit v1.2.3