Refactor: move private watcher members to a union

This will save a few bytes of stack/heap for users.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2016-10-30 10:58:29 +01:00
1 parent 1f6fa93314
commit e5bc49a8e6
4 files changed
+21 -14

No files matched your search

+12 -5
View File
@@ -61,12 +61,19 @@ struct uev;
void (*cb)(struct uev *, void *, int); \
void *arg; \
\
/* Timer watchers, time in milliseconds */ \
int timeout; \
int period; \
/* Arguments for different watchers */ \
union { \
/* Timer watchers, time in milliseconds */ \
struct { \
int timeout; \
int period; \
} t; \
\
/* Signal watchers */ \
int signo; \
/* Signal watchers */ \
struct { \
int signo; \
} s; \
} u; \
\
/* Watcher type */ \
uev_type_t