From a9cd2a86dfad0084bd91a50ec08bd9f2ab125c99 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Wed, 27 Dec 2023 14:16:33 -0500 Subject: [PATCH] Save a few bytes on memset() --- src/schedule.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/schedule.c b/src/schedule.c index 4a33789..e800f32 100644 --- a/src/schedule.c +++ b/src/schedule.c @@ -75,18 +75,18 @@ hexagram_schedule *hexagram_schedule_create(hexagram_schedule_table_entry *table goto error_malloc_schedule; } - memset(schedule, '\0', sizeof(*schedule)); - - schedule->current = 0; - schedule->error = 0; - schedule->count = count; - schedule->table = table; - schedule->ctx = ctx; + memset(&schedule->ev, '\0', sizeof(struct sigevent)); schedule->ev.sigev_notify = SIGEV_THREAD; schedule->ev.sigev_notify_function = _ev_notify; 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) { goto error_timer_create; }