From c7d897c0803e96daf1c6b153c97ffbb5552851a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Fri, 12 Jul 2013 20:40:46 +0200 Subject: [PATCH] Enable some asserts for impossible conditions --- src/timers.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/timers.c b/src/timers.c index b89381b..7db0cc2 100644 --- a/src/timers.c +++ b/src/timers.c @@ -19,11 +19,11 @@ static int timers_cmp(const RBNode *a_, const RBNode *b_) } else if (a->seq > b->seq) { return 1; } else { //should never happen - //assert(0); + assert(0); return 0; } } - //assert(0); + assert(0); return 0; //silence compiler } @@ -56,8 +56,10 @@ void uc_timers_add(struct UCTimers *timers, struct UCTimer *timer, int sec, int struct timeval tmp; assert(timer->callback != NULL); - if (timer->callback == NULL) //must be set. + if (timer->callback == NULL) { //must be set. + assert(timer->callback != NULL); return; + } tmp.tv_sec = sec; tmp.tv_usec = usec;