From a89afe61f24dedf364b5146d9f404a45826c339a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 17 Oct 2020 10:18:37 +0200 Subject: [PATCH] - use a few static asserts instead of runtime asserts in the VM's type code. --- src/common/scripting/core/types.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/scripting/core/types.cpp b/src/common/scripting/core/types.cpp index 447af4601..3b7057acb 100644 --- a/src/common/scripting/core/types.cpp +++ b/src/common/scripting/core/types.cpp @@ -1042,7 +1042,7 @@ PName::PName() { mDescriptiveName = "Name"; Flags |= TYPE_IntNotInt; - assert(sizeof(FName) == alignof(FName)); + static_assert(sizeof(FName) == alignof(FName), "Name not properly aligned"); } //========================================================================== @@ -1172,7 +1172,7 @@ PTextureID::PTextureID() { mDescriptiveName = "TextureID"; Flags |= TYPE_IntNotInt; - assert(sizeof(FTextureID) == alignof(FTextureID)); + static_assert(sizeof(FTextureID) == alignof(FTextureID), "TextureID not properly aligned"); } //========================================================================== @@ -1214,7 +1214,7 @@ PSound::PSound() { mDescriptiveName = "Sound"; Flags |= TYPE_IntNotInt; - assert(sizeof(FSoundID) == alignof(FSoundID)); + static_assert(sizeof(FSoundID) == alignof(FSoundID), "SoundID not properly aligned"); } //========================================================================== @@ -1263,7 +1263,7 @@ PColor::PColor() { mDescriptiveName = "Color"; Flags |= TYPE_IntNotInt; - assert(sizeof(PalEntry) == alignof(PalEntry)); + static_assert(sizeof(PalEntry) == alignof(PalEntry), "PalEntry not properly aligned"); } /* PStateLabel *****************************************************************/