ANSIfy almost all applications that use WARNS=6.

I was considering committing all these patches one by one, but as
discussed with brooks@, there is no need to do this. If we ever
need/want to merge these changes back, it is still possible to do this
per application.
This commit is contained in:
Ed Schouten 2009-12-29 22:53:27 +00:00
parent 7b4f22d5ed
commit 10bc3a7f42
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=201227
23 changed files with 88 additions and 150 deletions

View File

@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$");
static void usage(void);
static void
usage()
usage(void)
{
fprintf(stderr,
"usage: comcontrol <filename> [dtrwait <n>] [drainwait <n>]\n");

View File

@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$");
static int skipvfs;
int
checkvfsname(vfsname, vfslist)
const char *vfsname;
const char **vfslist;
checkvfsname(const char *vfsname, const char **vfslist)
{
if (vfslist == NULL)
@ -60,8 +58,7 @@ checkvfsname(vfsname, vfslist)
}
const char **
makevfslist(fslist)
char *fslist;
makevfslist(char *fslist)
{
const char **av;
int i;

View File

@ -229,8 +229,7 @@ main(int argc, char **argv)
}
gid_t
a_gid(s)
char *s;
a_gid(char *s)
{
struct group *gr;
char *gname;
@ -249,8 +248,7 @@ a_gid(s)
}
uid_t
a_uid(s)
char *s;
a_uid(char *s)
{
struct passwd *pw;
char *uname;
@ -269,8 +267,7 @@ a_uid(s)
}
mode_t
a_mask(s)
char *s;
a_mask(char *s)
{
int done, rv;
char *ep;
@ -287,7 +284,7 @@ a_mask(s)
}
void
usage()
usage(void)
{
fprintf(stderr, "%s\n%s\n%s\n",
"usage: mount_msdosfs [-9ls] [-D DOS_codepage] [-g gid] [-L locale]",

View File

@ -116,9 +116,7 @@ main(int argc, char *argv[])
}
int
subdir(p, dir)
const char *p;
const char *dir;
subdir(const char *p, const char *dir)
{
int l;
@ -133,7 +131,7 @@ subdir(p, dir)
}
static void
usage()
usage(void)
{
(void)fprintf(stderr,
"usage: mount_nullfs [-o options] target mount-point\n");

View File

@ -58,7 +58,7 @@ static void enomem(void);
* die when out of memory.
*/
static void
enomem()
enomem(void)
{
errx(2, "Cannot allocate memory.");
}
@ -68,8 +68,7 @@ enomem()
* malloc, but die on error.
*/
void *
emalloc(len)
size_t len;
emalloc(size_t len)
{
void *p;
@ -83,8 +82,7 @@ emalloc(len)
* strdup, but die on error.
*/
char *
estrdup(str)
const char *str;
estrdup(const char *str)
{
char *p;
@ -98,9 +96,7 @@ estrdup(str)
* realloc, but die on error.
*/
void *
erealloc(ptr, size)
void *ptr;
size_t size;
erealloc(void *ptr, size_t size)
{
if ((ptr = realloc(ptr, size)) == NULL)
enomem();
@ -112,9 +108,7 @@ erealloc(ptr, size)
* calloc, but die on error.
*/
void *
ecalloc(nmemb, size)
size_t nmemb;
size_t size;
ecalloc(size_t nmemb, size_t size)
{
void *ptr;

View File

@ -103,9 +103,9 @@ static void RebuildTable(Hash_Table *);
*/
void
Hash_InitTable(t, numBuckets)
register Hash_Table *t; /* Structure to use to hold table. */
int numBuckets; /* How many buckets to create for starters.
Hash_InitTable(
register Hash_Table *t, /* Structure to use to hold table. */
int numBuckets) /* How many buckets to create for starters.
* This number is rounded up to a power of
* two. If <= 0, a reasonable default is
* chosen. The table will grow in size later
@ -150,8 +150,7 @@ Hash_InitTable(t, numBuckets)
*/
void
Hash_DeleteTable(t)
Hash_Table *t;
Hash_DeleteTable(Hash_Table *t)
{
register struct Hash_Entry **hp, *h, *nexth = NULL;
register int i;
@ -190,9 +189,9 @@ Hash_DeleteTable(t)
*/
Hash_Entry *
Hash_FindEntry(t, key)
Hash_Table *t; /* Hash table to search. */
char *key; /* A hash key. */
Hash_FindEntry(
Hash_Table *t, /* Hash table to search. */
char *key) /* A hash key. */
{
register Hash_Entry *e;
register unsigned h;
@ -227,10 +226,10 @@ Hash_FindEntry(t, key)
*/
Hash_Entry *
Hash_CreateEntry(t, key, newPtr)
register Hash_Table *t; /* Hash table to search. */
char *key; /* A hash key. */
Boolean *newPtr; /* Filled in with TRUE if new entry created,
Hash_CreateEntry(
register Hash_Table *t, /* Hash table to search. */
char *key, /* A hash key. */
Boolean *newPtr) /* Filled in with TRUE if new entry created,
* FALSE otherwise. */
{
register Hash_Entry *e;
@ -294,9 +293,7 @@ Hash_CreateEntry(t, key, newPtr)
*/
void
Hash_DeleteEntry(t, e)
Hash_Table *t;
Hash_Entry *e;
Hash_DeleteEntry(Hash_Table *t, Hash_Entry *e)
{
register Hash_Entry **hp, *p;
@ -335,9 +332,9 @@ Hash_DeleteEntry(t, e)
*/
Hash_Entry *
Hash_EnumFirst(t, searchPtr)
Hash_Table *t; /* Table to be searched. */
register Hash_Search *searchPtr;/* Area in which to keep state
Hash_EnumFirst(
Hash_Table *t, /* Table to be searched. */
register Hash_Search *searchPtr)/* Area in which to keep state
* about search.*/
{
searchPtr->tablePtr = t;
@ -365,8 +362,8 @@ Hash_EnumFirst(t, searchPtr)
*/
Hash_Entry *
Hash_EnumNext(searchPtr)
register Hash_Search *searchPtr; /* Area used to keep state about
Hash_EnumNext(
register Hash_Search *searchPtr) /* Area used to keep state about
search. */
{
register Hash_Entry *e;
@ -411,8 +408,7 @@ Hash_EnumNext(searchPtr)
*/
static void
RebuildTable(t)
register Hash_Table *t;
RebuildTable(register Hash_Table *t)
{
register Hash_Entry *e, *next = NULL, **hp, **xp;
register int i, mask;

View File

@ -153,9 +153,7 @@ void generate_ordering(void);
int main(int, char *[]);
int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
int ch;
@ -199,7 +197,7 @@ main(argc, argv)
* initialise various variables.
*/
void
initialize()
initialize(void)
{
fn_head = &fn_head_s;
@ -210,10 +208,7 @@ initialize()
/* generic function to insert a new strnodelist element */
void
strnode_add(listp, s, fnode)
strnodelist **listp;
char *s;
filenode *fnode;
strnode_add(strnodelist **listp, char *s, filenode *fnode)
{
strnodelist *ent;
@ -235,8 +230,7 @@ strnode_add(listp, s, fnode)
* fill in the bits, and put it in the filenode linked list
*/
filenode *
filenode_new(filename)
char *filename;
filenode_new(char *filename)
{
filenode *temp;
@ -264,9 +258,7 @@ filenode_new(filename)
* add a requirement to a filenode.
*/
void
add_require(fnode, s)
filenode *fnode;
char *s;
add_require(filenode *fnode, char *s)
{
Hash_Entry *entry;
f_reqnode *rnode;
@ -286,9 +278,7 @@ add_require(fnode, s)
* have a head node, create one here.
*/
void
add_provide(fnode, s)
filenode *fnode;
char *s;
add_provide(filenode *fnode, char *s)
{
Hash_Entry *entry;
f_provnode *f_pnode;
@ -367,9 +357,7 @@ add_provide(fnode, s)
* put the BEFORE: lines to a list and handle them later.
*/
void
add_before(fnode, s)
filenode *fnode;
char *s;
add_before(filenode *fnode, char *s)
{
strnodelist *bf_ent;
@ -384,9 +372,7 @@ add_before(fnode, s)
* add a key to a filenode.
*/
void
add_keyword(fnode, s)
filenode *fnode;
char *s;
add_keyword(filenode *fnode, char *s)
{
strnode_add(&fnode->keyword_list, s, fnode);
@ -397,9 +383,7 @@ add_keyword(fnode, s)
* add_require() to do the real work.
*/
void
parse_require(node, buffer)
filenode *node;
char *buffer;
parse_require(filenode *node, char *buffer)
{
char *s;
@ -413,9 +397,7 @@ parse_require(node, buffer)
* add_provide() to do the real work.
*/
void
parse_provide(node, buffer)
filenode *node;
char *buffer;
parse_provide(filenode *node, char *buffer)
{
char *s;
@ -429,9 +411,7 @@ parse_provide(node, buffer)
* add_before() to do the real work.
*/
void
parse_before(node, buffer)
filenode *node;
char *buffer;
parse_before(filenode *node, char *buffer)
{
char *s;
@ -445,9 +425,7 @@ parse_before(node, buffer)
* add_keyword() to do the real work.
*/
void
parse_keywords(node, buffer)
filenode *node;
char *buffer;
parse_keywords(filenode *node, char *buffer)
{
char *s;
@ -461,8 +439,7 @@ parse_keywords(node, buffer)
* for provision and requirement lines, building the graphs as needed.
*/
void
crunch_file(filename)
char *filename;
crunch_file(char *filename)
{
FILE *fp;
char *buf;
@ -534,8 +511,7 @@ crunch_file(filename)
}
Hash_Entry *
make_fake_provision(node)
filenode *node;
make_fake_provision(filenode *node)
{
Hash_Entry *entry;
f_provnode *f_pnode;
@ -581,7 +557,7 @@ make_fake_provision(node)
* that provisions filenode for P.
*/
void
insert_before()
insert_before(void)
{
Hash_Entry *entry, *fake_prov_entry;
provnode *pnode;
@ -619,7 +595,7 @@ insert_before()
* lines into graph(s).
*/
void
crunch_all_files()
crunch_all_files(void)
{
int i;
@ -644,9 +620,7 @@ crunch_all_files()
* provision.
*/
void
satisfy_req(rnode, filename)
f_reqnode *rnode;
char *filename;
satisfy_req(f_reqnode *rnode, char *filename)
{
Hash_Entry *entry;
provnode *head;
@ -687,8 +661,7 @@ satisfy_req(rnode, filename)
}
int
skip_ok(fnode)
filenode *fnode;
skip_ok(filenode *fnode)
{
strnodelist *s;
strnodelist *k;
@ -702,8 +675,7 @@ skip_ok(fnode)
}
int
keep_ok(fnode)
filenode *fnode;
keep_ok(filenode *fnode)
{
strnodelist *s;
strnodelist *k;
@ -728,8 +700,7 @@ keep_ok(fnode)
* Circular dependancies will cause problems if we do.
*/
void
do_file(fnode)
filenode *fnode;
do_file(filenode *fnode)
{
f_reqnode *r, *r_tmp;
f_provnode *p, *p_tmp;
@ -812,7 +783,7 @@ do_file(fnode)
}
void
generate_ordering()
generate_ordering(void)
{
/*

View File

@ -770,7 +770,7 @@ done: *argvp = argv + 1;
/* Finish any pending -exec ... {} + functions. */
void
finish_execplus()
finish_execplus(void)
{
PLAN *p;

View File

@ -130,7 +130,7 @@ void usage(void);
int main(int, char **);
void
usage()
usage(void)
{
fprintf(stderr, "usage: %s catfile msgfile ...\n", getprogname());
exit(1);

View File

@ -170,7 +170,7 @@ ENCODING { return(ENCODING); }
#if !defined(yywrap)
int
yywrap()
yywrap(void)
{
return(1);
}

View File

@ -266,22 +266,20 @@ main(int ac, char *av[])
}
static void
usage()
usage(void)
{
fprintf(stderr, "usage: mklocale [-d] [-o output] [source]\n");
exit(1);
}
void
yyerror(s)
const char *s;
yyerror(const char *s)
{
fprintf(stderr, "%s\n", s);
}
static void *
xmalloc(sz)
unsigned int sz;
xmalloc(unsigned int sz)
{
void *r = malloc(sz);
if (!r)
@ -290,8 +288,7 @@ xmalloc(sz)
}
static uint32_t *
xlalloc(sz)
unsigned int sz;
xlalloc(unsigned int sz)
{
uint32_t *r = (uint32_t *)malloc(sz * sizeof(uint32_t));
if (!r)
@ -300,9 +297,7 @@ xlalloc(sz)
}
static uint32_t *
xrelalloc(old, sz)
uint32_t *old;
unsigned int sz;
xrelalloc(uint32_t *old, unsigned int sz)
{
uint32_t *r = (uint32_t *)realloc((char *)old,
sz * sizeof(uint32_t));
@ -312,10 +307,7 @@ xrelalloc(old, sz)
}
void
set_map(map, list, flag)
rune_map *map;
rune_list *list;
uint32_t flag;
set_map(rune_map *map, rune_list *list, uint32_t flag)
{
while (list) {
rune_list *nlist = list->next;
@ -325,9 +317,7 @@ set_map(map, list, flag)
}
void
set_digitmap(map, list)
rune_map *map;
rune_list *list;
set_digitmap(rune_map *map, rune_list *list)
{
int32_t i;
@ -347,10 +337,7 @@ set_digitmap(map, list)
}
void
add_map(map, list, flag)
rune_map *map;
rune_list *list;
uint32_t flag;
add_map(rune_map *map, rune_list *list, uint32_t flag)
{
int32_t i;
rune_list *lr = 0;
@ -555,7 +542,7 @@ add_map(map, list, flag)
}
static void
dump_tables()
dump_tables(void)
{
int x, first_d, curr_d;
rune_list *list;

View File

@ -285,7 +285,7 @@ include(const char *fname, int ateof)
* Terminate the most recent inclusion.
*/
static int
endinclude()
endinclude(void)
{
struct incl *in;
int ateof;

View File

@ -102,7 +102,7 @@ static int do_update(const char *dev);
static void datadir_add(const char *path);
static void __dead2
usage()
usage(void)
{
const char *name;

View File

@ -146,7 +146,7 @@ action(char *line)
}
static void
dump_config()
dump_config(void)
{
ofwo_dump();

View File

@ -762,7 +762,7 @@ LookupWord(char *buff)
static int
yylex()
yylex(void)
{
char c;
char *p;

View File

@ -49,9 +49,7 @@ static void output(struct ulog_utmpx *);
static void usage(void);
int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
int ch, i;
struct ulog_utmpx *u;
@ -102,7 +100,7 @@ output(struct ulog_utmpx *u)
}
static void
usage()
usage(void)
{
fprintf(stderr, "usage: lastlogin [user ...]\n");
exit(1);

View File

@ -842,7 +842,7 @@ setbindhost(struct addrinfo **ai, const char *bindhost, struct addrinfo hints)
}
void
usage()
usage(void)
{
(void)fprintf(stderr, "usage: nfsd %s\n", USAGE);
exit(1);
@ -868,7 +868,7 @@ reapchild(__unused int signo)
}
void
unregistration()
unregistration(void)
{
if ((!rpcb_unset(NFS_PROGRAM, 2, NULL)) ||
(!rpcb_unset(NFS_PROGRAM, 3, NULL)))
@ -876,7 +876,7 @@ unregistration()
}
void
killchildren()
killchildren(void)
{
int i;

View File

@ -325,7 +325,7 @@ fqueue_compact(float th)
* Flush the first-level aggregates queue.
*/
static void
fqueue_deleteall()
fqueue_deleteall(void)
{
struct aggent *agg;
@ -472,7 +472,7 @@ fqueue_insertgen(void)
* Flush the raw entries general queue.
*/
static void
general_deleteall()
general_deleteall(void)
{
struct entry *obj;

View File

@ -259,7 +259,7 @@ get_freq_id(int freq, int *freqs, int numfreqs)
* to APM. If nothing succeeds, we'll just run in default mode.
*/
static void
acline_init()
acline_init(void)
{
acline_mib_len = 4;

View File

@ -300,7 +300,7 @@ main(int argc, char **argv)
}
static void
usage()
usage(void)
{
(void)fprintf(stderr,
"usage: sa [-abcdDfijkKlmnqrstu] [-P file] [-U file] [-v cutoff] [file ...]\n");

View File

@ -94,14 +94,14 @@ v1_to_v2(DBT *key __unused, DBT *data)
/* Copy pdb_file to in-memory pacct_db. */
int
pacct_init()
pacct_init(void)
{
return (db_copy_in(&pacct_db, pdb_file, "process accounting",
NULL, v1_to_v2));
}
void
pacct_destroy()
pacct_destroy(void)
{
db_destroy(pacct_db, "process accounting");
}
@ -150,14 +150,14 @@ pacct_add(const struct cmdinfo *ci)
/* Copy in-memory pacct_db to pdb_file. */
int
pacct_update()
pacct_update(void)
{
return (db_copy_out(pacct_db, pdb_file, "process accounting",
NULL));
}
void
pacct_print()
pacct_print(void)
{
BTREEINFO bti;
DBT key, data, ndata;

View File

@ -97,7 +97,7 @@ v1_to_v2(DBT *key, DBT *data)
/* Copy usrdb_file to in-memory usracct_db. */
int
usracct_init()
usracct_init(void)
{
BTREEINFO bti;
@ -109,7 +109,7 @@ usracct_init()
}
void
usracct_destroy()
usracct_destroy(void)
{
db_destroy(usracct_db, "user accounting");
}
@ -166,7 +166,7 @@ usracct_add(const struct cmdinfo *ci)
/* Copy in-memory usracct_db to usrdb_file. */
int
usracct_update()
usracct_update(void)
{
BTREEINFO bti;
@ -178,7 +178,7 @@ usracct_update()
}
void
usracct_print()
usracct_print(void)
{
DBT key, data;
struct userinfo uistore, *ui = &uistore;

View File

@ -149,7 +149,7 @@ sighandler(int signum)
* Open the watchdog device.
*/
static int
watchdog_init()
watchdog_init(void)
{
fd = open("/dev/" _PATH_WATCHDOG, O_RDWR);
@ -220,7 +220,7 @@ watchdog_onoff(int onoff)
* Tell user how to use the program.
*/
static void
usage()
usage(void)
{
if (is_daemon)
fprintf(stderr, "usage: watchdogd [-d] [-e cmd] [-I file] [-s sleep] [-t timeout]\n");