mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-01 22:58:40 -04:00
src: switch asserts to wl_abort
assert()s can be compiled away by #defining NDEBUG. Some build systems do this. Using wl_abort gives a human readable error message and it isn't compiled away. This commit closes issue #230. Signed-off-by: meltq <tejasvipin76@gmail.com>
This commit is contained in:
parent
fa1811ce3e
commit
0cecde304f
5 changed files with 36 additions and 16 deletions
|
|
@ -447,7 +447,8 @@ wl_timer_heap_disarm(struct wl_timer_heap *timers,
|
|||
struct wl_event_source_timer *last_end_evt;
|
||||
int old_source_idx;
|
||||
|
||||
assert(source->heap_idx >= 0);
|
||||
if (!(source->heap_idx >= 0))
|
||||
wl_abort("Timer has already been disarmed\n");
|
||||
|
||||
old_source_idx = source->heap_idx;
|
||||
source->heap_idx = -1;
|
||||
|
|
@ -476,7 +477,8 @@ wl_timer_heap_arm(struct wl_timer_heap *timers,
|
|||
struct wl_event_source_timer *source,
|
||||
struct timespec deadline)
|
||||
{
|
||||
assert(source->heap_idx == -1);
|
||||
if (!(source->heap_idx == -1))
|
||||
wl_abort("Timer is already armed\n");
|
||||
|
||||
source->deadline = deadline;
|
||||
timers->data[timers->active] = source;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue