From: jca Date: Mon, 11 Dec 2017 23:31:16 +0000 (+0000) Subject: Proper do {} while (0) idiom in TIMESPEC_TO_TIMEVAL/TIMEVAL_TO_TIMESPEC X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bf42a57297a7820ffb58f87be4ec0f4da6006cdb;p=openbsd Proper do {} while (0) idiom in TIMESPEC_TO_TIMEVAL/TIMEVAL_TO_TIMESPEC From Scott Cheloha, ok tb@ --- 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 */