From 787615d8da696a6fa9bf47ec99652e7256a20239 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Sun, 13 Feb 2022 00:00:00 -0600 Subject: [PATCH] top: tweak a couple task_show() macros for consistency There was a potential problem with these macros should that '#define SCROLLVAR_NO' be active and they were to appear in an 'if' statement (like is necessary for the master branch version of top under that EU_CMD label). [ now they're always usable without requiring an ';' ] Signed-off-by: Jim Warner --- top/top.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/top/top.c b/top/top.c index 492991f4..f3b9d13d 100644 --- a/top/top.c +++ b/top/top.c @@ -6045,8 +6045,8 @@ static const char *task_show (const WIN_t *q, int idx) { else cp = make_str_utf8((q->varcolbeg < ((int)strlen(pv) - utf8_delta(pv))) \ ? pv + utf8_embody(pv, q->varcolbeg) : "", q->varcolsz, Js, AUTOX_NO); } #else - #define makeVAR(S) cp = make_str(S, q->varcolsz, Js, AUTOX_NO) - #define varUTF8(S) cp = make_str_utf8(S, q->varcolsz, Js, AUTOX_NO) + #define makeVAR(S) { cp = make_str(S, q->varcolsz, Js, AUTOX_NO); } + #define varUTF8(S) { cp = make_str_utf8(S, q->varcolsz, Js, AUTOX_NO); } #endif struct pids_stack *p = q->ppt[idx]; static char rbuf[ROWMINSIZ]; @@ -6246,15 +6246,15 @@ static const char *task_show (const WIN_t *q, int idx) { case EU_ENV: // PIDS_ENVIRON case EU_EXE: // PIDS_EXE case EU_SGN: // PIDS_SUPGROUPS - varUTF8(rSv(i, str)); + varUTF8(rSv(i, str)) break; /* str, make_str with varialbe width */ case EU_SGD: // PIDS_SUPGIDS - makeVAR(rSv(EU_SGD, str)); + makeVAR(rSv(EU_SGD, str)) break; /* str, make_str with varialbe width + additional decoration */ case EU_CMD: // PIDS_CMD or PIDS_CMDLINE - varUTF8(forest_display(q, idx)); + varUTF8(forest_display(q, idx)) break; default: // keep gcc happy continue; -- 2.40.0