Enable some asserts for impossible conditions

This commit is contained in:
Nils O. Selåsdal
2013-07-12 20:40:46 +02:00
parent 1281533884
commit c7d897c080
+5 -3
View File
@@ -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;