Commit 73524df7 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(sys_on_time): Moved the assert statement to after all variable declarations.

(sys_on_signal): Ditto.
parent 87ec1b54
......@@ -117,9 +117,9 @@ static void sys_cancel_fd(oop_source *source,int fd,oop_event ev) {
static void sys_on_time(oop_source *source,struct timeval tv,
oop_call_time *f,void *v) {
oop_source_sys *sys = verify_source(source);
assert(NULL != f && "callback must be non-NULL");
struct sys_time **p = &sys->time_queue;
struct sys_time *time = oop_malloc(sizeof(struct sys_time));
assert(NULL != f && "callback must be non-NULL");
if (NULL == time) return; /* ugh */
time->tv = tv;
time->f = f;
......@@ -187,8 +187,8 @@ static void sys_signal_handler(int sig) {
static void sys_on_signal(oop_source *source,int sig,
oop_call_signal *f,void *v) {
oop_source_sys *sys = verify_source(source);
assert(NULL != f && "callback must be non-NULL");
struct sys_signal_handler *handler = oop_malloc(sizeof(*handler));
assert(NULL != f && "callback must be non-NULL");
if (NULL == handler) return; /* ugh */
assert(sig > 0 && sig < OOP_NUM_SIGNALS && "invalid signal number");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment