From cbc515e2080d06c786135f6d2b62d82a0b787cc0 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Mon, 19 Sep 2022 00:00:00 -0500 Subject: [PATCH] top: fix 'TOG4_MEM_1UP' if two abreast summary display <=== port of newlib 124f26a4 The 'unrelated' note reflected in the original message doesn't apply since we already used that correct name. ______________________________ original newlib message If one per line display of Mem/Swap data was forced by this #define, screen width was not fully exploited for graph mode. Rather, those graphs were scaled just like they would be if aligned with a nonexistent separator. With this commit, those graphs will expand to fill the screen width (or be limited by the maximum of '100' ). [ and in unrelated news a variable used in do_memory ] [ was changed for consistency. it doesn't affect the ] [ the results since a part1 of swap was always zero. ] Signed-off-by: Jim Warner --- top/top.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/top/top.c b/top/top.c index b142c730..f6950191 100644 --- a/top/top.c +++ b/top/top.c @@ -2157,7 +2157,11 @@ static void adj_geometry (void) { if (Graph_cpus->length > GRAPH_length_max) Graph_cpus->length = GRAPH_length_max; if (Graph_cpus->length < GRAPH_length_min) Graph_cpus->length = GRAPH_length_min; +#ifdef TOG4_MEM_1UP + Graph_mems->length = (Screen_cols - (GRAPH_prefix_std + GRAPH_suffix)); +#else Graph_mems->length = (Screen_cols - ADJOIN_space - (2 * (pfx + GRAPH_suffix))) / 2; +#endif if (Graph_mems->length > GRAPH_length_max) Graph_mems->length = GRAPH_length_max; if (Graph_mems->length < GRAPH_length_min) Graph_mems->length = GRAPH_length_min;