summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-12-29 22:53:27 +0000
committered <ed@FreeBSD.org>2009-12-29 22:53:27 +0000
commitb9ca89bfc495774b5fe49e23a272c721c840f68b (patch)
tree2e35e76a520e919173f604f9ba0f30358443ed4a /sbin
parent86ca9a5a9bdaa4a662de58157f311ce58029b75a (diff)
downloadFreeBSD-src-b9ca89bfc495774b5fe49e23a272c721c840f68b.zip
FreeBSD-src-b9ca89bfc495774b5fe49e23a272c721c840f68b.tar.gz
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.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/comcontrol/comcontrol.c2
-rw-r--r--sbin/mount/vfslist.c7
-rw-r--r--sbin/mount_msdosfs/mount_msdosfs.c11
-rw-r--r--sbin/mount_nullfs/mount_nullfs.c6
-rw-r--r--sbin/rcorder/ealloc.c16
-rw-r--r--sbin/rcorder/hash.c40
-rw-r--r--sbin/rcorder/rcorder.c71
7 files changed, 53 insertions, 100 deletions
diff --git a/sbin/comcontrol/comcontrol.c b/sbin/comcontrol/comcontrol.c
index 753ded3..a7c696c 100644
--- a/sbin/comcontrol/comcontrol.c
+++ b/sbin/comcontrol/comcontrol.c
@@ -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");
diff --git a/sbin/mount/vfslist.c b/sbin/mount/vfslist.c
index f95a76e..fa5fdf6 100644
--- a/sbin/mount/vfslist.c
+++ b/sbin/mount/vfslist.c
@@ -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;
diff --git a/sbin/mount_msdosfs/mount_msdosfs.c b/sbin/mount_msdosfs/mount_msdosfs.c
index 096f04a..3ba67ea 100644
--- a/sbin/mount_msdosfs/mount_msdosfs.c
+++ b/sbin/mount_msdosfs/mount_msdosfs.c
@@ -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]",
diff --git a/sbin/mount_nullfs/mount_nullfs.c b/sbin/mount_nullfs/mount_nullfs.c
index a0ad5f6..abca9fa 100644
--- a/sbin/mount_nullfs/mount_nullfs.c
+++ b/sbin/mount_nullfs/mount_nullfs.c
@@ -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");
diff --git a/sbin/rcorder/ealloc.c b/sbin/rcorder/ealloc.c
index a7cf6bc..9971193 100644
--- a/sbin/rcorder/ealloc.c
+++ b/sbin/rcorder/ealloc.c
@@ -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;
diff --git a/sbin/rcorder/hash.c b/sbin/rcorder/hash.c
index bc882b9..34b95ce 100644
--- a/sbin/rcorder/hash.c
+++ b/sbin/rcorder/hash.c
@@ -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;
diff --git a/sbin/rcorder/rcorder.c b/sbin/rcorder/rcorder.c
index bf8e9fb..9a9959b 100644
--- a/sbin/rcorder/rcorder.c
+++ b/sbin/rcorder/rcorder.c
@@ -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)
{
/*
OpenPOWER on IntegriCloud