Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.

This commit is contained in:
Craig Rodrigues 2015-09-20 20:23:16 +00:00
parent d5bf9eb518
commit 55b6b759c8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=288029
32 changed files with 56 additions and 142 deletions

View File

@ -40,8 +40,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
unsigned int
alarm(secs)
unsigned int secs;
alarm(unsigned int secs)
{
struct itimerval it, oitv;
struct itimerval *itp = &it;

View File

@ -38,10 +38,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
void
__assert(func, file, line, failedexpr)
const char *func, *file;
int line;
const char *failedexpr;
__assert(const char *func, const char *file, int line, const char *failedexpr)
{
if (func == NULL)
(void)fprintf(stderr,

View File

@ -79,10 +79,7 @@ _err(int eval, const char *fmt, ...)
}
void
verr(eval, fmt, ap)
int eval;
const char *fmt;
va_list ap;
verr(int eval, const char *fmt, va_list ap)
{
verrc(eval, errno, fmt, ap);
}

View File

@ -131,9 +131,7 @@ execlp(const char *name, const char *arg, ...)
}
int
execv(name, argv)
const char *name;
char * const *argv;
execv(const char *name, char * const *argv)
{
(void)_execve(name, argv, environ);
return (-1);

View File

@ -76,9 +76,7 @@ static int fnmatch1(const char *, const char *, const char *, int, mbstate_t,
mbstate_t);
int
fnmatch(pattern, string, flags)
const char *pattern, *string;
int flags;
fnmatch(const char *pattern, const char *string, int flags)
{
static const mbstate_t initial;
@ -86,10 +84,8 @@ fnmatch(pattern, string, flags)
}
static int
fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
const char *pattern, *string, *stringstart;
int flags;
mbstate_t patmbs, strmbs;
fnmatch1(const char *pattern, const char *string, const char *stringstart,
int flags, mbstate_t patmbs, mbstate_t strmbs)
{
char *newp;
char c;
@ -214,12 +210,8 @@ fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
}
static int
rangematch(pattern, test, flags, newp, patmbs)
const char *pattern;
wchar_t test;
int flags;
char **newp;
mbstate_t *patmbs;
rangematch(const char *pattern, wchar_t test, int flags, char **newp,
mbstate_t *patmbs)
{
int negate, ok;
wchar_t c, c2;

View File

@ -33,9 +33,7 @@ __FBSDID("$FreeBSD$");
#include <sys/ipc.h>
key_t
ftok(path, id)
const char *path;
int id;
ftok(const char *path, int id)
{
struct stat st;

View File

@ -120,10 +120,8 @@ static const char *ufslike_filesystems[] = {
};
FTS *
__fts_open_44bsd(argv, options, compar)
char * const *argv;
int options;
int (*compar)(const FTSENT * const *, const FTSENT * const *);
__fts_open_44bsd(char * const *argv, int options,
int (*compar)(const FTSENT * const *, const FTSENT * const *))
{
struct _fts_private *priv;
FTS *sp;
@ -234,9 +232,7 @@ mem1: free(sp);
}
static void
fts_load(sp, p)
FTS *sp;
FTSENT *p;
fts_load(FTS *sp, FTSENT *p)
{
int len;
char *cp;
@ -260,8 +256,7 @@ fts_load(sp, p)
}
int
__fts_close_44bsd(sp)
FTS *sp;
__fts_close_44bsd(FTS *sp)
{
FTSENT *freep, *p;
int saved_errno;
@ -315,8 +310,7 @@ __fts_close_44bsd(sp)
? p->fts_pathlen - 1 : p->fts_pathlen)
FTSENT *
__fts_read_44bsd(sp)
FTS *sp;
__fts_read_44bsd(FTS *sp)
{
FTSENT *p, *tmp;
int instr;
@ -510,10 +504,7 @@ name: t = sp->fts_path + NAPPEND(p->fts_parent);
*/
/* ARGSUSED */
int
__fts_set_44bsd(sp, p, instr)
FTS *sp;
FTSENT *p;
int instr;
__fts_set_44bsd(FTS *sp, FTSENT *p, int instr)
{
if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
instr != FTS_NOINSTR && instr != FTS_SKIP) {
@ -525,9 +516,7 @@ __fts_set_44bsd(sp, p, instr)
}
FTSENT *
__fts_children_44bsd(sp, instr)
FTS *sp;
int instr;
__fts_children_44bsd(FTS *sp, int instr)
{
FTSENT *p;
int fd;

View File

@ -110,10 +110,8 @@ static const char *ufslike_filesystems[] = {
};
FTS *
fts_open(argv, options, compar)
char * const *argv;
int options;
int (*compar)(const FTSENT * const *, const FTSENT * const *);
fts_open(char * const *argv, int options,
int (*compar)(const FTSENT * const *, const FTSENT * const *))
{
struct _fts_private *priv;
FTS *sp;
@ -1105,8 +1103,7 @@ fts_padjust(FTS *sp, FTSENT *head)
}
static size_t
fts_maxarglen(argv)
char * const *argv;
fts_maxarglen(char * const *argv)
{
size_t len, max;

View File

@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
char *
getbsize(headerlenp, blocksizep)
int *headerlenp;
long *blocksizep;
getbsize(int *headerlenp, long *blocksizep)
{
static char header[20];
long n, max, mul, blocksize;

View File

@ -55,9 +55,7 @@ __FBSDID("$FreeBSD$");
extern int __getcwd(char *, size_t);
char *
getcwd(pt, size)
char *pt;
size_t size;
getcwd(char *pt, size_t size)
{
struct dirent *dp;
DIR *dir = NULL;

View File

@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
int
getdomainname(name, namelen)
char *name;
int namelen;
getdomainname(char *name, int namelen)
{
int mib[2];
size_t size;

View File

@ -75,8 +75,7 @@ static const ns_src defaultsrc[] = {
{ NULL, 0 }
};
int __getgroupmembership(const char *uname, gid_t agroup, gid_t *groups,
int maxgrp, int *grpcnt);
int __getgroupmembership(const char *, gid_t, gid_t *, int, int *);
int __gr_match_entry(const char *, size_t, enum nss_lookup_type,
const char *, gid_t);
int __gr_parse_entry(char *, size_t, struct group *, char *, size_t,

View File

@ -40,9 +40,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
int
gethostname(name, namelen)
char *name;
size_t namelen;
gethostname(char *name, size_t namelen)
{
int mib[2];

View File

@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$");
*/
int
getpagesize()
getpagesize(void)
{
int mib[2];
static int value;

View File

@ -102,10 +102,7 @@ static int _local_initshells(void *, void *, va_list);
/*ARGSUSED*/
static int
_local_initshells(rv, cb_data, ap)
void *rv;
void *cb_data;
va_list ap;
_local_initshells(void *rv, void *cb_data, va_list ap)
{
char *sp, *cp;
FILE *fp;
@ -139,10 +136,7 @@ static int _dns_initshells(void *, void *, va_list);
/*ARGSUSED*/
static int
_dns_initshells(rv, cb_data, ap)
void *rv;
void *cb_data;
va_list ap;
_dns_initshells(void *rv, void *cb_data, va_list ap)
{
char shellname[] = "shells-XXXXX";
int hsindex, hpi, r;
@ -183,10 +177,7 @@ static int _nis_initshells(void *, void *, va_list);
/*ARGSUSED*/
static int
_nis_initshells(rv, cb_data, ap)
void *rv;
void *cb_data;
va_list ap;
_nis_initshells(void *rv, void *cb_data, va_list ap)
{
static char *ypdomain;
char *key, *data;
@ -239,7 +230,7 @@ _nis_initshells(rv, cb_data, ap)
#endif /* YP */
static const char *const *
initshells()
initshells(void)
{
static const ns_dtab dtab[] = {
NS_FILES_CB(_local_initshells, NULL)

View File

@ -45,9 +45,7 @@ __FBSDID("$FreeBSD$");
* and if it is resident, return its xvfsconf structure.
*/
int
getvfsbyname(fsname, vfcp)
const char *fsname;
struct xvfsconf *vfcp;
getvfsbyname(const char *fsname, struct xvfsconf *vfcp)
{
struct xvfsconf *xvfsp;
size_t buflen;

View File

@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
int
initgroups(uname, agroup)
const char *uname;
gid_t agroup;
initgroups(const char *uname, gid_t agroup)
{
int ngroups, ret;
long ngroups_max;

View File

@ -37,8 +37,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
int
isatty(fd)
int fd;
isatty(int fd)
{
int retval;
struct termios t;

View File

@ -67,8 +67,7 @@ static pthread_mutex_t pidlist_mutex = PTHREAD_MUTEX_INITIALIZER;
#define THREAD_UNLOCK() if (__isthreaded) _pthread_mutex_unlock(&pidlist_mutex)
FILE *
popen(command, type)
const char *command, *type;
popen(const char *command, const char *type)
{
struct pid *cur;
FILE *iop;
@ -179,8 +178,7 @@ popen(command, type)
* if already `pclosed', or waitpid returns an error.
*/
int
pclose(iop)
FILE *iop;
pclose(FILE *iop)
{
struct pid *cur, *last = NULL;
int pstat;

View File

@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
void
psignal(sig, s)
unsigned int sig;
const char *s;
psignal(unsigned int sig, const char *s)
{
const char *c;

View File

@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
__weak_reference(__raise, raise);
__weak_reference(__raise, _raise);
int __raise(int s);
int __raise(int);
int
__raise(int s)

View File

@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$");
* get next entry in a directory.
*/
struct dirent *
_readdir_unlocked(dirp, skip)
DIR *dirp;
int skip;
_readdir_unlocked(DIR *dirp, int skip)
{
struct dirent *dp;
long initial_seek;
@ -91,8 +89,7 @@ _readdir_unlocked(dirp, skip)
}
struct dirent *
readdir(dirp)
DIR *dirp;
readdir(DIR *dirp)
{
struct dirent *dp;
@ -107,10 +104,7 @@ readdir(dirp)
}
int
readdir_r(dirp, entry, result)
DIR *dirp;
struct dirent *entry;
struct dirent **result;
readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)
{
struct dirent *dp;
int saved_errno;

View File

@ -45,8 +45,7 @@ __FBSDID("$FreeBSD$");
#include "telldir.h"
void
rewinddir(dirp)
DIR *dirp;
rewinddir(DIR *dirp)
{
if (__isthreaded)

View File

@ -48,9 +48,7 @@ __FBSDID("$FreeBSD$");
* _seekdir is in telldir.c so that it can share opaque data structures.
*/
void
seekdir(dirp, loc)
DIR *dirp;
long loc;
seekdir(DIR *dirp, long loc)
{
if (__isthreaded)
_pthread_mutex_lock(&dirp->dd_lock);

View File

@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
void
longjmperror()
longjmperror(void)
{
#define ERRMSG "longjmp botch.\n"
(void)_write(STDERR_FILENO, ERRMSG, sizeof(ERRMSG) - 1);

View File

@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$");
#include <signal.h>
int
sigaddset(set, signo)
sigset_t *set;
int signo;
sigaddset(sigset_t *set, int signo)
{
if (signo <= 0 || signo > _SIG_MAXSIG) {
@ -53,9 +51,7 @@ sigaddset(set, signo)
}
int
sigdelset(set, signo)
sigset_t *set;
int signo;
sigdelset(sigset_t *set, int signo)
{
if (signo <= 0 || signo > _SIG_MAXSIG) {
@ -67,8 +63,7 @@ sigdelset(set, signo)
}
int
sigemptyset(set)
sigset_t *set;
sigemptyset(sigset_t *set)
{
int i;
@ -78,8 +73,7 @@ sigemptyset(set)
}
int
sigfillset(set)
sigset_t *set;
sigfillset(sigset_t *set)
{
int i;
@ -89,9 +83,7 @@ sigfillset(set)
}
int
sigismember(set, signo)
const sigset_t *set;
int signo;
sigismember(const sigset_t *set, int signo)
{
if (signo <= 0 || signo > _SIG_MAXSIG) {

View File

@ -69,8 +69,7 @@ __FBSDID("$FreeBSD$");
* less useful than returning up-to-date values, however.
*/
long
sysconf(name)
int name;
sysconf(int name)
{
struct rlimit rl;
size_t len;

View File

@ -50,8 +50,7 @@ __FBSDID("$FreeBSD$");
* return a pointer into a directory
*/
long
telldir(dirp)
DIR *dirp;
telldir(DIR *dirp)
{
struct ddloc *lp;
long idx;
@ -86,9 +85,7 @@ telldir(dirp)
* Only values returned by "telldir" should be passed to seekdir.
*/
void
_seekdir(dirp, loc)
DIR *dirp;
long loc;
_seekdir(DIR *dirp, long loc)
{
struct ddloc *lp;
struct dirent *dp;
@ -152,8 +149,7 @@ _fixtelldir(DIR *dirp, long oldseek, long oldloc)
* Reclaim memory for telldir cookies which weren't used.
*/
void
_reclaim_telldir(dirp)
DIR *dirp;
_reclaim_telldir(DIR *dirp)
{
struct ddloc *lp;
struct ddloc *templp;

View File

@ -270,7 +270,7 @@ __libc_free_tls(void *tcb __unused, size_t tcbsize __unused,
extern char **environ;
void
_init_tls()
_init_tls(void)
{
#ifndef PIC
Elf_Addr *sp;

View File

@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$");
* every ``reload'' microseconds after the first signal.
*/
useconds_t
ualarm(usecs, reload)
useconds_t usecs;
useconds_t reload;
ualarm(useconds_t usecs, useconds_t reload)
{
struct itimerval new, old;

View File

@ -34,7 +34,7 @@
#define _UNVIS_END 1
int __unvis_44bsd(char *cp, int c, int *astate, int flag);
int __unvis_44bsd(char *, int, int *, int);
int
__unvis_44bsd(char *cp, int c, int *astate, int flag)

View File

@ -38,9 +38,7 @@ __FBSDID("$FreeBSD$");
#include <utime.h>
int
utime(path, times)
const char *path;
const struct utimbuf *times;
utime(const char *path, const struct utimbuf *times)
{
struct timeval tv[2], *tvp;