]> granicus.if.org Git - procps-ng/commitdiff
top: cosmetic changes with two abreast summary display <=== port of newlib bf916fdf
authorJim Warner <james.warner@comcast.net>
Mon, 19 Sep 2022 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Tue, 20 Sep 2022 09:34:40 +0000 (19:34 +1000)
______________________________ original newlib message

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>
top/top.c
top/top.h

index e06f89b014d2f1b4465c50c8c73ab03acf06b8fb..66a077fddaac7c2f13e179abc10994a240481e94 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -255,8 +255,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 {
@@ -278,11 +278,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)
 #else
-#ifdef TOG4_STD_SEP
+#ifdef TOG4_SEP_STD
 static char Adjoin_sp[] =  "~1 ~6 ";
 #else
 static char Adjoin_sp[] =  " ~6 ~1";
@@ -6530,7 +6530,7 @@ static void do_memory (void) {
  #define mkM(x) (float)kb_main_ ## x / scT(div)
  #define mkS(x) (float)kb_swap_ ## 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
@@ -6584,8 +6584,7 @@ static void do_memory (void) {
       rx = sum_rx(Graph_mems);
       prT(bfT(0), mkM(total));
       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 = kb_swap_total;
index 86461e8931ae7bd3daca77be039d2a7722fef64a..325fbb03b81321ecf1233817c4824513d283b9cd 100644 (file)
--- a/top/top.h
+++ b/top/top.h
@@ -64,9 +64,9 @@
 //#define SCROLLV_BY_1            /* when scrolling left/right do not move 8 */
 //#define STRINGCASENO            /* case insenstive compare/locate versions */
 //#define TERMIOS_ONLY            /* use native input only (just limp along) */
-//#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 */
@@ -700,8 +700,8 @@ typedef struct WIN_t {
 #if defined(SCALE_FORMER) && defined(SCALE_POSTFX)
 # warning 'SCALE_POSTFX' is ignored when 'SCALE_FORMER' is active
 #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!)  #########################################*/