mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-02 19:22:47 +00:00
5c014d5fa9
Silence top(1) compiler warnings The contrib/top code is no longer maintained upstream (last pulled 16 years ago). The K&R-style followed by the code spews -Wimplicit-int and -Wreturn-type warnings, amongst others. This silences 131 warnings with as little modification as possible by adding necessary return types, definitions, headers, and header guards, and missing header includes. The 5 warnings that remain are due to undeclared ncurses references. I didn't include curses.h and term.h because there are several local functions and macros that conflict with those definitions.
29 lines
560 B
C
29 lines
560 B
C
/*
|
|
* Top users/processes display for Unix
|
|
* Version 3
|
|
*
|
|
* This program may be freely redistributed,
|
|
* but this entire comment MUST remain intact.
|
|
*
|
|
* Copyright (c) 1984, 1989, William LeFebvre, Rice University
|
|
* Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
#include "top.h"
|
|
#include "patchlevel.h"
|
|
|
|
static char version[16];
|
|
|
|
char *version_string()
|
|
|
|
{
|
|
sprintf(version, "%d.%d", VERSION, PATCHLEVEL);
|
|
#ifdef BETA
|
|
strcat(version, BETA);
|
|
#endif
|
|
return(version);
|
|
}
|