svn commit: r334010 - head/usr.bin/top
Eitan Adler
eadler at FreeBSD.org
Tue May 22 02:13:06 UTC 2018
Author: eadler
Date: Tue May 22 02:13:04 2018
New Revision: 334010
URL: https://svnweb.freebsd.org/changeset/base/334010
Log:
top(1): unbreak build with gcc7; fix varargs
- use correct function for varargs argument
- allow build to complete with gcc7 at current WARNS
Reported by: jhibbits, ian
Modified:
head/usr.bin/top/commands.c
head/usr.bin/top/display.c
head/usr.bin/top/machine.c
head/usr.bin/top/top.c
Modified: head/usr.bin/top/commands.c
==============================================================================
--- head/usr.bin/top/commands.c Tue May 22 00:45:00 2018 (r334009)
+++ head/usr.bin/top/commands.c Tue May 22 02:13:04 2018 (r334010)
@@ -129,11 +129,7 @@ next_field(char *str)
}
static int
-scanint(str, intp)
-
-char *str;
-int *intp;
-
+scanint(char *str, int *intp)
{
int val = 0;
char ch;
Modified: head/usr.bin/top/display.c
==============================================================================
--- head/usr.bin/top/display.c Tue May 22 00:45:00 2018 (r334009)
+++ head/usr.bin/top/display.c Tue May 22 02:13:04 2018 (r334010)
@@ -1011,7 +1011,7 @@ new_message(int type, char *msgfmt, ...)
va_start(args, msgfmt);
/* first, format the message */
- snprintf(next_msg, sizeof(next_msg), msgfmt, args);
+ vsnprintf(next_msg, sizeof(next_msg), msgfmt, args);
va_end(args);
Modified: head/usr.bin/top/machine.c
==============================================================================
--- head/usr.bin/top/machine.c Tue May 22 00:45:00 2018 (r334009)
+++ head/usr.bin/top/machine.c Tue May 22 02:13:04 2018 (r334010)
@@ -762,7 +762,6 @@ get_process_info(struct system_info *si, struct proces
int show_self;
int show_system;
int show_uid;
- int show_command;
int show_kidle;
/*
@@ -832,7 +831,6 @@ get_process_info(struct system_info *si, struct proces
show_self = sel->self == -1;
show_system = sel->system;
show_uid = sel->uid[0] != -1;
- show_command = sel->command != NULL;
show_kidle = sel->kidle;
/* count up process states and get pointers to interesting procs */
@@ -984,8 +982,7 @@ format_next_process(caddr_t xhandle, char *(*get_useri
break;
default:
- if (state >= 0 &&
- state < sizeof(state_abbrev) / sizeof(*state_abbrev))
+ if (state < sizeof(state_abbrev) / sizeof(*state_abbrev))
sprintf(status, "%.6s", state_abbrev[state]);
else
sprintf(status, "?%5zu", state);
Modified: head/usr.bin/top/top.c
==============================================================================
--- head/usr.bin/top/top.c Tue May 22 00:45:00 2018 (r334009)
+++ head/usr.bin/top/top.c Tue May 22 02:13:04 2018 (r334010)
@@ -94,7 +94,7 @@ static void (*d_process)(int line, char *thisline) = i
static void reset_display(void);
static void
-reset_uids()
+reset_uids(void)
{
for (size_t i = 0; i < TOP_MAX_UIDS; ++i)
ps.uid[i] = -1;
@@ -198,11 +198,7 @@ end:
}
int
-main(argc, argv)
-
-int argc;
-char *argv[];
-
+main(int argc, char *argv[])
{
int i;
int active_procs;
More information about the svn-src-all
mailing list