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) {
|
} else if (a->seq > b->seq) {
|
||||||
return 1;
|
return 1;
|
||||||
} else { //should never happen
|
} else { //should never happen
|
||||||
//assert(0);
|
assert(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//assert(0);
|
assert(0);
|
||||||
return 0; //silence compiler
|
return 0; //silence compiler
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,8 +56,10 @@ void uc_timers_add(struct UCTimers *timers, struct UCTimer *timer, int sec, int
|
|||||||
struct timeval tmp;
|
struct timeval tmp;
|
||||||
|
|
||||||
assert(timer->callback != NULL);
|
assert(timer->callback != NULL);
|
||||||
if (timer->callback == NULL) //must be set.
|
if (timer->callback == NULL) { //must be set.
|
||||||
|
assert(timer->callback != NULL);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
tmp.tv_sec = sec;
|
tmp.tv_sec = sec;
|
||||||
tmp.tv_usec = usec;
|
tmp.tv_usec = usec;
|
||||||
|
|||||||
Reference in New Issue
Block a user