From: Jim Warner Date: Sat, 6 Aug 2016 18:13:13 +0000 (-0500) Subject: top: ensure derived VAL macro management is consistent X-Git-Tag: v4.0.0~799 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b6ad95f40f2e3129e21be40ba9fd2cddba6dfcf;p=procps-ng top: ensure derived VAL macro management is consistent With this patch, top has ensured that base library VAL macros are never found inside function bodies. Rather, they are used solely to support global derived macros. Program functions remain free to further tailor macros but they'll now always be based on the top derivative. Signed-off-by: Jim Warner --- diff --git a/top/top.c b/top/top.c index a977ffb2..aecee67f 100644 --- a/top/top.c +++ b/top/top.c @@ -233,6 +233,7 @@ enum Rel_statitems { // cpu/node stack results extractor macros, where e=rel enum, x=index #define CPU_VAL(e,x) STAT_VAL(e, s_int, Stat_reap->cpus->stacks[x], Stat_ctx) #define NOD_VAL(e,x) STAT_VAL(e, s_int, Stat_reap->nodes->stacks[x], Stat_ctx) +#define TIC_VAL(e,s) STAT_VAL(e, sl_int, s, Stat_ctx) /*###### Tiny useful routine(s) ########################################*/ @@ -4611,7 +4612,7 @@ all_done: * display and thus requiring the cpu summary toggle */ static void summary_hlp (struct stat_stack *this, const char *pfx) { // a tailored 'results stack value' extractor macro - #define rSv(E) STAT_VAL(E, sl_int, this, Stat_ctx) + #define rSv(E) TIC_VAL(E, this) SIC_t u_frme, s_frme, n_frme, i_frme, w_frme, x_frme, y_frme, z_frme, tot_frme; float scale;