mirror of https://github.com/xzeldon/htop.git
Properly brace macro arguments
This commit is contained in:
parent
aa8552ba88
commit
9a78155e17
34
Process.c
34
Process.c
|
@ -444,25 +444,25 @@ void Process_makeCommandStr(Process *this) {
|
||||||
memset(mc->highlights, 0, sizeof(mc->highlights));
|
memset(mc->highlights, 0, sizeof(mc->highlights));
|
||||||
|
|
||||||
size_t mbMismatch = 0;
|
size_t mbMismatch = 0;
|
||||||
#define WRITE_HIGHLIGHT(_offset, _length, _attr, _flags) \
|
#define WRITE_HIGHLIGHT(_offset, _length, _attr, _flags) \
|
||||||
do { \
|
do { \
|
||||||
/* Check if we still have capacity */ \
|
/* Check if we still have capacity */ \
|
||||||
assert(mc->highlightCount < ARRAYSIZE(mc->highlights)); \
|
assert(mc->highlightCount < ARRAYSIZE(mc->highlights)); \
|
||||||
if (mc->highlightCount >= ARRAYSIZE(mc->highlights)) \
|
if (mc->highlightCount >= ARRAYSIZE(mc->highlights)) \
|
||||||
continue; \
|
continue; \
|
||||||
\
|
\
|
||||||
mc->highlights[mc->highlightCount].offset = str - strStart + _offset - mbMismatch; \
|
mc->highlights[mc->highlightCount].offset = str - strStart + (_offset) - mbMismatch; \
|
||||||
mc->highlights[mc->highlightCount].length = _length; \
|
mc->highlights[mc->highlightCount].length = _length; \
|
||||||
mc->highlights[mc->highlightCount].attr = _attr; \
|
mc->highlights[mc->highlightCount].attr = _attr; \
|
||||||
mc->highlights[mc->highlightCount].flags = _flags; \
|
mc->highlights[mc->highlightCount].flags = _flags; \
|
||||||
mc->highlightCount++; \
|
mc->highlightCount++; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define WRITE_SEPARATOR \
|
#define WRITE_SEPARATOR \
|
||||||
do { \
|
do { \
|
||||||
WRITE_HIGHLIGHT(0, 1, CRT_colors[FAILED_READ], CMDLINE_HIGHLIGHT_FLAG_SEPARATOR); \
|
WRITE_HIGHLIGHT(0, 1, CRT_colors[FAILED_READ], CMDLINE_HIGHLIGHT_FLAG_SEPARATOR); \
|
||||||
mbMismatch += SEPARATOR_LEN - 1; \
|
mbMismatch += SEPARATOR_LEN - 1; \
|
||||||
str = stpcpy(str, SEPARATOR); \
|
str = stpcpy(str, SEPARATOR); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
const int baseAttr = Process_isThread(this) ? CRT_colors[PROCESS_THREAD_BASENAME] : CRT_colors[PROCESS_BASENAME];
|
const int baseAttr = Process_isThread(this) ? CRT_colors[PROCESS_THREAD_BASENAME] : CRT_colors[PROCESS_BASENAME];
|
||||||
|
|
Loading…
Reference in New Issue