]> granicus.if.org Git - procps-ng/commitdiff
top: cosmetic changes with two abreast summary display
authorJim Warner <james.warner@comcast.net>
Sun, 18 Sep 2022 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Tue, 20 Sep 2022 08:50:55 +0000 (18:50 +1000)
This commit will change some comments, adjust a little
whitespace but mostly rename some #define identifiers.

Signed-off-by: Jim Warner <james.warner@comcast.net>
src/top/top.c
src/top/top.h

index b93ca9e1c86ccbd35042467fe10e5a19441e004b..f2145ecfda73c4aab8d22b6410cb2929e838c469 100644 (file)
@@ -226,8 +226,8 @@ static int Numa_node_sel = -1;
            commands -- which are now both 4-way toggles */
 #define GRAPH_length_max  100  // the actual bars or blocks
 #define GRAPH_length_min   10  // the actual bars or blocks
-#define GRAPH_prefix_std   25  // '%Cpunnn: 100.0/100.0 100[' or 'nnn-nnn: 100.0/100.0 100['
-#define GRAPH_prefix_abv   12  // '%Cpunnn:100[' or 'nnn-nnn:100[' or 'GiB Mem 100[' or 'GiB Swap 99['
+#define GRAPH_prefix_std   25  // '.......: 100.0/100.0 100['
+#define GRAPH_prefix_abv   12  // '.......:100['
 #define GRAPH_suffix        2  // '] ' (bracket + trailing space)
         // first 3 more static (adj_geometry), last 3 volatile (sum_tics/do_memory)
 struct graph_parms {
@@ -249,11 +249,11 @@ static const char Osel_filterO_fmt[] = "\ttype=%d,\t" OSEL_FILTER "%s\n";
 static const char Osel_filterI_fmt[] = "\ttype=%d,\t" OSEL_FILTER "%*s\n";
 
         /* Support for adjoining display (if terminal is wide enough) */
-#ifdef TOG4_OFF_SEP
+#ifdef TOG4_SEP_OFF
 static char Adjoin_sp[] =  "  ";
 #define ADJOIN_space  (sizeof(Adjoin_sp) - 1)    // 1 for null
 #else
-#ifdef TOG4_STD_SEP
+#ifdef TOG4_SEP_STD
 static char Adjoin_sp[] =  "~1 ~6 ";
 #else
 static char Adjoin_sp[] =  " ~6 ~1";
@@ -6416,7 +6416,7 @@ static void do_memory (void) {
  #define scT(e)  scaletab[Rc.summ_mscale]. e
  #define mkM(x) (float) x / scT(div)
  #define prT(b,z) { if (9 < snprintf(b, 10, scT(fmts), z)) b[8] = '+'; }
-#ifdef TOG4_OFF_MEM
+#ifdef TOG4_MEM_1UP
  #define mem2UP 1
 #else
  #define mem2UP 0
@@ -6470,8 +6470,7 @@ static void do_memory (void) {
       rx = sum_rx(Graph_mems);
       prT(bfT(0), mkM(MEM_VAL(mem_TOT)));
       snprintf(row, sizeof(row), "%s %s:~3%#5.1f~2/%-9.9s~3%s"
-         , scT(label), N_txt(WORD_abv_mem_txt), rx->pcnt_tot, bfT(0)
-         , rx->graph);
+         , scT(label), N_txt(WORD_abv_mem_txt), rx->pcnt_tot, bfT(0), rx->graph);
       Msg_row += sum_see(row, mem2UP);
 
       Graph_mems->total = MEM_VAL(swp_TOT);
index bc33f296fced222fc24a71195069ed17152a382f..7408675e1c017de1822a1e2c30ff0775474c8678 100644 (file)
@@ -60,9 +60,9 @@
 //#define THREADED_CPU            /* separate background thread for cpu updt */
 //#define THREADED_MEM            /* separate background thread for mem updt */
 //#define THREADED_TSK            /* separate background thread for tsk updt */
-//#define TOG4_OFF_MEM            /* don't show two abreast memory statistic */
-//#define TOG4_OFF_SEP            /* don't show two abreast visual separator */
-//#define TOG4_STD_SEP            /* normal mem sep if 2 abreast & no graphs */
+//#define TOG4_MEM_1UP            /* don't show two abreast memory statistic */
+//#define TOG4_SEP_OFF            /* don't show two abreast visual separator */
+//#define TOG4_SEP_STD            /* normal mem sep if 2 abreast & no graphs */
 //#define TREE_NORESET            /* sort keys should not force 'V' view off */
 //#define TREE_SCANALL            /* rescan array w/ forest view, avoid sort */
 //#define TREE_VALTMRK            /* use an indented '+' with collapsed pids */
@@ -626,8 +626,8 @@ typedef struct WIN_t {
 #if defined(USE_X_COLHDR)
 # warning 'USE_X_COLHDR' makes parts of man page misleading (4e, 5d & 5e)
 #endif
-#if defined(TOG4_STD_SEP) && defined(TOG4_OFF_SEP)
-# warning 'TOG4_STD_SEP' has no effect when 'TOG4_OFF_SEP' is active
+#if defined(TOG4_SEP_STD) && defined(TOG4_SEP_OFF)
+# warning 'TOG4_SEP_STD' has no effect when 'TOG4_SEP_OFF' is active
 #endif
 
 /*######  Some Prototypes (ha!)  #########################################*/