Skip to content

Commit 15652e7

Browse files
committed
Enclose macro arguments in parentheses
1 parent ab17ef4 commit 15652e7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

RichString.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ in the source distribution for its full text.
2727
#define CharType cchar_t
2828
#else
2929
#define RichString_printVal(this, y, x) mvaddchstr(y, x, (this).chptr)
30-
#define RichString_printoffnVal(this, y, x, off, n) mvaddchnstr(y, x, (this).chptr + off, n)
30+
#define RichString_printoffnVal(this, y, x, off, n) mvaddchnstr(y, x, (this).chptr + (off), n)
3131
#define RichString_getCharVal(this, i) ((this).chptr[i])
3232
#define RichString_setChar(this, at, ch) do{ (this)->chptr[(at)] = ch; } while(0)
3333
#define CharType chtype

linux/LinuxProcessList.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,8 @@ static int handleNetlinkMsg(struct nl_msg *nlmsg, void *linuxProcess) {
778778
assert(lp->super.pid == (pid_t)stats.ac_pid);
779779

780780
timeDelta = (stats.ac_etime*1000 - lp->delay_read_time);
781-
#define BOUNDS(x) isnan(x) ? 0.0 : (x > 100) ? 100.0 : x;
782-
#define DELTAPERC(x,y) BOUNDS((float) (x - y) / timeDelta * 100);
781+
#define BOUNDS(x) isnan(x) ? 0.0 : ((x) > 100) ? 100.0 : (x);
782+
#define DELTAPERC(x,y) BOUNDS((float) ((x) - (y)) / timeDelta * 100);
783783
lp->cpu_delay_percent = DELTAPERC(stats.cpu_delay_total, lp->cpu_delay_total);
784784
lp->blkio_delay_percent = DELTAPERC(stats.blkio_delay_total, lp->blkio_delay_total);
785785
lp->swapin_delay_percent = DELTAPERC(stats.swapin_delay_total, lp->swapin_delay_total);

0 commit comments

Comments
 (0)