diff options
Diffstat (limited to 'sys/nfs/xdr_subs.h')
-rw-r--r-- | sys/nfs/xdr_subs.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/nfs/xdr_subs.h b/sys/nfs/xdr_subs.h index 69ea301bebe..80b8b2ad1fd 100644 --- a/sys/nfs/xdr_subs.h +++ b/sys/nfs/xdr_subs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: xdr_subs.h,v 1.8 2003/06/02 23:28:20 millert Exp $ */ +/* $OpenBSD: xdr_subs.h,v 1.9 2013/08/13 05:52:25 guenther Exp $ */ /* $NetBSD: xdr_subs.h,v 1.11 1996/02/18 11:54:12 fvdl Exp $ */ /* @@ -53,38 +53,38 @@ #define fxdr_unsigned(t, v) ((t)ntohl((int32_t)(v))) #define txdr_unsigned(v) (htonl((int32_t)(v))) -#define fxdr_nfsv2time(f, t) { \ +#define fxdr_nfsv2time(f, t) do { \ (t)->tv_sec = ntohl(((struct nfsv2_time *)(f))->nfsv2_sec); \ if (((struct nfsv2_time *)(f))->nfsv2_usec != 0xffffffff) \ (t)->tv_nsec = 1000 * ntohl(((struct nfsv2_time *)(f))->nfsv2_usec); \ else \ (t)->tv_nsec = 0; \ -} -#define txdr_nfsv2time(f, t) { \ +} while (0) +#define txdr_nfsv2time(f, t) do { \ ((struct nfsv2_time *)(t))->nfsv2_sec = htonl((f)->tv_sec); \ if ((f)->tv_nsec != -1) \ ((struct nfsv2_time *)(t))->nfsv2_usec = htonl((f)->tv_nsec / 1000); \ else \ ((struct nfsv2_time *)(t))->nfsv2_usec = 0xffffffff; \ -} +} while (0) -#define fxdr_nfsv3time(f, t) { \ +#define fxdr_nfsv3time(f, t) do { \ (t)->tv_sec = ntohl(((struct nfsv3_time *)(f))->nfsv3_sec); \ (t)->tv_nsec = ntohl(((struct nfsv3_time *)(f))->nfsv3_nsec); \ -} -#define txdr_nfsv3time(f, t) { \ +} while (0) +#define txdr_nfsv3time(f, t) do { \ ((struct nfsv3_time *)(t))->nfsv3_sec = htonl((f)->tv_sec); \ ((struct nfsv3_time *)(t))->nfsv3_nsec = htonl((f)->tv_nsec); \ -} +} while (0) #define fxdr_hyper(f) \ ((((u_quad_t)ntohl(((u_int32_t *)(f))[0])) << 32) | \ (u_quad_t)(ntohl(((u_int32_t *)(f))[1]))) -#define txdr_hyper(f, t) { \ +#define txdr_hyper(f, t) do { \ ((u_int32_t *)(t))[0] = htonl((u_int32_t)((f) >> 32)); \ ((u_int32_t *)(t))[1] = htonl((u_int32_t)((f) & 0xffffffff)); \ -} +} while (0) #endif |