wrap multiline macro by do {} while (0)

This commit is contained in:
itojun 2003-05-14 16:57:03 +00:00
parent caa10ced69
commit f53c3317b8
1 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ip_mroute.c,v 1.68 2003/05/14 16:52:53 itojun Exp $ */ /* $NetBSD: ip_mroute.c,v 1.69 2003/05/14 16:57:03 itojun Exp $ */
/* /*
* Copyright (c) 1989 Stephen Deering * Copyright (c) 1989 Stephen Deering
@ -54,7 +54,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.68 2003/05/14 16:52:53 itojun Exp $"); __KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.69 2003/05/14 16:57:03 itojun Exp $");
#include "opt_ipsec.h" #include "opt_ipsec.h"
@ -243,7 +243,7 @@ static int pim_assert;
* Type of service parameter to be added in the future!!! * Type of service parameter to be added in the future!!!
*/ */
#define MFCFIND(o, g, rt) { \ #define MFCFIND(o, g, rt) do { \
struct mfc *_rt; \ struct mfc *_rt; \
(rt) = 0; \ (rt) = 0; \
++mrtstat.mrts_mfc_lookups; \ ++mrtstat.mrts_mfc_lookups; \
@ -257,13 +257,13 @@ static int pim_assert;
} \ } \
if ((rt) == 0) \ if ((rt) == 0) \
++mrtstat.mrts_mfc_misses; \ ++mrtstat.mrts_mfc_misses; \
} } while (/*CONSTCOND*/ 0)
/* /*
* Macros to compute elapsed time efficiently * Macros to compute elapsed time efficiently
* Borrowed from Van Jacobson's scheduling code * Borrowed from Van Jacobson's scheduling code
*/ */
#define TV_DELTA(a, b, delta) { \ #define TV_DELTA(a, b, delta) do { \
int xxs; \ int xxs; \
delta = (a).tv_usec - (b).tv_usec; \ delta = (a).tv_usec - (b).tv_usec; \
xxs = (a).tv_sec - (b).tv_sec; \ xxs = (a).tv_sec - (b).tv_sec; \
@ -280,7 +280,7 @@ static int pim_assert;
delta += (1000000 * xxs); \ delta += (1000000 * xxs); \
break; \ break; \
} \ } \
} } while (/*CONSTCOND*/ 0)
#ifdef UPCALL_TIMING #ifdef UPCALL_TIMING
u_int32_t upcall_data[51]; u_int32_t upcall_data[51];