Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/top WARNSify
details: https://anonhg.NetBSD.org/src/rev/c94b7365376e
branches: trunk
changeset: 467410:c94b7365376e
user: christos <christos%NetBSD.org@localhost>
date: Wed Mar 24 11:57:08 1999 +0000
description:
WARNSify
diffstat:
usr.bin/top/Makefile | 3 +-
usr.bin/top/commands.c | 16 +++++--
usr.bin/top/display.c | 62 +++++++++++++++++++++++++------
usr.bin/top/display.h | 26 +++++++++++++
usr.bin/top/machine.h | 19 +++++++--
usr.bin/top/machine/m_netbsd13.c | 24 ++++-------
usr.bin/top/os.h | 1 +
usr.bin/top/screen.c | 17 +++++---
usr.bin/top/screen.h | 16 +++++++-
usr.bin/top/sigconv.awk | 8 ++--
usr.bin/top/top.c | 80 ++++++++++-----------------------------
usr.bin/top/top.h | 13 ++++--
usr.bin/top/username.c | 3 +
usr.bin/top/utils.c | 8 +--
usr.bin/top/utils.h | 21 +++++-----
usr.bin/top/version.c | 1 +
16 files changed, 189 insertions(+), 129 deletions(-)
diffs (truncated from 935 to 300 lines):
diff -r 4c8f6233fc95 -r c94b7365376e usr.bin/top/Makefile
--- a/usr.bin/top/Makefile Wed Mar 24 11:35:30 1999 +0000
+++ b/usr.bin/top/Makefile Wed Mar 24 11:57:08 1999 +0000
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.2 1999/03/24 05:51:32 mrg Exp $
+# $NetBSD: Makefile,v 1.3 1999/03/24 11:57:08 christos Exp $
PROG= top
-WARNS= 0 # XXX
.PATH: ${.CURDIR}/machine
CPPFLAGS+=-I${.CURDIR} -I. -DORDER -DHAVE_STRERROR
diff -r 4c8f6233fc95 -r c94b7365376e usr.bin/top/commands.c
--- a/usr.bin/top/commands.c Wed Mar 24 11:35:30 1999 +0000
+++ b/usr.bin/top/commands.c Wed Mar 24 11:57:08 1999 +0000
@@ -29,6 +29,7 @@
#include "boolean.h"
#include "machine.h"
#include "utils.h"
+#include "commands.h"
extern int errno;
@@ -37,14 +38,12 @@
/* imported from screen.c */
extern int overstrike;
-int err_compar();
-char *err_string();
-
/*
* show_help() - display the help screen; invoked in response to
* either 'h' or '?'.
*/
+void
show_help(statics)
struct statics *statics;
{
@@ -115,6 +114,7 @@
return(*str == '\0' ? NULL : str);
}
+int
scanint(str, intp)
char *str;
@@ -254,6 +254,7 @@
* the string "str".
*/
+int
str_adderr(str, len, err)
char *str;
@@ -281,6 +282,7 @@
* is set (indicating that a comma should NOT be added to the front).
*/
+int
str_addarg(str, len, arg, first)
char *str;
@@ -313,11 +315,13 @@
* for sorting errors.
*/
-err_compar(p1, p2)
+int
+err_compar(e1, e2)
-register struct errs *p1, *p2;
+ const void *e1, *e2;
{
+ register const struct errs *p1 = e1, *p2 = e2;
register int result;
if ((result = p1->errnum - p2->errnum) == 0)
@@ -331,6 +335,7 @@
* error_count() - return the number of errors currently logged.
*/
+int
error_count()
{
@@ -341,6 +346,7 @@
* show_errors() - display on stdout the current log of errors.
*/
+void
show_errors()
{
diff -r 4c8f6233fc95 -r c94b7365376e usr.bin/top/display.c
--- a/usr.bin/top/display.c Wed Mar 24 11:35:30 1999 +0000
+++ b/usr.bin/top/display.c Wed Mar 24 11:57:08 1999 +0000
@@ -29,6 +29,11 @@
#include "os.h"
#include <ctype.h>
#include <time.h>
+#ifdef __STDC__
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
#include "screen.h" /* interface to screen package */
#include "layout.h" /* defines for screen position layout */
@@ -53,8 +58,6 @@
#define lineindex(l) ((l)*display_width)
-char *printable();
-
/* things initialized by display_init and used thruout */
/* buffer of proc information lines for display updating */
@@ -77,9 +80,9 @@
static enum { OFF, ON, ERASE } header_status = ON;
-static int string_count();
-static void summary_format();
-static void line_update();
+static int string_count __P((char **));
+static void summary_format __P((char *, int *, char **));
+static void line_update __P((char *, char *, int, int));
int display_resize()
@@ -166,6 +169,7 @@
return(lines);
}
+void
i_loadave(mpid, avenrun)
int mpid;
@@ -194,6 +198,7 @@
lmpid = mpid;
}
+void
u_loadave(mpid, avenrun)
int mpid;
@@ -233,6 +238,7 @@
}
}
+void
i_timeofday(tod)
time_t *tod;
@@ -278,6 +284,7 @@
* lastline is valid
*/
+void
i_procstates(total, brkdn)
int total;
@@ -305,6 +312,7 @@
memcpy(lprocstates, brkdn, num_procstates * sizeof(int));
}
+void
u_procstates(total, brkdn)
int total;
@@ -387,6 +395,7 @@
return(use);
}
+void
i_cpustates(states)
register int *states;
@@ -421,6 +430,7 @@
memcpy(lcpustates, states, num_cpustates * sizeof(int));
}
+void
u_cpustates(states)
register int *states;
@@ -468,6 +478,7 @@
}
}
+void
z_cpustates()
{
@@ -506,6 +517,7 @@
char memory_buffer[MAX_COLS];
+void
i_memory(stats)
int *stats;
@@ -519,6 +531,7 @@
fputs(memory_buffer, stdout);
}
+void
u_memory(stats)
int *stats;
@@ -550,6 +563,7 @@
/* Invariant: msglen is always the length of the message currently displayed
on the screen (even when next_msg doesn't contain that message). */
+void
i_message()
{
@@ -571,6 +585,7 @@
}
}
+void
u_message()
{
@@ -585,6 +600,7 @@
* Assumptions: cursor is on the previous line and lastline is consistent
*/
+void
i_header(text)
char *text;
@@ -604,6 +620,7 @@
}
/*ARGSUSED*/
+void
u_header(text)
char *text; /* ignored */
@@ -624,6 +641,7 @@
* Assumptions: lastline is consistent
*/
+void
i_process(line, thisline)
int line;
@@ -654,6 +672,7 @@
memzero(p, display_width - (p - base));
}
+void
u_process(line, newline)
int line;
@@ -701,6 +720,7 @@
}
}
+void
u_endscreen(hi)
register int hi;
@@ -761,6 +781,7 @@
}
}
+void
display_header(t)
int t;
@@ -777,17 +798,33 @@
}
/*VARARGS2*/
-new_message(type, msgfmt, a1, a2, a3)
+void
+#ifdef __STDC__
+new_message(int type, const char *msgfmt, ...)
+#else
+new_message(va_alist)
+ va_dcl
-int type;
-char *msgfmt;
-caddr_t a1, a2, a3;
-
+#endif
{
register int i;
+ va_list ap;
+#ifndef __STDC__
+ int type;
+ const char *msgfmt;
Home |
Main Index |
Thread Index |
Old Index