From 5b9566948263e082d10712607855dbde3f760455 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Tue, 23 Dec 2025 20:21:05 +1000 Subject: [PATCH] Assert.hpp --- src/TimeManager.cpp | 2 +- src/assert/{assert.cpp => Assert.cpp} | 2 +- src/assert/{assert.hpp => Assert.hpp} | 10 ---------- src/assert/CMakeLists.txt | 2 +- src/asset/asset.cpp | 2 +- src/asset/type/assetalphaimage.cpp | 2 +- src/asset/type/assetchunk.cpp | 2 +- src/asset/type/assetlanguage.cpp | 2 +- src/asset/type/assetmap.cpp | 2 +- src/asset/type/assetpaletteimage.cpp | 2 +- src/asset/type/assetscript.cpp | 2 +- src/display/camera.cpp | 2 +- src/display/framebuffer.cpp | 2 +- src/display/mesh/mesh.cpp | 2 +- src/display/mesh/quad.cpp | 2 +- src/display/screen.cpp | 2 +- src/display/spritebatch.cpp | 2 +- src/display/texture.cpp | 2 +- src/input/InputManager.cpp | 2 +- src/input/inputaction.cpp | 2 +- src/input/inputbutton.cpp | 2 +- src/locale/localemanager.cpp | 2 +- src/rpg/entity/entity.cpp | 2 +- src/rpg/entity/entitydir.cpp | 2 +- src/rpg/entity/npc.cpp | 2 +- src/rpg/entity/player.cpp | 2 +- src/rpg/rpg.cpp | 2 +- src/rpg/rpgcamera.cpp | 2 +- src/rpg/rpgtextbox.cpp | 2 +- src/rpg/world/map.cpp | 2 +- src/rpg/world/worldpos.cpp | 2 +- src/scene/scene/scenemap.cpp | 2 +- src/scene/scenemanager.cpp | 2 +- src/script/func/scriptfunccamera.hpp | 2 +- src/script/func/scriptfuncentity.hpp | 2 +- src/script/func/scriptfuncsystem.hpp | 2 +- src/script/scriptcontext.cpp | 2 +- src/script/scriptmanager.cpp | 2 +- src/thread/thread.cpp | 2 +- src/ui/ui.cpp | 2 +- src/ui/uiframe.cpp | 2 +- src/ui/uitext.cpp | 2 +- src/util/memory.cpp | 2 +- src/util/string.cpp | 2 +- 44 files changed, 43 insertions(+), 53 deletions(-) rename src/assert/{assert.cpp => Assert.cpp} (98%) rename src/assert/{assert.hpp => Assert.hpp} (95%) diff --git a/src/TimeManager.cpp b/src/TimeManager.cpp index 10e153f..9810a60 100644 --- a/src/TimeManager.cpp +++ b/src/TimeManager.cpp @@ -6,7 +6,7 @@ */ #include "TimeManager.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #if TIME_SDL2 #include diff --git a/src/assert/assert.cpp b/src/assert/Assert.cpp similarity index 98% rename from src/assert/assert.cpp rename to src/assert/Assert.cpp index 185b50a..4be91da 100644 --- a/src/assert/assert.cpp +++ b/src/assert/Assert.cpp @@ -5,7 +5,7 @@ * https://opensource.org/licenses/MIT */ -#include "assert.hpp" +#include "Assert.hpp" #include "debug/debug.hpp" #ifndef ASSERTIONS_FAKED diff --git a/src/assert/assert.hpp b/src/assert/Assert.hpp similarity index 95% rename from src/assert/assert.hpp rename to src/assert/Assert.hpp index fffd463..cb7f17e 100644 --- a/src/assert/assert.hpp +++ b/src/assert/Assert.hpp @@ -96,15 +96,6 @@ const char *message ); - void assertMemoryRangeMatchesImpl( - const char *file, - const int32_t line, - const void *start, - const void *end, - const size_t size, - const char *message - ); - #define assertTrue(x, message) \ assertTrueImpl(__FILE__, __LINE__, x, message) @@ -139,5 +130,4 @@ #define assertDeprecated(message) ((void)0) #define assertStrLenMax(str, len, message) ((void)0) #define assertStrLenMin(str, len, message) ((void)0) - #endif \ No newline at end of file diff --git a/src/assert/CMakeLists.txt b/src/assert/CMakeLists.txt index aa2e40b..4630e32 100644 --- a/src/assert/CMakeLists.txt +++ b/src/assert/CMakeLists.txt @@ -6,5 +6,5 @@ # Sources target_sources(${DUSK_TARGET_NAME} PRIVATE - assert.cpp + Assert.cpp ) \ No newline at end of file diff --git a/src/asset/asset.cpp b/src/asset/asset.cpp index cc3b259..b0004e1 100644 --- a/src/asset/asset.cpp +++ b/src/asset/asset.cpp @@ -8,7 +8,7 @@ #include "asset.hpp" #include "util/memory.hpp" #include "util/string.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "asset/assettype.h" #include "Engine.hpp" #include "debug/debug.hpp" diff --git a/src/asset/type/assetalphaimage.cpp b/src/asset/type/assetalphaimage.cpp index 0bb7276..dbfc1d3 100644 --- a/src/asset/type/assetalphaimage.cpp +++ b/src/asset/type/assetalphaimage.cpp @@ -6,7 +6,7 @@ */ #include "assetalphaimage.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "display/texture.hpp" void assetAlphaImageLoad(void *data, void *output) { diff --git a/src/asset/type/assetchunk.cpp b/src/asset/type/assetchunk.cpp index c85d479..d367460 100644 --- a/src/asset/type/assetchunk.cpp +++ b/src/asset/type/assetchunk.cpp @@ -6,7 +6,7 @@ */ #include "asset/asset.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "rpg/entity/entity.hpp" #pragma pack(push, 1) diff --git a/src/asset/type/assetlanguage.cpp b/src/asset/type/assetlanguage.cpp index bdecfe0..fe9da28 100644 --- a/src/asset/type/assetlanguage.cpp +++ b/src/asset/type/assetlanguage.cpp @@ -6,7 +6,7 @@ */ #include "asset/asset.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "locale/localemanager.hpp" void assetLanguageHandler(assetcustom_t custom) { diff --git a/src/asset/type/assetmap.cpp b/src/asset/type/assetmap.cpp index 3ab75ae..b2d14a9 100644 --- a/src/asset/type/assetmap.cpp +++ b/src/asset/type/assetmap.cpp @@ -6,7 +6,7 @@ */ #include "asset/asset.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "util/memory.hpp" void assetMapLoad(void *data, void *output) { diff --git a/src/asset/type/assetpaletteimage.cpp b/src/asset/type/assetpaletteimage.cpp index ccd883d..1eea6f3 100644 --- a/src/asset/type/assetpaletteimage.cpp +++ b/src/asset/type/assetpaletteimage.cpp @@ -6,7 +6,7 @@ */ #include "assetpaletteimage.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "display/texture.hpp" void assetPaletteImageLoad(void *data, void *output) { diff --git a/src/asset/type/assetscript.cpp b/src/asset/type/assetscript.cpp index 40e8a9e..c861fe7 100644 --- a/src/asset/type/assetscript.cpp +++ b/src/asset/type/assetscript.cpp @@ -6,7 +6,7 @@ */ #include "asset/asset.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" void assetScriptHandler(assetcustom_t custom) { assertNotNull(custom.zipFile, "Custom asset zip file cannot be NULL"); diff --git a/src/display/camera.cpp b/src/display/camera.cpp index b7262b6..3ac7874 100644 --- a/src/display/camera.cpp +++ b/src/display/camera.cpp @@ -7,7 +7,7 @@ #include "camera.hpp" #include "display/display.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "display/framebuffer.hpp" #include "display/screen.hpp" diff --git a/src/display/framebuffer.cpp b/src/display/framebuffer.cpp index 86f85bb..8cf58f1 100644 --- a/src/display/framebuffer.cpp +++ b/src/display/framebuffer.cpp @@ -7,7 +7,7 @@ #include "framebuffer.hpp" #include "display/display.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "util/memory.hpp" framebuffer_t FRAMEBUFFER_BACKBUFFER = {0}; diff --git a/src/display/mesh/mesh.cpp b/src/display/mesh/mesh.cpp index 72d6856..9658b5d 100644 --- a/src/display/mesh/mesh.cpp +++ b/src/display/mesh/mesh.cpp @@ -7,7 +7,7 @@ #include "mesh.hpp" #include "util/memory.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" void meshInit( mesh_t *mesh, diff --git a/src/display/mesh/quad.cpp b/src/display/mesh/quad.cpp index 1420b36..c41579e 100644 --- a/src/display/mesh/quad.cpp +++ b/src/display/mesh/quad.cpp @@ -6,7 +6,7 @@ */ #include "quad.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" mesh_t QUAD_MESH_SIMPLE; meshvertex_t QUAD_MESH_SIMPLE_VERTICES[QUAD_VERTEX_COUNT] = { diff --git a/src/display/screen.cpp b/src/display/screen.cpp index 80329f3..1530d4c 100644 --- a/src/display/screen.cpp +++ b/src/display/screen.cpp @@ -6,7 +6,7 @@ */ #include "screen.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "util/memory.hpp" #include "display/mesh/quad.hpp" diff --git a/src/display/spritebatch.cpp b/src/display/spritebatch.cpp index 5585a0c..e8e03c3 100644 --- a/src/display/spritebatch.cpp +++ b/src/display/spritebatch.cpp @@ -6,7 +6,7 @@ */ #include "spritebatch.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "util/memory.hpp" spritebatch_t SPRITEBATCH; diff --git a/src/display/texture.cpp b/src/display/texture.cpp index 722218c..410a5f7 100644 --- a/src/display/texture.cpp +++ b/src/display/texture.cpp @@ -6,7 +6,7 @@ */ #include "texture.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "util/memory.hpp" #include "util/math.hpp" #include "display/palette/palettelist.hpp" diff --git a/src/input/InputManager.cpp b/src/input/InputManager.cpp index 8025821..cbaf4a2 100644 --- a/src/input/InputManager.cpp +++ b/src/input/InputManager.cpp @@ -6,7 +6,7 @@ */ #include "InputManager.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "util/memory.hpp" #include "util/string.hpp" #include "util/math.hpp" diff --git a/src/input/inputaction.cpp b/src/input/inputaction.cpp index 40fd869..72325a0 100644 --- a/src/input/inputaction.cpp +++ b/src/input/inputaction.cpp @@ -6,7 +6,7 @@ */ #include "inputaction.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "util/string.hpp" // inputaction_t inputActionGetByName(const char_t *name) { diff --git a/src/input/inputbutton.cpp b/src/input/inputbutton.cpp index 87ff19c..446cea3 100644 --- a/src/input/inputbutton.cpp +++ b/src/input/inputbutton.cpp @@ -7,7 +7,7 @@ #include "inputbutton.hpp" #include "InputManager.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "util/string.hpp" inputbuttondata_t INPUT_BUTTON_DATA[] = { diff --git a/src/locale/localemanager.cpp b/src/locale/localemanager.cpp index dff21ac..d888688 100644 --- a/src/locale/localemanager.cpp +++ b/src/locale/localemanager.cpp @@ -8,7 +8,7 @@ #include "localemanager.hpp" #include "util/memory.hpp" #include "asset/asset.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" localemanager_t LOCALE; diff --git a/src/rpg/entity/entity.cpp b/src/rpg/entity/entity.cpp index e86c446..299daf9 100644 --- a/src/rpg/entity/entity.cpp +++ b/src/rpg/entity/entity.cpp @@ -6,7 +6,7 @@ */ #include "entity.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "util/memory.hpp" #include "util/math.hpp" #include "rpg/cutscene/cutscenemode.hpp" diff --git a/src/rpg/entity/entitydir.cpp b/src/rpg/entity/entitydir.cpp index 435e1f9..09001a4 100644 --- a/src/rpg/entity/entitydir.cpp +++ b/src/rpg/entity/entitydir.cpp @@ -6,7 +6,7 @@ */ #include "entitydir.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" entitydir_t entityDirGetOpposite(const entitydir_t dir) { switch(dir) { diff --git a/src/rpg/entity/npc.cpp b/src/rpg/entity/npc.cpp index 9d73081..115a77c 100644 --- a/src/rpg/entity/npc.cpp +++ b/src/rpg/entity/npc.cpp @@ -6,7 +6,7 @@ */ #include "entity.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "rpg/cutscene/scene/testcutscene.hpp" #include "rpg/rpgtextbox.hpp" diff --git a/src/rpg/entity/player.cpp b/src/rpg/entity/player.cpp index fa96f01..0b96ea5 100644 --- a/src/rpg/entity/player.cpp +++ b/src/rpg/entity/player.cpp @@ -6,7 +6,7 @@ */ #include "entity.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "rpg/rpgcamera.hpp" #include "Engine.hpp" diff --git a/src/rpg/rpg.cpp b/src/rpg/rpg.cpp index 91902f7..5198316 100644 --- a/src/rpg/rpg.cpp +++ b/src/rpg/rpg.cpp @@ -12,7 +12,7 @@ #include "rpgcamera.hpp" #include "rpgtextbox.hpp" #include "util/memory.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "Engine.hpp" using namespace Dusk; diff --git a/src/rpg/rpgcamera.cpp b/src/rpg/rpgcamera.cpp index 9e624f2..dc51ba7 100644 --- a/src/rpg/rpgcamera.cpp +++ b/src/rpg/rpgcamera.cpp @@ -9,7 +9,7 @@ #include "util/memory.hpp" #include "rpg/entity/entity.hpp" #include "rpg/world/map.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" rpgcamera_t RPG_CAMERA; diff --git a/src/rpg/rpgtextbox.cpp b/src/rpg/rpgtextbox.cpp index 0eb4986..f5aec88 100644 --- a/src/rpg/rpgtextbox.cpp +++ b/src/rpg/rpgtextbox.cpp @@ -8,7 +8,7 @@ #include "rpgtextbox.hpp" #include "util/memory.hpp" #include "util/string.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" rpgtextbox_t RPG_TEXTBOX; diff --git a/src/rpg/world/map.cpp b/src/rpg/world/map.cpp index 5b1aefb..5968fcf 100644 --- a/src/rpg/world/map.cpp +++ b/src/rpg/world/map.cpp @@ -7,7 +7,7 @@ #include "map.hpp" #include "util/memory.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "asset/asset.hpp" #include "rpg/entity/entity.hpp" diff --git a/src/rpg/world/worldpos.cpp b/src/rpg/world/worldpos.cpp index c550904..da7413b 100644 --- a/src/rpg/world/worldpos.cpp +++ b/src/rpg/world/worldpos.cpp @@ -6,7 +6,7 @@ */ #include "worldpos.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" bool_t worldPosIsEqual(const worldpos_t a, const worldpos_t b) { return a.x == b.x && a.y == b.y && a.z == b.z; diff --git a/src/scene/scene/scenemap.cpp b/src/scene/scene/scenemap.cpp index 2c1c7e4..7d90681 100644 --- a/src/scene/scene/scenemap.cpp +++ b/src/scene/scene/scenemap.cpp @@ -8,7 +8,7 @@ #include "scenemap.hpp" #include "scene/scenedata.hpp" #include "display/spritebatch.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "asset/asset.hpp" #include "rpg/entity/entity.hpp" #include "rpg/world/map.hpp" diff --git a/src/scene/scenemanager.cpp b/src/scene/scenemanager.cpp index 1b1354c..94ab557 100644 --- a/src/scene/scenemanager.cpp +++ b/src/scene/scenemanager.cpp @@ -7,7 +7,7 @@ #include "scenemanager.hpp" #include "util/memory.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "display/framebuffer.hpp" #include "util/string.hpp" diff --git a/src/script/func/scriptfunccamera.hpp b/src/script/func/scriptfunccamera.hpp index ac0ebbc..ccd1d26 100644 --- a/src/script/func/scriptfunccamera.hpp +++ b/src/script/func/scriptfunccamera.hpp @@ -7,7 +7,7 @@ #pragma once #include "script/scriptcontext.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" diff --git a/src/script/func/scriptfuncentity.hpp b/src/script/func/scriptfuncentity.hpp index 66ec082..d484c0d 100644 --- a/src/script/func/scriptfuncentity.hpp +++ b/src/script/func/scriptfuncentity.hpp @@ -8,7 +8,7 @@ #pragma once #include "script/scriptcontext.hpp" #include "rpg/entity/entity.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" int32_t scriptFuncEntityAdd(lua_State *L) { assertNotNull(L, "Lua state cannot be NULL"); diff --git a/src/script/func/scriptfuncsystem.hpp b/src/script/func/scriptfuncsystem.hpp index 6c44078..4618dd4 100644 --- a/src/script/func/scriptfuncsystem.hpp +++ b/src/script/func/scriptfuncsystem.hpp @@ -8,7 +8,7 @@ #pragma once #include "script/scriptcontext.hpp" #include "debug/debug.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" int32_t scriptContextPrint(lua_State *L) { assertNotNull(L, "Lua state cannot be NULL"); diff --git a/src/script/scriptcontext.cpp b/src/script/scriptcontext.cpp index 4c1ca83..0f3c9a3 100644 --- a/src/script/scriptcontext.cpp +++ b/src/script/scriptcontext.cpp @@ -6,7 +6,7 @@ */ #include "scriptcontext.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "asset/asset.hpp" #include "util/memory.hpp" #include "debug/debug.hpp" diff --git a/src/script/scriptmanager.cpp b/src/script/scriptmanager.cpp index 59b1c47..309e471 100644 --- a/src/script/scriptmanager.cpp +++ b/src/script/scriptmanager.cpp @@ -7,7 +7,7 @@ #include "scriptmanager.hpp" #include "util/memory.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "debug/debug.hpp" #include "asset/asset.hpp" diff --git a/src/thread/thread.cpp b/src/thread/thread.cpp index b1841a9..97cb479 100644 --- a/src/thread/thread.cpp +++ b/src/thread/thread.cpp @@ -7,7 +7,7 @@ #include "thread.hpp" #include "util/memory.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" void threadInit(thread_t *thread, const threadcallback_t callback) { assertNotNull(thread, "Thread cannot be NULL."); diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index 1ddc80e..66092e7 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -6,7 +6,7 @@ */ #include "ui.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "ui/uidebug.hpp" #include "util/memory.hpp" #include "display/tileset/tileset_minogram.hpp" diff --git a/src/ui/uiframe.cpp b/src/ui/uiframe.cpp index bb18898..5c15beb 100644 --- a/src/ui/uiframe.cpp +++ b/src/ui/uiframe.cpp @@ -7,7 +7,7 @@ #include "uiframe.hpp" #include "display/spritebatch.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include void uiFrameDraw( diff --git a/src/ui/uitext.cpp b/src/ui/uitext.cpp index 113d51c..52f15fb 100644 --- a/src/ui/uitext.cpp +++ b/src/ui/uitext.cpp @@ -6,7 +6,7 @@ // */ #include "uitext.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "util/memory.hpp" #include "display/spritebatch.hpp" diff --git a/src/util/memory.cpp b/src/util/memory.cpp index 9553fd5..e4e7045 100644 --- a/src/util/memory.cpp +++ b/src/util/memory.cpp @@ -6,7 +6,7 @@ */ #include "memory.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" void * memoryAllocate(const size_t size) { assertTrue(size > 0, "Cannot allocate 0 bytes of memory."); diff --git a/src/util/string.cpp b/src/util/string.cpp index 31df77a..260f1f6 100644 --- a/src/util/string.cpp +++ b/src/util/string.cpp @@ -6,7 +6,7 @@ */ #include "string.hpp" -#include "assert/assert.hpp" +#include "assert/Assert.hpp" #include "util/memory.hpp" bool_t stringIsWhitespace(const char_t c) {