diff options
author | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2017-12-11 23:31:17 +0000 |
---|---|---|
committer | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2017-12-11 23:31:17 +0000 |
commit | ec6cfaf2251f415a0ab4a9d17324623263e03776 (patch) | |
tree | 62f771bc3e7abbfeedb4d7cc1273a65d19717db4 /sys | |
parent | 52f16818c1bb0e4d61b66af08bd5f7e7d94d0672 (diff) |
Proper do {} while (0) idiom in TIMESPEC_TO_TIMEVAL/TIMEVAL_TO_TIMESPEC
From Scott Cheloha, ok tb@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/time.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/sys/time.h b/sys/sys/time.h index e2e1dd6bf5f..7bd9994d683 100644 --- a/sys/sys/time.h +++ b/sys/sys/time.h @@ -1,4 +1,4 @@ -/* $OpenBSD: time.h,v 1.36 2016/09/12 19:41:20 guenther Exp $ */ +/* $OpenBSD: time.h,v 1.37 2017/12/11 23:31:16 jca Exp $ */ /* $NetBSD: time.h,v 1.18 1996/04/23 10:29:33 mycroft Exp $ */ /* @@ -60,14 +60,14 @@ struct timespec { }; #endif -#define TIMEVAL_TO_TIMESPEC(tv, ts) { \ +#define TIMEVAL_TO_TIMESPEC(tv, ts) do { \ (ts)->tv_sec = (tv)->tv_sec; \ (ts)->tv_nsec = (tv)->tv_usec * 1000; \ -} -#define TIMESPEC_TO_TIMEVAL(tv, ts) { \ +} while (0) +#define TIMESPEC_TO_TIMEVAL(tv, ts) do { \ (tv)->tv_sec = (ts)->tv_sec; \ (tv)->tv_usec = (ts)->tv_nsec / 1000; \ -} +} while (0) struct timezone { int tz_minuteswest; /* minutes west of Greenwich */ |