summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2006-02-14 09:33:51 +0000
committerbde <bde@FreeBSD.org>2006-02-14 09:33:51 +0000
commit029c695050a834817802343861a0577b7e89fd40 (patch)
treeb27b8ccf1f9146514113b0248f8532e860d0b6aa
parent28ce501630728a124bb29845fd7be02d1f41a3a1 (diff)
downloadFreeBSD-src-029c695050a834817802343861a0577b7e89fd40.zip
FreeBSD-src-029c695050a834817802343861a0577b7e89fd40.tar.gz
Oops, the "excessive" {} removed in the previous commit was needed
around PUTRATE() because PUTRATE() only looked like a function -- it was multiple statements. Use "do {...} while(0)" as usual in PUTRATE() so that it is a single statement that can be used like a function.
-rw-r--r--usr.bin/systat/vmstat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index 54c19f3..ba41b25 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -381,8 +381,10 @@ labelkre()
#define Z(fld) {t = s.nchstats.fld; s.nchstats.fld -= s1.nchstats.fld; \
if(state == TIME) s1.nchstats.fld = t;}
#define PUTRATE(fld, l, c, w) \
+do { \
Y(fld); \
- putint((int)((float)s.fld/etime + 0.5), l, c, w)
+ putint((int)((float)s.fld/etime + 0.5), l, c, w); \
+} while (0)
#define MAXFAIL 5
static char cpuchar[CPUSTATES] = { '=' , '+', '>', '-', ' ' };
OpenPOWER on IntegriCloud