aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/debug.c
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2023-11-24 04:58:20 -0600
committerLibravatar bigfoot547 <[email protected]>2023-11-24 04:58:20 -0600
commitcb32a721d811caf450f3c55cfb419559d84fa891 (patch)
tree4967bee504cfee63c94fe0b7e7e93566071ffbf0 /src/ui/debug.c
parentadd some menu test code (diff)
not every UI window maps to a curses window
Diffstat (limited to 'src/ui/debug.c')
-rw-r--r--src/ui/debug.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ui/debug.c b/src/ui/debug.c
index f30c12c..6d3ea5d 100644
--- a/src/ui/debug.c
+++ b/src/ui/debug.c
@@ -1,7 +1,6 @@
#ifndef NDEBUG
-#include <assert.h>
-
+#include "../macros.h"
#include "ui.internal.h"
struct ui_window_base *ui__check_cast_to_base(void *obj)
@@ -9,17 +8,24 @@ struct ui_window_base *ui__check_cast_to_base(void *obj)
return obj; /* this cast always succeeds */
}
+struct ui_window_leaf *ui__check_cast_to_leaf(void *obj)
+{
+ struct ui_window_base *base = obj;
+ umps_assert(base->type == UI__WINDOW_TYPE_LEAF);
+ return obj;
+}
+
struct ui_window_dock *ui__check_cast_to_dock(void *obj)
{
struct ui_window_base *base = obj;
- assert(base->type == UI__WINDOW_TYPE_DOCK);
+ umps_assert(base->type == UI__WINDOW_TYPE_DOCK);
return obj;
}
struct ui_window_root *ui__check_cast_to_root(void *obj)
{
struct ui_window_base *base = obj;
- assert(base->type == UI__WINDOW_TYPE_ROOT);
+ umps_assert(base->type == UI__WINDOW_TYPE_ROOT);
return obj;
}