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 <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2022-02-13 00:00:00 -06:00 committed by Craig Small
parent 2c12f1f295
commit 787615d8da

View File

@ -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))) \ else cp = make_str_utf8((q->varcolbeg < ((int)strlen(pv) - utf8_delta(pv))) \
? pv + utf8_embody(pv, q->varcolbeg) : "", q->varcolsz, Js, AUTOX_NO); } ? pv + utf8_embody(pv, q->varcolbeg) : "", q->varcolsz, Js, AUTOX_NO); }
#else #else
#define makeVAR(S) cp = make_str(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) #define varUTF8(S) { cp = make_str_utf8(S, q->varcolsz, Js, AUTOX_NO); }
#endif #endif
struct pids_stack *p = q->ppt[idx]; struct pids_stack *p = q->ppt[idx];
static char rbuf[ROWMINSIZ]; 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_ENV: // PIDS_ENVIRON
case EU_EXE: // PIDS_EXE case EU_EXE: // PIDS_EXE
case EU_SGN: // PIDS_SUPGROUPS case EU_SGN: // PIDS_SUPGROUPS
varUTF8(rSv(i, str)); varUTF8(rSv(i, str))
break; break;
/* str, make_str with varialbe width */ /* str, make_str with varialbe width */
case EU_SGD: // PIDS_SUPGIDS case EU_SGD: // PIDS_SUPGIDS
makeVAR(rSv(EU_SGD, str)); makeVAR(rSv(EU_SGD, str))
break; break;
/* str, make_str with varialbe width + additional decoration */ /* str, make_str with varialbe width + additional decoration */
case EU_CMD: // PIDS_CMD or PIDS_CMDLINE case EU_CMD: // PIDS_CMD or PIDS_CMDLINE
varUTF8(forest_display(q, idx)); varUTF8(forest_display(q, idx))
break; break;
default: // keep gcc happy default: // keep gcc happy
continue; continue;