Provide proper contemporary function prototypes for many of the functions

implemented in top(1), rather than relying on K&R prototypes, which can
cause problems on targets where there are multiple incompatible calling
conventions and the compiler requires argument information to select the
correct one.

(There's a bit more to do here, since it looks like top(1) also sometimes
provides prototypes for various curses functions rather than relying on
the header file...)

Sponsored by:	DARPA, AFRL
MFC after:	1 week
This commit is contained in:
Robert Watson 2017-03-26 17:22:44 +00:00
parent d25646a482
commit abc58cc4d9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315990
3 changed files with 17 additions and 15 deletions

View File

@ -81,14 +81,15 @@ struct process_select
/* routines defined by the machine dependent module */
char *format_header();
char *format_next_process();
char *format_header(char *uname_field);
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, char do_unames);
int proc_owner(int pid);
/* non-int routines typically used by the machine dependent module */
char *printable();
char *printable(char *string);
#endif /* MACHINE_H */

View File

@ -112,7 +112,8 @@ extern int io_compare();
#endif
time_t time();
caddr_t get_process_info();
caddr_t get_process_info(struct system_info *si, struct process_select *sel,
int (*compare)(const void *, const void *));
/* different routines for displaying the user's identification */
/* (values assigned to get_userid) */
@ -120,16 +121,16 @@ char *username();
char *itoa7();
/* pointers to display routines */
void (*d_loadave)() = i_loadave;
void (*d_procstates)() = i_procstates;
void (*d_cpustates)() = i_cpustates;
void (*d_memory)() = i_memory;
void (*d_arc)() = i_arc;
void (*d_carc)() = i_carc;
void (*d_swap)() = i_swap;
void (*d_message)() = i_message;
void (*d_header)() = i_header;
void (*d_process)() = i_process;
void (*d_loadave)(int mpid, double *avenrun) = i_loadave;
void (*d_procstates)(int total, int *brkdn) = i_procstates;
void (*d_cpustates)(int *states) = i_cpustates;
void (*d_memory)(int *stats) = i_memory;
void (*d_arc)(int *stats) = i_arc;
void (*d_carc)(int *stats) = i_carc;
void (*d_swap)(int *stats) = i_swap;
void (*d_message)(void) = i_message;
void (*d_header)(char *text) = i_header;
void (*d_process)(int line, char *thisline) = i_process;
void reset_display(void);

View File

@ -241,7 +241,7 @@ static int pageshift; /* log base 2 of the pagesize */
((kip)->ki_swrss > (kip)->ki_rssize ? (kip)->ki_swrss - (kip)->ki_rssize : 0)
/* useful externals */
long percentages();
long percentages(int cnt, int *out, long *new, long *old, long *diffs);
#ifdef ORDER
/*