top: more useless cosemetic changes (chiefly comments)

All of these changes are self-explanatory, so I'll not
provide any more comments thus avoiding further shame.

[ everything's perfectly justified and right margins ]
[ are filled entirely, but of course it must be luck ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2020-08-20 00:00:00 -05:00 committed by Craig Small
parent e319650278
commit 072a850761
2 changed files with 24 additions and 16 deletions

View File

@ -5728,9 +5728,15 @@ static void keys_xtra (int ch) {
/*###### Cpu Display Secondary support (summary_show helpers) ##########*/ /*###### Cpu Display Secondary support (summary_show helpers) ##########*/
/* /*
* Cpu *Helper* function to combine and or show the state * note how alphabetical order is maintained within carefully chosen |
* percentages for 1 cpu or 2 adjacent cpus (one single line). */ * function names such as: (s)cpu_see, (t)cpu_tics, and (u)cpu_unify |
static inline int cpu_prt (const char *str, int nobuf) { * with each name exactly 1 letter more than the preceeding function |
* ( surely, this must make us run much more efficiently. amirite? ) | */
/*
* Cpu *Helper* function to show the percentages for one or two cpus |
* as a single line. We return the number of lines actually printed. | */
static inline int cpu_see (const char *str, int nobuf) {
static char row[ROWMINSIZ]; static char row[ROWMINSIZ];
static int tog; static int tog;
char *p; char *p;
@ -5748,17 +5754,18 @@ static inline int cpu_prt (const char *str, int nobuf) {
row[0] = '\0'; row[0] = '\0';
tog = 0; tog = 0;
return 1; return 1;
} // end: cpu_prt } // end: cpu_see
/* /*
* State display *Helper* function to calc and display the state * State display *Helper* function to calculate plus display (maybe) |
* percentages for a single cpu. In this way, we can support * the percentages for a single cpu. In this way, we'll support the |
* the following environments without the usual code bloat. * following environments without (hopefully) that usual code bloat: |
* 1) single cpu machines * 1) single cpu platforms (no matter the paucity of these types) |
* 2) modest smp boxes with room for each cpu's percentages * 2) modest smp boxes with ample room for each cpu's percentages |
* 3) massive smp guys leaving little or no room for process * 3) massive smp guys leaving little or no room for that process |
* display and thus requiring the cpu summary toggle */ * display and thus requiring the '1', '4', or '!' cpu toggles |
* ( we return the number of lines printed, as reported by cpu_see ) | */
static int cpu_tics (CPU_t *cpu, const char *pfx, int nobuf) { static int cpu_tics (CPU_t *cpu, const char *pfx, int nobuf) {
/* we'll trim to zero if we get negative time ticks, /* we'll trim to zero if we get negative time ticks,
which has happened with some SMP kernels (pre-2.4?) which has happened with some SMP kernels (pre-2.4?)
@ -5808,10 +5815,10 @@ static int cpu_tics (CPU_t *cpu, const char *pfx, int nobuf) {
snprintf(syst, sizeof(syst), gtab[ix].syst, (int)((pct_syst * Graph_adj) + .4), gtab[ix].type); snprintf(syst, sizeof(syst), gtab[ix].syst, (int)((pct_syst * Graph_adj) + .4), gtab[ix].type);
#endif #endif
snprintf(dual, sizeof(dual), "%s%s", user, syst); snprintf(dual, sizeof(dual), "%s%s", user, syst);
return cpu_prt(fmtmk("%s ~3%#5.1f~2/%-#5.1f~3 %3.0f[~1%-*s]~1" return cpu_see(fmtmk("%s ~3%#5.1f~2/%-#5.1f~3 %3.0f[~1%-*s]~1"
, pfx, pct_user, pct_syst, pct_user + pct_syst, Graph_len +4, dual), nobuf); , pfx, pct_user, pct_syst, pct_user + pct_syst, Graph_len +4, dual), nobuf);
} else { } else {
return cpu_prt(fmtmk(Cpu_States_fmts, pfx return cpu_see(fmtmk(Cpu_States_fmts, pfx
, (float)u_frme * scale, (float)s_frme * scale , (float)u_frme * scale, (float)s_frme * scale
, (float)n_frme * scale, (float)i_frme * scale , (float)n_frme * scale, (float)i_frme * scale
, (float)w_frme * scale, (float)x_frme * scale , (float)w_frme * scale, (float)x_frme * scale
@ -5822,8 +5829,9 @@ static int cpu_tics (CPU_t *cpu, const char *pfx, int nobuf) {
/* /*
* Cpu *Helper* function to combine adjacent cpu stats * Cpu *Helper* function to combine additional cpu statistics in our |
* in an effort to reduce total number of processors shown */ * efforts to reduce the total number of processors that'll be shown |
* ( we return the number of lines printed, as reported by cpu_see ) | */
static int cpu_unify (CPU_t *cpu, int nobuf) { static int cpu_unify (CPU_t *cpu, int nobuf) {
static CPU_t accum; static CPU_t accum;
static int ix, beg; static int ix, beg;

View File

@ -802,7 +802,7 @@ typedef struct WIN_t {
//atic void keys_window (int ch); //atic void keys_window (int ch);
//atic void keys_xtra (int ch); //atic void keys_xtra (int ch);
/*------ Cpu Display Secondary Support (summary_show helpers) ----------*/ /*------ Cpu Display Secondary Support (summary_show helpers) ----------*/
//atic inline int cpu_prt (const char *str, int nobuf); //atic inline int cpu_see (const char *str, int nobuf);
//atic int cpu_tics (CPU_t *cpu, const char *pfx, int nobuf); //atic int cpu_tics (CPU_t *cpu, const char *pfx, int nobuf);
//atic int cpu_unify (CPU_t *cpu, int nobuf); //atic int cpu_unify (CPU_t *cpu, int nobuf);
/*------ Main Screen routines ------------------------------------------*/ /*------ Main Screen routines ------------------------------------------*/