diff options
author | bde <bde@FreeBSD.org> | 2006-02-14 09:33:51 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2006-02-14 09:33:51 +0000 |
commit | 029c695050a834817802343861a0577b7e89fd40 (patch) | |
tree | b27b8ccf1f9146514113b0248f8532e860d0b6aa /usr.bin/systat/vmstat.c | |
parent | 28ce501630728a124bb29845fd7be02d1f41a3a1 (diff) | |
download | FreeBSD-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.
Diffstat (limited to 'usr.bin/systat/vmstat.c')
-rw-r--r-- | usr.bin/systat/vmstat.c | 4 |
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] = { '=' , '+', '>', '-', ' ' }; |