From ba381497cc0b81517e63a4b8df51cc081b531bac Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Mon, 29 Jul 2024 22:40:54 +0200 Subject: [PATCH] vkd3d-common: Remove an assertion in vkd3d_dbg_printf(). We want to get rid of assertions and only use the new VKD3D_ASSERT(), but this cannot be done here, because a failing VKD3D_ASSERT() would call back again to vkd3d_dbg_printf(). At the same time the asserted condition should be simple enough to debug even without the assertion, since logging with a bad level will likely result in either a crash or writing garbage to the log. --- libs/vkd3d-common/debug.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libs/vkd3d-common/debug.c b/libs/vkd3d-common/debug.c index cc5138d1..4bfc19bd 100644 --- a/libs/vkd3d-common/debug.c +++ b/libs/vkd3d-common/debug.c @@ -105,8 +105,6 @@ void vkd3d_dbg_printf(enum vkd3d_dbg_level level, const char *function, const ch if (vkd3d_dbg_get_level() < level) return; - assert(level < ARRAY_SIZE(debug_level_names)); - #ifdef _WIN32 vkd3d_dbg_output("vkd3d:%04lx:%s:%s ", GetCurrentThreadId(), debug_level_names[level], function); #elif HAVE_GETTID