diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-10-31 19:39:32 +0100 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2020-10-31 19:54:03 +0100 |
commit | 15652e7b8102e86b3405254405d8ee5d2a239004 (patch) | |
tree | e1f0e47e1017ebd8a500fd4c4c6da96b67781e2f | |
parent | ab17ef4dc0a306b7481cb47149b1c25f7f200932 (diff) |
Enclose macro arguments in parentheses
-rw-r--r-- | RichString.h | 2 | ||||
-rw-r--r-- | linux/LinuxProcessList.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/RichString.h b/RichString.h index 48c1e749..aab2d891 100644 --- a/RichString.h +++ b/RichString.h @@ -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 diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index f32aba41..5e06e8c9 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -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); |