diff options
author | Benny Baumann <BenBE@geshi.org> | 2021-05-15 21:54:46 +0200 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-05-23 09:22:21 +0200 |
commit | 9a78155e17b2c87259cd46bfad5e3358ef2c44ee (patch) | |
tree | 02cfaae04a61a8a348635303f92a037db9911f41 /Process.c | |
parent | aa8552ba88e139fa1da65b1870de2839f33b8404 (diff) |
Properly brace macro arguments
Diffstat (limited to 'Process.c')
-rw-r--r-- | Process.c | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -444,25 +444,25 @@ void Process_makeCommandStr(Process *this) { memset(mc->highlights, 0, sizeof(mc->highlights)); size_t mbMismatch = 0; - #define WRITE_HIGHLIGHT(_offset, _length, _attr, _flags) \ - do { \ - /* Check if we still have capacity */ \ - assert(mc->highlightCount < ARRAYSIZE(mc->highlights)); \ - if (mc->highlightCount >= ARRAYSIZE(mc->highlights)) \ - continue; \ - \ - mc->highlights[mc->highlightCount].offset = str - strStart + _offset - mbMismatch; \ - mc->highlights[mc->highlightCount].length = _length; \ - mc->highlights[mc->highlightCount].attr = _attr; \ - mc->highlights[mc->highlightCount].flags = _flags; \ - mc->highlightCount++; \ + #define WRITE_HIGHLIGHT(_offset, _length, _attr, _flags) \ + do { \ + /* Check if we still have capacity */ \ + assert(mc->highlightCount < ARRAYSIZE(mc->highlights)); \ + if (mc->highlightCount >= ARRAYSIZE(mc->highlights)) \ + continue; \ + \ + mc->highlights[mc->highlightCount].offset = str - strStart + (_offset) - mbMismatch; \ + mc->highlights[mc->highlightCount].length = _length; \ + mc->highlights[mc->highlightCount].attr = _attr; \ + mc->highlights[mc->highlightCount].flags = _flags; \ + mc->highlightCount++; \ } while (0) - #define WRITE_SEPARATOR \ - do { \ - WRITE_HIGHLIGHT(0, 1, CRT_colors[FAILED_READ], CMDLINE_HIGHLIGHT_FLAG_SEPARATOR); \ - mbMismatch += SEPARATOR_LEN - 1; \ - str = stpcpy(str, SEPARATOR); \ + #define WRITE_SEPARATOR \ + do { \ + WRITE_HIGHLIGHT(0, 1, CRT_colors[FAILED_READ], CMDLINE_HIGHLIGHT_FLAG_SEPARATOR); \ + mbMismatch += SEPARATOR_LEN - 1; \ + str = stpcpy(str, SEPARATOR); \ } while (0) const int baseAttr = Process_isThread(this) ? CRT_colors[PROCESS_THREAD_BASENAME] : CRT_colors[PROCESS_BASENAME]; |