Save a few bytes on memset()
This commit is contained in:
parent
19c8614ae8
commit
a9cd2a86df
1 changed files with 7 additions and 7 deletions
|
@ -75,18 +75,18 @@ hexagram_schedule *hexagram_schedule_create(hexagram_schedule_table_entry *table
|
||||||
goto error_malloc_schedule;
|
goto error_malloc_schedule;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(schedule, '\0', sizeof(*schedule));
|
memset(&schedule->ev, '\0', sizeof(struct sigevent));
|
||||||
|
|
||||||
schedule->current = 0;
|
|
||||||
schedule->error = 0;
|
|
||||||
schedule->count = count;
|
|
||||||
schedule->table = table;
|
|
||||||
schedule->ctx = ctx;
|
|
||||||
|
|
||||||
schedule->ev.sigev_notify = SIGEV_THREAD;
|
schedule->ev.sigev_notify = SIGEV_THREAD;
|
||||||
schedule->ev.sigev_notify_function = _ev_notify;
|
schedule->ev.sigev_notify_function = _ev_notify;
|
||||||
schedule->ev.sigev_value.sival_ptr = schedule;
|
schedule->ev.sigev_value.sival_ptr = schedule;
|
||||||
|
|
||||||
|
schedule->current = 0;
|
||||||
|
schedule->count = count;
|
||||||
|
schedule->table = table;
|
||||||
|
schedule->ctx = ctx;
|
||||||
|
schedule->error = 0;
|
||||||
|
|
||||||
if (timer_create(CLOCK_REALTIME, &schedule->ev, &schedule->timer) < 0) {
|
if (timer_create(CLOCK_REALTIME, &schedule->ev, &schedule->timer) < 0) {
|
||||||
goto error_timer_create;
|
goto error_timer_create;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue