diff --git a/usr.bin/top/Makefile b/usr.bin/top/Makefile index bcff1c0cbfad..34be3e38b157 100644 --- a/usr.bin/top/Makefile +++ b/usr.bin/top/Makefile @@ -9,8 +9,7 @@ MAN= top.1 .if ${COMPILER_TYPE} == "gcc" .if ${COMPILER_VERSION} >= 50000 -CFLAGS.gcc=-Wno-error=cast-qual -Wno-error=discarded-qualifiers -Wno-error=incompatible-pointer-types \ - -Wno-error=maybe-uninitialized +CFLAGS.gcc=-Wno-error=cast-qual -Wno-error=discarded-qualifiers -Wno-error=incompatible-pointer-types .else #base gcc NO_WERROR= .endif diff --git a/usr.bin/top/display.c b/usr.bin/top/display.c index 5ec4ea37cc08..7465066e8184 100644 --- a/usr.bin/top/display.c +++ b/usr.bin/top/display.c @@ -377,12 +377,13 @@ u_procstates(int total, int *brkdn) if (ltotal != total) { /* move and overwrite */ -#if (x_procstate == 0) +if (x_procstate == 0) { Move_to(x_procstate, y_procstate); -#else +} +else { /* cursor is already there...no motion needed */ - /* assert(lastline == 1); */ -#endif + assert(lastline == 1); +} printf("%d", total); /* if number of digits differs, rewrite the label */ @@ -955,11 +956,14 @@ new_message(int type, const char *msgfmt, ...) i = strlen(next_msg); if ((type & MT_delayed) == 0) { - type & MT_standout ? top_standout(next_msg) : - fputs(next_msg, stdout); - (void) clear_eol(msglen - i); - msglen = i; - next_msg[0] = '\0'; + if (type & MT_standout) { + top_standout(next_msg); + } else { + fputs(next_msg, stdout); + } + clear_eol(msglen - i); + msglen = i; + next_msg[0] = '\0'; } } } @@ -967,7 +971,11 @@ new_message(int type, const char *msgfmt, ...) { if ((type & MT_delayed) == 0) { - type & MT_standout ? top_standout(next_msg) : fputs(next_msg, stdout); + if (type & MT_standout) { + top_standout(next_msg); + } else { + fputs(next_msg, stdout); + } msglen = strlen(next_msg); next_msg[0] = '\0'; } diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index d9d0093f82c0..5cf8a216af6d 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -79,8 +79,6 @@ struct handle { #define PROCSIZE(pp) ((pp)->ki_size / 1024) #define RU(pp) (&(pp)->ki_rusage) -#define RUTOT(pp) \ - (RU(pp)->ru_inblock + RU(pp)->ru_oublock + RU(pp)->ru_majflt) #define PCTCPU(pp) (pcpu[pp - pbase]) diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index e34c9b656baa..6314cda0aedf 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -245,8 +245,8 @@ main(int argc, char *argv[]) char *env_top; const char **preset_argv; int preset_argc = 0; - const char **av; - int ac; + const char **av = NULL; + int ac = -1; bool dostates = false; bool do_unames = true; char interactive = 2; @@ -1230,7 +1230,7 @@ top_winch(int i __unused) /* SIGWINCH handler */ winchflag = 1; } -void +void __dead2 quit(int status) /* exit under duress */ { end_screen();