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:
@@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
static void usage(void);
|
static void usage(void);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"usage: comcontrol <filename> [dtrwait <n>] [drainwait <n>]\n");
|
"usage: comcontrol <filename> [dtrwait <n>] [drainwait <n>]\n");
|
||||||
|
|||||||
@@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
static int skipvfs;
|
static int skipvfs;
|
||||||
|
|
||||||
int
|
int
|
||||||
checkvfsname(vfsname, vfslist)
|
checkvfsname(const char *vfsname, const char **vfslist)
|
||||||
const char *vfsname;
|
|
||||||
const char **vfslist;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (vfslist == NULL)
|
if (vfslist == NULL)
|
||||||
@@ -60,8 +58,7 @@ checkvfsname(vfsname, vfslist)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char **
|
const char **
|
||||||
makevfslist(fslist)
|
makevfslist(char *fslist)
|
||||||
char *fslist;
|
|
||||||
{
|
{
|
||||||
const char **av;
|
const char **av;
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
@@ -229,8 +229,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gid_t
|
gid_t
|
||||||
a_gid(s)
|
a_gid(char *s)
|
||||||
char *s;
|
|
||||||
{
|
{
|
||||||
struct group *gr;
|
struct group *gr;
|
||||||
char *gname;
|
char *gname;
|
||||||
@@ -249,8 +248,7 @@ a_gid(s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uid_t
|
uid_t
|
||||||
a_uid(s)
|
a_uid(char *s)
|
||||||
char *s;
|
|
||||||
{
|
{
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
char *uname;
|
char *uname;
|
||||||
@@ -269,8 +267,7 @@ a_uid(s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mode_t
|
mode_t
|
||||||
a_mask(s)
|
a_mask(char *s)
|
||||||
char *s;
|
|
||||||
{
|
{
|
||||||
int done, rv;
|
int done, rv;
|
||||||
char *ep;
|
char *ep;
|
||||||
@@ -287,7 +284,7 @@ a_mask(s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s\n%s\n%s\n",
|
fprintf(stderr, "%s\n%s\n%s\n",
|
||||||
"usage: mount_msdosfs [-9ls] [-D DOS_codepage] [-g gid] [-L locale]",
|
"usage: mount_msdosfs [-9ls] [-D DOS_codepage] [-g gid] [-L locale]",
|
||||||
|
|||||||
@@ -116,9 +116,7 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
subdir(p, dir)
|
subdir(const char *p, const char *dir)
|
||||||
const char *p;
|
|
||||||
const char *dir;
|
|
||||||
{
|
{
|
||||||
int l;
|
int l;
|
||||||
|
|
||||||
@@ -133,7 +131,7 @@ subdir(p, dir)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
(void)fprintf(stderr,
|
(void)fprintf(stderr,
|
||||||
"usage: mount_nullfs [-o options] target mount-point\n");
|
"usage: mount_nullfs [-o options] target mount-point\n");
|
||||||
|
|||||||
+5
-11
@@ -58,7 +58,7 @@ static void enomem(void);
|
|||||||
* die when out of memory.
|
* die when out of memory.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
enomem()
|
enomem(void)
|
||||||
{
|
{
|
||||||
errx(2, "Cannot allocate memory.");
|
errx(2, "Cannot allocate memory.");
|
||||||
}
|
}
|
||||||
@@ -68,8 +68,7 @@ enomem()
|
|||||||
* malloc, but die on error.
|
* malloc, but die on error.
|
||||||
*/
|
*/
|
||||||
void *
|
void *
|
||||||
emalloc(len)
|
emalloc(size_t len)
|
||||||
size_t len;
|
|
||||||
{
|
{
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
@@ -83,8 +82,7 @@ emalloc(len)
|
|||||||
* strdup, but die on error.
|
* strdup, but die on error.
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
estrdup(str)
|
estrdup(const char *str)
|
||||||
const char *str;
|
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
@@ -98,9 +96,7 @@ estrdup(str)
|
|||||||
* realloc, but die on error.
|
* realloc, but die on error.
|
||||||
*/
|
*/
|
||||||
void *
|
void *
|
||||||
erealloc(ptr, size)
|
erealloc(void *ptr, size_t size)
|
||||||
void *ptr;
|
|
||||||
size_t size;
|
|
||||||
{
|
{
|
||||||
if ((ptr = realloc(ptr, size)) == NULL)
|
if ((ptr = realloc(ptr, size)) == NULL)
|
||||||
enomem();
|
enomem();
|
||||||
@@ -112,9 +108,7 @@ erealloc(ptr, size)
|
|||||||
* calloc, but die on error.
|
* calloc, but die on error.
|
||||||
*/
|
*/
|
||||||
void *
|
void *
|
||||||
ecalloc(nmemb, size)
|
ecalloc(size_t nmemb, size_t size)
|
||||||
size_t nmemb;
|
|
||||||
size_t size;
|
|
||||||
{
|
{
|
||||||
void *ptr;
|
void *ptr;
|
||||||
|
|
||||||
|
|||||||
+18
-22
@@ -103,9 +103,9 @@ static void RebuildTable(Hash_Table *);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
Hash_InitTable(t, numBuckets)
|
Hash_InitTable(
|
||||||
register Hash_Table *t; /* Structure to use to hold table. */
|
register Hash_Table *t, /* Structure to use to hold table. */
|
||||||
int numBuckets; /* How many buckets to create for starters.
|
int numBuckets) /* How many buckets to create for starters.
|
||||||
* This number is rounded up to a power of
|
* This number is rounded up to a power of
|
||||||
* two. If <= 0, a reasonable default is
|
* two. If <= 0, a reasonable default is
|
||||||
* chosen. The table will grow in size later
|
* chosen. The table will grow in size later
|
||||||
@@ -150,8 +150,7 @@ Hash_InitTable(t, numBuckets)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
Hash_DeleteTable(t)
|
Hash_DeleteTable(Hash_Table *t)
|
||||||
Hash_Table *t;
|
|
||||||
{
|
{
|
||||||
register struct Hash_Entry **hp, *h, *nexth = NULL;
|
register struct Hash_Entry **hp, *h, *nexth = NULL;
|
||||||
register int i;
|
register int i;
|
||||||
@@ -190,9 +189,9 @@ Hash_DeleteTable(t)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Hash_Entry *
|
Hash_Entry *
|
||||||
Hash_FindEntry(t, key)
|
Hash_FindEntry(
|
||||||
Hash_Table *t; /* Hash table to search. */
|
Hash_Table *t, /* Hash table to search. */
|
||||||
char *key; /* A hash key. */
|
char *key) /* A hash key. */
|
||||||
{
|
{
|
||||||
register Hash_Entry *e;
|
register Hash_Entry *e;
|
||||||
register unsigned h;
|
register unsigned h;
|
||||||
@@ -227,10 +226,10 @@ Hash_FindEntry(t, key)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Hash_Entry *
|
Hash_Entry *
|
||||||
Hash_CreateEntry(t, key, newPtr)
|
Hash_CreateEntry(
|
||||||
register Hash_Table *t; /* Hash table to search. */
|
register Hash_Table *t, /* Hash table to search. */
|
||||||
char *key; /* A hash key. */
|
char *key, /* A hash key. */
|
||||||
Boolean *newPtr; /* Filled in with TRUE if new entry created,
|
Boolean *newPtr) /* Filled in with TRUE if new entry created,
|
||||||
* FALSE otherwise. */
|
* FALSE otherwise. */
|
||||||
{
|
{
|
||||||
register Hash_Entry *e;
|
register Hash_Entry *e;
|
||||||
@@ -294,9 +293,7 @@ Hash_CreateEntry(t, key, newPtr)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
Hash_DeleteEntry(t, e)
|
Hash_DeleteEntry(Hash_Table *t, Hash_Entry *e)
|
||||||
Hash_Table *t;
|
|
||||||
Hash_Entry *e;
|
|
||||||
{
|
{
|
||||||
register Hash_Entry **hp, *p;
|
register Hash_Entry **hp, *p;
|
||||||
|
|
||||||
@@ -335,9 +332,9 @@ Hash_DeleteEntry(t, e)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Hash_Entry *
|
Hash_Entry *
|
||||||
Hash_EnumFirst(t, searchPtr)
|
Hash_EnumFirst(
|
||||||
Hash_Table *t; /* Table to be searched. */
|
Hash_Table *t, /* Table to be searched. */
|
||||||
register Hash_Search *searchPtr;/* Area in which to keep state
|
register Hash_Search *searchPtr)/* Area in which to keep state
|
||||||
* about search.*/
|
* about search.*/
|
||||||
{
|
{
|
||||||
searchPtr->tablePtr = t;
|
searchPtr->tablePtr = t;
|
||||||
@@ -365,8 +362,8 @@ Hash_EnumFirst(t, searchPtr)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Hash_Entry *
|
Hash_Entry *
|
||||||
Hash_EnumNext(searchPtr)
|
Hash_EnumNext(
|
||||||
register Hash_Search *searchPtr; /* Area used to keep state about
|
register Hash_Search *searchPtr) /* Area used to keep state about
|
||||||
search. */
|
search. */
|
||||||
{
|
{
|
||||||
register Hash_Entry *e;
|
register Hash_Entry *e;
|
||||||
@@ -411,8 +408,7 @@ Hash_EnumNext(searchPtr)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
RebuildTable(t)
|
RebuildTable(register Hash_Table *t)
|
||||||
register Hash_Table *t;
|
|
||||||
{
|
{
|
||||||
register Hash_Entry *e, *next = NULL, **hp, **xp;
|
register Hash_Entry *e, *next = NULL, **hp, **xp;
|
||||||
register int i, mask;
|
register int i, mask;
|
||||||
|
|||||||
+21
-50
@@ -153,9 +153,7 @@ void generate_ordering(void);
|
|||||||
int main(int, char *[]);
|
int main(int, char *[]);
|
||||||
|
|
||||||
int
|
int
|
||||||
main(argc, argv)
|
main(int argc, char *argv[])
|
||||||
int argc;
|
|
||||||
char *argv[];
|
|
||||||
{
|
{
|
||||||
int ch;
|
int ch;
|
||||||
|
|
||||||
@@ -199,7 +197,7 @@ main(argc, argv)
|
|||||||
* initialise various variables.
|
* initialise various variables.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
initialize()
|
initialize(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
fn_head = &fn_head_s;
|
fn_head = &fn_head_s;
|
||||||
@@ -210,10 +208,7 @@ initialize()
|
|||||||
|
|
||||||
/* generic function to insert a new strnodelist element */
|
/* generic function to insert a new strnodelist element */
|
||||||
void
|
void
|
||||||
strnode_add(listp, s, fnode)
|
strnode_add(strnodelist **listp, char *s, filenode *fnode)
|
||||||
strnodelist **listp;
|
|
||||||
char *s;
|
|
||||||
filenode *fnode;
|
|
||||||
{
|
{
|
||||||
strnodelist *ent;
|
strnodelist *ent;
|
||||||
|
|
||||||
@@ -235,8 +230,7 @@ strnode_add(listp, s, fnode)
|
|||||||
* fill in the bits, and put it in the filenode linked list
|
* fill in the bits, and put it in the filenode linked list
|
||||||
*/
|
*/
|
||||||
filenode *
|
filenode *
|
||||||
filenode_new(filename)
|
filenode_new(char *filename)
|
||||||
char *filename;
|
|
||||||
{
|
{
|
||||||
filenode *temp;
|
filenode *temp;
|
||||||
|
|
||||||
@@ -264,9 +258,7 @@ filenode_new(filename)
|
|||||||
* add a requirement to a filenode.
|
* add a requirement to a filenode.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
add_require(fnode, s)
|
add_require(filenode *fnode, char *s)
|
||||||
filenode *fnode;
|
|
||||||
char *s;
|
|
||||||
{
|
{
|
||||||
Hash_Entry *entry;
|
Hash_Entry *entry;
|
||||||
f_reqnode *rnode;
|
f_reqnode *rnode;
|
||||||
@@ -286,9 +278,7 @@ add_require(fnode, s)
|
|||||||
* have a head node, create one here.
|
* have a head node, create one here.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
add_provide(fnode, s)
|
add_provide(filenode *fnode, char *s)
|
||||||
filenode *fnode;
|
|
||||||
char *s;
|
|
||||||
{
|
{
|
||||||
Hash_Entry *entry;
|
Hash_Entry *entry;
|
||||||
f_provnode *f_pnode;
|
f_provnode *f_pnode;
|
||||||
@@ -367,9 +357,7 @@ add_provide(fnode, s)
|
|||||||
* put the BEFORE: lines to a list and handle them later.
|
* put the BEFORE: lines to a list and handle them later.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
add_before(fnode, s)
|
add_before(filenode *fnode, char *s)
|
||||||
filenode *fnode;
|
|
||||||
char *s;
|
|
||||||
{
|
{
|
||||||
strnodelist *bf_ent;
|
strnodelist *bf_ent;
|
||||||
|
|
||||||
@@ -384,9 +372,7 @@ add_before(fnode, s)
|
|||||||
* add a key to a filenode.
|
* add a key to a filenode.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
add_keyword(fnode, s)
|
add_keyword(filenode *fnode, char *s)
|
||||||
filenode *fnode;
|
|
||||||
char *s;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
strnode_add(&fnode->keyword_list, s, fnode);
|
strnode_add(&fnode->keyword_list, s, fnode);
|
||||||
@@ -397,9 +383,7 @@ add_keyword(fnode, s)
|
|||||||
* add_require() to do the real work.
|
* add_require() to do the real work.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
parse_require(node, buffer)
|
parse_require(filenode *node, char *buffer)
|
||||||
filenode *node;
|
|
||||||
char *buffer;
|
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
@@ -413,9 +397,7 @@ parse_require(node, buffer)
|
|||||||
* add_provide() to do the real work.
|
* add_provide() to do the real work.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
parse_provide(node, buffer)
|
parse_provide(filenode *node, char *buffer)
|
||||||
filenode *node;
|
|
||||||
char *buffer;
|
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
@@ -429,9 +411,7 @@ parse_provide(node, buffer)
|
|||||||
* add_before() to do the real work.
|
* add_before() to do the real work.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
parse_before(node, buffer)
|
parse_before(filenode *node, char *buffer)
|
||||||
filenode *node;
|
|
||||||
char *buffer;
|
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
@@ -445,9 +425,7 @@ parse_before(node, buffer)
|
|||||||
* add_keyword() to do the real work.
|
* add_keyword() to do the real work.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
parse_keywords(node, buffer)
|
parse_keywords(filenode *node, char *buffer)
|
||||||
filenode *node;
|
|
||||||
char *buffer;
|
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
@@ -461,8 +439,7 @@ parse_keywords(node, buffer)
|
|||||||
* for provision and requirement lines, building the graphs as needed.
|
* for provision and requirement lines, building the graphs as needed.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
crunch_file(filename)
|
crunch_file(char *filename)
|
||||||
char *filename;
|
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char *buf;
|
char *buf;
|
||||||
@@ -534,8 +511,7 @@ crunch_file(filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Hash_Entry *
|
Hash_Entry *
|
||||||
make_fake_provision(node)
|
make_fake_provision(filenode *node)
|
||||||
filenode *node;
|
|
||||||
{
|
{
|
||||||
Hash_Entry *entry;
|
Hash_Entry *entry;
|
||||||
f_provnode *f_pnode;
|
f_provnode *f_pnode;
|
||||||
@@ -581,7 +557,7 @@ make_fake_provision(node)
|
|||||||
* that provisions filenode for P.
|
* that provisions filenode for P.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
insert_before()
|
insert_before(void)
|
||||||
{
|
{
|
||||||
Hash_Entry *entry, *fake_prov_entry;
|
Hash_Entry *entry, *fake_prov_entry;
|
||||||
provnode *pnode;
|
provnode *pnode;
|
||||||
@@ -619,7 +595,7 @@ insert_before()
|
|||||||
* lines into graph(s).
|
* lines into graph(s).
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
crunch_all_files()
|
crunch_all_files(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -644,9 +620,7 @@ crunch_all_files()
|
|||||||
* provision.
|
* provision.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
satisfy_req(rnode, filename)
|
satisfy_req(f_reqnode *rnode, char *filename)
|
||||||
f_reqnode *rnode;
|
|
||||||
char *filename;
|
|
||||||
{
|
{
|
||||||
Hash_Entry *entry;
|
Hash_Entry *entry;
|
||||||
provnode *head;
|
provnode *head;
|
||||||
@@ -687,8 +661,7 @@ satisfy_req(rnode, filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
skip_ok(fnode)
|
skip_ok(filenode *fnode)
|
||||||
filenode *fnode;
|
|
||||||
{
|
{
|
||||||
strnodelist *s;
|
strnodelist *s;
|
||||||
strnodelist *k;
|
strnodelist *k;
|
||||||
@@ -702,8 +675,7 @@ skip_ok(fnode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
keep_ok(fnode)
|
keep_ok(filenode *fnode)
|
||||||
filenode *fnode;
|
|
||||||
{
|
{
|
||||||
strnodelist *s;
|
strnodelist *s;
|
||||||
strnodelist *k;
|
strnodelist *k;
|
||||||
@@ -728,8 +700,7 @@ keep_ok(fnode)
|
|||||||
* Circular dependancies will cause problems if we do.
|
* Circular dependancies will cause problems if we do.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
do_file(fnode)
|
do_file(filenode *fnode)
|
||||||
filenode *fnode;
|
|
||||||
{
|
{
|
||||||
f_reqnode *r, *r_tmp;
|
f_reqnode *r, *r_tmp;
|
||||||
f_provnode *p, *p_tmp;
|
f_provnode *p, *p_tmp;
|
||||||
@@ -812,7 +783,7 @@ do_file(fnode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
generate_ordering()
|
generate_ordering(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -770,7 +770,7 @@ done: *argvp = argv + 1;
|
|||||||
|
|
||||||
/* Finish any pending -exec ... {} + functions. */
|
/* Finish any pending -exec ... {} + functions. */
|
||||||
void
|
void
|
||||||
finish_execplus()
|
finish_execplus(void)
|
||||||
{
|
{
|
||||||
PLAN *p;
|
PLAN *p;
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ void usage(void);
|
|||||||
int main(int, char **);
|
int main(int, char **);
|
||||||
|
|
||||||
void
|
void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "usage: %s catfile msgfile ...\n", getprogname());
|
fprintf(stderr, "usage: %s catfile msgfile ...\n", getprogname());
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ ENCODING { return(ENCODING); }
|
|||||||
|
|
||||||
#if !defined(yywrap)
|
#if !defined(yywrap)
|
||||||
int
|
int
|
||||||
yywrap()
|
yywrap(void)
|
||||||
{
|
{
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-22
@@ -266,22 +266,20 @@ main(int ac, char *av[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "usage: mklocale [-d] [-o output] [source]\n");
|
fprintf(stderr, "usage: mklocale [-d] [-o output] [source]\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
yyerror(s)
|
yyerror(const char *s)
|
||||||
const char *s;
|
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s\n", s);
|
fprintf(stderr, "%s\n", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
xmalloc(sz)
|
xmalloc(unsigned int sz)
|
||||||
unsigned int sz;
|
|
||||||
{
|
{
|
||||||
void *r = malloc(sz);
|
void *r = malloc(sz);
|
||||||
if (!r)
|
if (!r)
|
||||||
@@ -290,8 +288,7 @@ xmalloc(sz)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t *
|
static uint32_t *
|
||||||
xlalloc(sz)
|
xlalloc(unsigned int sz)
|
||||||
unsigned int sz;
|
|
||||||
{
|
{
|
||||||
uint32_t *r = (uint32_t *)malloc(sz * sizeof(uint32_t));
|
uint32_t *r = (uint32_t *)malloc(sz * sizeof(uint32_t));
|
||||||
if (!r)
|
if (!r)
|
||||||
@@ -300,9 +297,7 @@ xlalloc(sz)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t *
|
static uint32_t *
|
||||||
xrelalloc(old, sz)
|
xrelalloc(uint32_t *old, unsigned int sz)
|
||||||
uint32_t *old;
|
|
||||||
unsigned int sz;
|
|
||||||
{
|
{
|
||||||
uint32_t *r = (uint32_t *)realloc((char *)old,
|
uint32_t *r = (uint32_t *)realloc((char *)old,
|
||||||
sz * sizeof(uint32_t));
|
sz * sizeof(uint32_t));
|
||||||
@@ -312,10 +307,7 @@ xrelalloc(old, sz)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
set_map(map, list, flag)
|
set_map(rune_map *map, rune_list *list, uint32_t flag)
|
||||||
rune_map *map;
|
|
||||||
rune_list *list;
|
|
||||||
uint32_t flag;
|
|
||||||
{
|
{
|
||||||
while (list) {
|
while (list) {
|
||||||
rune_list *nlist = list->next;
|
rune_list *nlist = list->next;
|
||||||
@@ -325,9 +317,7 @@ set_map(map, list, flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
set_digitmap(map, list)
|
set_digitmap(rune_map *map, rune_list *list)
|
||||||
rune_map *map;
|
|
||||||
rune_list *list;
|
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
|
|
||||||
@@ -347,10 +337,7 @@ set_digitmap(map, list)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
add_map(map, list, flag)
|
add_map(rune_map *map, rune_list *list, uint32_t flag)
|
||||||
rune_map *map;
|
|
||||||
rune_list *list;
|
|
||||||
uint32_t flag;
|
|
||||||
{
|
{
|
||||||
int32_t i;
|
int32_t i;
|
||||||
rune_list *lr = 0;
|
rune_list *lr = 0;
|
||||||
@@ -555,7 +542,7 @@ add_map(map, list, flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dump_tables()
|
dump_tables(void)
|
||||||
{
|
{
|
||||||
int x, first_d, curr_d;
|
int x, first_d, curr_d;
|
||||||
rune_list *list;
|
rune_list *list;
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ include(const char *fname, int ateof)
|
|||||||
* Terminate the most recent inclusion.
|
* Terminate the most recent inclusion.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
endinclude()
|
endinclude(void)
|
||||||
{
|
{
|
||||||
struct incl *in;
|
struct incl *in;
|
||||||
int ateof;
|
int ateof;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ static int do_update(const char *dev);
|
|||||||
static void datadir_add(const char *path);
|
static void datadir_add(const char *path);
|
||||||
|
|
||||||
static void __dead2
|
static void __dead2
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ action(char *line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dump_config()
|
dump_config(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
ofwo_dump();
|
ofwo_dump();
|
||||||
|
|||||||
@@ -762,7 +762,7 @@ LookupWord(char *buff)
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
yylex()
|
yylex(void)
|
||||||
{
|
{
|
||||||
char c;
|
char c;
|
||||||
char *p;
|
char *p;
|
||||||
|
|||||||
@@ -49,9 +49,7 @@ static void output(struct ulog_utmpx *);
|
|||||||
static void usage(void);
|
static void usage(void);
|
||||||
|
|
||||||
int
|
int
|
||||||
main(argc, argv)
|
main(int argc, char *argv[])
|
||||||
int argc;
|
|
||||||
char *argv[];
|
|
||||||
{
|
{
|
||||||
int ch, i;
|
int ch, i;
|
||||||
struct ulog_utmpx *u;
|
struct ulog_utmpx *u;
|
||||||
@@ -102,7 +100,7 @@ output(struct ulog_utmpx *u)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "usage: lastlogin [user ...]\n");
|
fprintf(stderr, "usage: lastlogin [user ...]\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|||||||
@@ -842,7 +842,7 @@ setbindhost(struct addrinfo **ai, const char *bindhost, struct addrinfo hints)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
(void)fprintf(stderr, "usage: nfsd %s\n", USAGE);
|
(void)fprintf(stderr, "usage: nfsd %s\n", USAGE);
|
||||||
exit(1);
|
exit(1);
|
||||||
@@ -868,7 +868,7 @@ reapchild(__unused int signo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
unregistration()
|
unregistration(void)
|
||||||
{
|
{
|
||||||
if ((!rpcb_unset(NFS_PROGRAM, 2, NULL)) ||
|
if ((!rpcb_unset(NFS_PROGRAM, 2, NULL)) ||
|
||||||
(!rpcb_unset(NFS_PROGRAM, 3, NULL)))
|
(!rpcb_unset(NFS_PROGRAM, 3, NULL)))
|
||||||
@@ -876,7 +876,7 @@ unregistration()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
killchildren()
|
killchildren(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ fqueue_compact(float th)
|
|||||||
* Flush the first-level aggregates queue.
|
* Flush the first-level aggregates queue.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
fqueue_deleteall()
|
fqueue_deleteall(void)
|
||||||
{
|
{
|
||||||
struct aggent *agg;
|
struct aggent *agg;
|
||||||
|
|
||||||
@@ -472,7 +472,7 @@ fqueue_insertgen(void)
|
|||||||
* Flush the raw entries general queue.
|
* Flush the raw entries general queue.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
general_deleteall()
|
general_deleteall(void)
|
||||||
{
|
{
|
||||||
struct entry *obj;
|
struct entry *obj;
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
* to APM. If nothing succeeds, we'll just run in default mode.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
acline_init()
|
acline_init(void)
|
||||||
{
|
{
|
||||||
acline_mib_len = 4;
|
acline_mib_len = 4;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -300,7 +300,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
(void)fprintf(stderr,
|
(void)fprintf(stderr,
|
||||||
"usage: sa [-abcdDfijkKlmnqrstu] [-P file] [-U file] [-v cutoff] [file ...]\n");
|
"usage: sa [-abcdDfijkKlmnqrstu] [-P file] [-U file] [-v cutoff] [file ...]\n");
|
||||||
|
|||||||
+4
-4
@@ -94,14 +94,14 @@ v1_to_v2(DBT *key __unused, DBT *data)
|
|||||||
|
|
||||||
/* Copy pdb_file to in-memory pacct_db. */
|
/* Copy pdb_file to in-memory pacct_db. */
|
||||||
int
|
int
|
||||||
pacct_init()
|
pacct_init(void)
|
||||||
{
|
{
|
||||||
return (db_copy_in(&pacct_db, pdb_file, "process accounting",
|
return (db_copy_in(&pacct_db, pdb_file, "process accounting",
|
||||||
NULL, v1_to_v2));
|
NULL, v1_to_v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pacct_destroy()
|
pacct_destroy(void)
|
||||||
{
|
{
|
||||||
db_destroy(pacct_db, "process accounting");
|
db_destroy(pacct_db, "process accounting");
|
||||||
}
|
}
|
||||||
@@ -150,14 +150,14 @@ pacct_add(const struct cmdinfo *ci)
|
|||||||
|
|
||||||
/* Copy in-memory pacct_db to pdb_file. */
|
/* Copy in-memory pacct_db to pdb_file. */
|
||||||
int
|
int
|
||||||
pacct_update()
|
pacct_update(void)
|
||||||
{
|
{
|
||||||
return (db_copy_out(pacct_db, pdb_file, "process accounting",
|
return (db_copy_out(pacct_db, pdb_file, "process accounting",
|
||||||
NULL));
|
NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pacct_print()
|
pacct_print(void)
|
||||||
{
|
{
|
||||||
BTREEINFO bti;
|
BTREEINFO bti;
|
||||||
DBT key, data, ndata;
|
DBT key, data, ndata;
|
||||||
|
|||||||
+4
-4
@@ -97,7 +97,7 @@ v1_to_v2(DBT *key, DBT *data)
|
|||||||
|
|
||||||
/* Copy usrdb_file to in-memory usracct_db. */
|
/* Copy usrdb_file to in-memory usracct_db. */
|
||||||
int
|
int
|
||||||
usracct_init()
|
usracct_init(void)
|
||||||
{
|
{
|
||||||
BTREEINFO bti;
|
BTREEINFO bti;
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ usracct_init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
usracct_destroy()
|
usracct_destroy(void)
|
||||||
{
|
{
|
||||||
db_destroy(usracct_db, "user accounting");
|
db_destroy(usracct_db, "user accounting");
|
||||||
}
|
}
|
||||||
@@ -166,7 +166,7 @@ usracct_add(const struct cmdinfo *ci)
|
|||||||
|
|
||||||
/* Copy in-memory usracct_db to usrdb_file. */
|
/* Copy in-memory usracct_db to usrdb_file. */
|
||||||
int
|
int
|
||||||
usracct_update()
|
usracct_update(void)
|
||||||
{
|
{
|
||||||
BTREEINFO bti;
|
BTREEINFO bti;
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ usracct_update()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
usracct_print()
|
usracct_print(void)
|
||||||
{
|
{
|
||||||
DBT key, data;
|
DBT key, data;
|
||||||
struct userinfo uistore, *ui = &uistore;
|
struct userinfo uistore, *ui = &uistore;
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ sighandler(int signum)
|
|||||||
* Open the watchdog device.
|
* Open the watchdog device.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
watchdog_init()
|
watchdog_init(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
fd = open("/dev/" _PATH_WATCHDOG, O_RDWR);
|
fd = open("/dev/" _PATH_WATCHDOG, O_RDWR);
|
||||||
@@ -220,7 +220,7 @@ watchdog_onoff(int onoff)
|
|||||||
* Tell user how to use the program.
|
* Tell user how to use the program.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
if (is_daemon)
|
if (is_daemon)
|
||||||
fprintf(stderr, "usage: watchdogd [-d] [-e cmd] [-I file] [-s sleep] [-t timeout]\n");
|
fprintf(stderr, "usage: watchdogd [-d] [-e cmd] [-I file] [-s sleep] [-t timeout]\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user