blob: d4f2e94c6a3ee8213206c599b67e8917607508ef (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#ifndef NDEBUG
#include <assert.h>
#include "ui.internal.h"
struct ui_window_base *ui__check_cast_to_base(void *obj)
{
return obj; /* this cast always succeeds */
}
struct ui_window_dock *ui__check_cast_to_dock(void *obj)
{
struct ui_window_base *base = obj;
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);
return obj;
}
#endif
|