Enable some asserts for impossible conditions
This commit is contained in:
+5
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user