diff options
author | kn <kn@cvs.openbsd.org> | 2019-10-08 07:27:00 +0000 |
---|---|---|
committer | kn <kn@cvs.openbsd.org> | 2019-10-08 07:27:00 +0000 |
commit | e37b78859121b472a47dd36873f8ab19d862703a (patch) | |
tree | 07558bb450559a2ce3dffd743e7e41684295fa52 /usr.bin/top/display.c | |
parent | ebc99db5d4630a9ef22485bb2c9e5837265101f0 (diff) |
Replace "boolean.h" with <stdbool.h>
Be consistent with other programs in base and unify variable usage as
follows to improve readability:
bool = (bool == No) ? Yes : No -> bool = !bool
if (bool == Yes) -> if (bool)
if (bool == No) -> if (!bool)
bool = Maybe -> bool = -1
OK millert
Diffstat (limited to 'usr.bin/top/display.c')
-rw-r--r-- | usr.bin/top/display.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/usr.bin/top/display.c b/usr.bin/top/display.c index 97ba3977ab8..eabae12008c 100644 --- a/usr.bin/top/display.c +++ b/usr.bin/top/display.c @@ -1,4 +1,4 @@ -/* $OpenBSD: display.c,v 1.59 2019/07/03 03:24:02 deraadt Exp $ */ +/* $OpenBSD: display.c,v 1.60 2019/10/08 07:26:59 kn Exp $ */ /* * Top users/processes display for Unix @@ -57,12 +57,12 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <stdbool.h> #include "screen.h" /* interface to screen package */ #include "layout.h" /* defines for screen position layout */ #include "display.h" #include "top.h" -#include "boolean.h" #include "machine.h" /* we should eliminate this!!! */ #include "utils.h" @@ -104,7 +104,7 @@ extern int ncpuonline; extern int combine_cpus; extern struct process_select ps; -int header_status = Yes; +int header_status = true; static int empty(void) @@ -309,10 +309,7 @@ i_procstates(int total, int *states, int threads) move(1, 0); clrtoeol(); /* write current number of procs and remember the value */ - if (threads == Yes) - printwp("%d threads: ", total); - else - printwp("%d processes: ", total); + printwp("%d %s: ", total, threads ? "threads" : "processes"); /* format and print the process state summary */ summary_format(procstates_buffer, sizeof(procstates_buffer), @@ -518,7 +515,7 @@ i_message(void) void i_header(char *text) { - if (header_status == Yes && (screen_length > y_header + if (header_status && (screen_length > y_header || !smart_terminal)) { if (!smart_terminal) { putn(); |