mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-24 15:15:44 +00:00
Enclose macro arguments in parentheses
This commit is contained in:
parent
ab17ef4dc0
commit
15652e7b81
@ -27,7 +27,7 @@ in the source distribution for its full text.
|
||||
#define CharType cchar_t
|
||||
#else
|
||||
#define RichString_printVal(this, y, x) mvaddchstr(y, x, (this).chptr)
|
||||
#define RichString_printoffnVal(this, y, x, off, n) mvaddchnstr(y, x, (this).chptr + off, n)
|
||||
#define RichString_printoffnVal(this, y, x, off, n) mvaddchnstr(y, x, (this).chptr + (off), n)
|
||||
#define RichString_getCharVal(this, i) ((this).chptr[i])
|
||||
#define RichString_setChar(this, at, ch) do{ (this)->chptr[(at)] = ch; } while(0)
|
||||
#define CharType chtype
|
||||
|
@ -778,8 +778,8 @@ static int handleNetlinkMsg(struct nl_msg *nlmsg, void *linuxProcess) {
|
||||
assert(lp->super.pid == (pid_t)stats.ac_pid);
|
||||
|
||||
timeDelta = (stats.ac_etime*1000 - lp->delay_read_time);
|
||||
#define BOUNDS(x) isnan(x) ? 0.0 : (x > 100) ? 100.0 : x;
|
||||
#define DELTAPERC(x,y) BOUNDS((float) (x - y) / timeDelta * 100);
|
||||
#define BOUNDS(x) isnan(x) ? 0.0 : ((x) > 100) ? 100.0 : (x);
|
||||
#define DELTAPERC(x,y) BOUNDS((float) ((x) - (y)) / timeDelta * 100);
|
||||
lp->cpu_delay_percent = DELTAPERC(stats.cpu_delay_total, lp->cpu_delay_total);
|
||||
lp->blkio_delay_percent = DELTAPERC(stats.blkio_delay_total, lp->blkio_delay_total);
|
||||
lp->swapin_delay_percent = DELTAPERC(stats.swapin_delay_total, lp->swapin_delay_total);
|
||||
|
Loading…
Reference in New Issue
Block a user