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/entities/Building.h | 3 +++ src/entities/Dummy.h | 3 +++ src/entities/Entity.h | 3 +++ src/entities/Physical.h | 3 +++ src/entities/Treadable.h | 3 +++ 5 files changed, 15 insertions(+) (limited to 'src/entities') diff --git a/src/entities/Building.h b/src/entities/Building.h index 7b837f46..50818189 100644 --- a/src/entities/Building.h +++ b/src/entities/Building.h @@ -16,4 +16,7 @@ public: virtual bool GetIsATreadable(void) { return false; } }; + +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(CBuilding) == 0x64, "CBuilding: error"); +#endif diff --git a/src/entities/Dummy.h b/src/entities/Dummy.h index fcfd23fb..de0e448b 100644 --- a/src/entities/Dummy.h +++ b/src/entities/Dummy.h @@ -15,4 +15,7 @@ public: static void *operator new(size_t); static void operator delete(void*, size_t); }; + +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(CDummy) == 0x68, "CDummy: error"); +#endif diff --git a/src/entities/Entity.h b/src/entities/Entity.h index 330fde69..18254ae4 100644 --- a/src/entities/Entity.h +++ b/src/entities/Entity.h @@ -172,4 +172,7 @@ public: static void AddSteamsFromGround(CPtrList& list); }; + +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(CEntity) == 0x64, "CEntity: error"); +#endif \ No newline at end of file diff --git a/src/entities/Physical.h b/src/entities/Physical.h index b47d556e..c9b7402b 100644 --- a/src/entities/Physical.h +++ b/src/entities/Physical.h @@ -160,4 +160,7 @@ public: bool CheckCollision(void); bool CheckCollision_SimpleCar(void); }; + +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(CPhysical) == 0x128, "CPhysical: error"); +#endif diff --git a/src/entities/Treadable.h b/src/entities/Treadable.h index 9e4de59a..272b2d4b 100644 --- a/src/entities/Treadable.h +++ b/src/entities/Treadable.h @@ -12,4 +12,7 @@ public: bool GetIsATreadable(void) { return true; } }; + +#ifdef CHECK_STRUCT_SIZES static_assert(sizeof(CTreadable) == 0x94, "CTreadable: error"); +#endif -- 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/entities/Building.h | 5 ++--- src/entities/Dummy.h | 5 ++--- src/entities/Entity.h | 4 +--- src/entities/Physical.h | 4 +--- src/entities/Treadable.h | 5 ++--- 5 files changed, 8 insertions(+), 15 deletions(-) (limited to 'src/entities') diff --git a/src/entities/Building.h b/src/entities/Building.h index 50818189..3586a8dc 100644 --- a/src/entities/Building.h +++ b/src/entities/Building.h @@ -17,6 +17,5 @@ public: virtual bool GetIsATreadable(void) { return false; } }; -#ifdef CHECK_STRUCT_SIZES -static_assert(sizeof(CBuilding) == 0x64, "CBuilding: error"); -#endif +VALIDATE_SIZE(CBuilding, 0x64); + diff --git a/src/entities/Dummy.h b/src/entities/Dummy.h index de0e448b..3717a01c 100644 --- a/src/entities/Dummy.h +++ b/src/entities/Dummy.h @@ -16,6 +16,5 @@ public: static void operator delete(void*, size_t); }; -#ifdef CHECK_STRUCT_SIZES -static_assert(sizeof(CDummy) == 0x68, "CDummy: error"); -#endif +VALIDATE_SIZE(CDummy, 0x68); + diff --git a/src/entities/Entity.h b/src/entities/Entity.h index 18254ae4..eca462cd 100644 --- a/src/entities/Entity.h +++ b/src/entities/Entity.h @@ -173,6 +173,4 @@ public: static void AddSteamsFromGround(CPtrList& list); }; -#ifdef CHECK_STRUCT_SIZES -static_assert(sizeof(CEntity) == 0x64, "CEntity: error"); -#endif \ No newline at end of file +VALIDATE_SIZE(CEntity, 0x64); diff --git a/src/entities/Physical.h b/src/entities/Physical.h index c9b7402b..c84686ed 100644 --- a/src/entities/Physical.h +++ b/src/entities/Physical.h @@ -161,6 +161,4 @@ public: bool CheckCollision_SimpleCar(void); }; -#ifdef CHECK_STRUCT_SIZES -static_assert(sizeof(CPhysical) == 0x128, "CPhysical: error"); -#endif +VALIDATE_SIZE(CPhysical, 0x128); diff --git a/src/entities/Treadable.h b/src/entities/Treadable.h index 272b2d4b..c3160f47 100644 --- a/src/entities/Treadable.h +++ b/src/entities/Treadable.h @@ -13,6 +13,5 @@ public: bool GetIsATreadable(void) { return true; } }; -#ifdef CHECK_STRUCT_SIZES -static_assert(sizeof(CTreadable) == 0x94, "CTreadable: error"); -#endif +VALIDATE_SIZE(CTreadable, 0x94); + -- cgit v1.2.3