Revert r333969 which contained one too many changes

This commit is contained in:
Eitan Adler 2018-05-21 09:20:26 +00:00
parent bfb79c2ccc
commit 00157b4c04
9 changed files with 32 additions and 26 deletions

View File

@ -7,7 +7,7 @@ SRCS+= sigdesc.h top.local.h
CFLAGS+= -I ${.OBJDIR}
MAN= top.1
WARNS?= 6
WARNS?= 3
LIBADD= ncursesw m kvm jail

View File

@ -177,8 +177,8 @@ int *intp;
static struct errs errs[ERRMAX];
static int errcnt;
static char err_toomany[] = " too many errors occurred";
static char err_listem[] =
static char *err_toomany = " too many errors occurred";
static char *err_listem =
" Many errors occurred. Press `e' to display the list of errors.";
/* These macros get used to reset and log the errors */

View File

@ -588,10 +588,13 @@ for (cpu = 0; cpu < num_cpus; cpu++) {
* for i_memory ONLY: cursor is on the previous line
*/
static char memory_buffer[MAX_COLS];
char memory_buffer[MAX_COLS];
void
i_memory(int *stats)
i_memory(stats)
int *stats;
{
fputs("\nMem: ", stdout);
lastline++;
@ -602,7 +605,10 @@ i_memory(int *stats)
}
void
u_memory(int *stats)
u_memory(stats)
int *stats;
{
static char new[MAX_COLS];

View File

@ -53,6 +53,7 @@
#define SMPUNAMELEN 13
#define UPUNAMELEN 15
extern struct process_select ps;
extern struct timeval timeout;
static int smpmode;
enum displaymodes displaymode;
@ -228,7 +229,7 @@ static int pageshift; /* log base 2 of the pagesize */
/*
* Sorting orders. The first element is the default.
*/
static const char *ordernames[] = {
char *ordernames[] = {
"cpu", "size", "res", "time", "pri", "threads",
"total", "read", "write", "fault", "vcsw", "ivcsw",
"jid", "swap", "pid", NULL
@ -742,7 +743,7 @@ get_io_total(struct kinfo_proc *pp)
static struct handle handle;
void *
caddr_t
get_process_info(struct system_info *si, struct process_select *sel,
int (*compare)(const void *, const void *))
{
@ -909,13 +910,13 @@ get_process_info(struct system_info *si, struct process_select *sel,
/* pass back a handle */
handle.next_proc = pref;
handle.remaining = active_procs;
return (&handle);
return ((caddr_t)&handle);
}
static char fmt[512]; /* static area where result is built */
char *
format_next_process(void * xhandle, char *(*get_userid)(int), int flags)
format_next_process(caddr_t xhandle, char *(*get_userid)(int), int flags)
{
struct kinfo_proc *pp;
const struct kinfo_proc *oldp;

View File

@ -75,18 +75,17 @@ struct process_select
/* routines defined by the machine dependent module */
char *format_header(char *uname_field);
char *format_next_process(void * handle, char *(*get_userid)(int),
char *format_next_process(caddr_t handle, char *(*get_userid)(int),
int flags);
void toggle_pcpustats(void);
void get_system_info(struct system_info *si);
int machine_init(struct statics *statics);
int proc_owner(int pid);
extern struct process_select ps;
/* non-int routines typically used by the machine dependent module */
char *printable(char *string);
void *
caddr_t
get_process_info(struct system_info *si, struct process_select *sel,
int (*compare)(const void *, const void *));

View File

@ -39,18 +39,18 @@ char ch_erase;
char ch_kill;
char smart_terminal;
char PC;
static char termcap_buf[1024];
static char string_buffer[1024];
static char home[15];
static char lower_left[15];
char termcap_buf[1024];
char string_buffer[1024];
char home[15];
char lower_left[15];
char *clear_line;
static char *clear_screen;
char *clear_screen;
char *clear_to_end;
char *cursor_motion;
static char *start_standout;
static char *end_standout;
static char *terminal_init;
static char *terminal_end;
char *start_standout;
char *end_standout;
char *terminal_init;
char *terminal_end;
static struct termios old_settings;
static struct termios new_settings;

View File

@ -40,7 +40,7 @@
/* Size of the stdio buffer given to stdout */
#define Buffersize 2048
char copyright[] =
char *copyright =
"Copyright (c) 1984 through 1996, William LeFebvre";
typedef void sigret_t;
@ -211,7 +211,7 @@ char *argv[];
struct system_info system_info;
struct statics statics;
void * processes;
caddr_t processes;
static char tempbuf1[50];
static char tempbuf2[50];

View File

@ -53,7 +53,7 @@ extern int (*compares[])(const void*, const void*);
char* kill_procs(char *);
char* renice_procs(char *);
extern char copyright[];
extern char *copyright;
/* internal routines */
void quit(int);

View File

@ -56,7 +56,7 @@ struct hash_el {
/* K&R requires that statically declared tables be initialized to zero. */
/* We depend on that for hash_table and YOUR compiler had BETTER do it! */
static struct hash_el hash_table[Table_size];
struct hash_el hash_table[Table_size];
char *username(uid)