From e3c53cce47d8790db280dd0c749c508f284d8997 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Tue, 14 Feb 2006 09:33:51 +0000 Subject: [PATCH] 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. --- usr.bin/systat/vmstat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index 54c19f3da6a4..ba41b258d870 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] = { '=' , '+', '>', '-', ' ' };