ANSIify function definitions to avoid a warning.

This commit is contained in:
dwmalone 2002-07-28 15:50:38 +00:00
parent 7eeb84c96d
commit 13b25f0d4e
9 changed files with 31 additions and 54 deletions

View File

@ -56,7 +56,7 @@ static int str_entry(int);
* read .c and .h files and call appropriate routines * read .c and .h files and call appropriate routines
*/ */
void void
c_entries() c_entries(void)
{ {
int c; /* current character */ int c; /* current character */
int level; /* brace level */ int level; /* brace level */
@ -259,7 +259,7 @@ c_entries()
* handle a function reference * handle a function reference
*/ */
static int static int
func_entry() func_entry(void)
{ {
int c; /* current character */ int c; /* current character */
int level = 0; /* for matching '()' */ int level = 0; /* for matching '()' */
@ -323,7 +323,7 @@ func_entry()
* handle a line starting with a '#' * handle a line starting with a '#'
*/ */
static void static void
hash_entry() hash_entry(void)
{ {
int c; /* character read */ int c; /* character read */
int curline; /* line started on */ int curline; /* line started on */
@ -389,8 +389,7 @@ skip: if (c == '\n') { /* get rid of rest of define */
* handle a struct, union or enum entry * handle a struct, union or enum entry
*/ */
static int static int
str_entry(c) str_entry(int c) /* c is current character */
int c; /* current character */
{ {
int curline; /* line started on */ int curline; /* line started on */
char *sp; /* buffer pointer */ char *sp; /* buffer pointer */
@ -439,8 +438,7 @@ str_entry(c)
* skip over comment * skip over comment
*/ */
void void
skip_comment(t) skip_comment(int t) /* t is comment character */
int t; /* comment character */
{ {
int c; /* character read */ int c; /* character read */
int star; /* '*' flag */ int star; /* '*' flag */
@ -471,8 +469,7 @@ skip_comment(t)
* skip to the end of a string or character constant. * skip to the end of a string or character constant.
*/ */
void void
skip_string(key) skip_string(int key)
int key;
{ {
int c, int c,
skip; skip;
@ -497,8 +494,7 @@ skip_string(key)
* skip to next char "key" * skip to next char "key"
*/ */
int int
skip_key(key) skip_key(int key)
int key;
{ {
int c, int c,
skip, skip,

View File

@ -86,9 +86,7 @@ void find_entries(char *);
static void usage(void); static void usage(void);
int int
main(argc, argv) main(int argc, char **argv)
int argc;
char **argv;
{ {
static const char *outfile = "tags"; /* output file */ static const char *outfile = "tags"; /* output file */
int aflag; /* -a: append to tags */ int aflag; /* -a: append to tags */
@ -197,7 +195,7 @@ main(argc, argv)
} }
static void static void
usage() usage(void)
{ {
(void)fprintf(stderr, "usage: ctags [-BFTaduwvx] [-f tagsfile] file ...\n"); (void)fprintf(stderr, "usage: ctags [-BFTaduwvx] [-f tagsfile] file ...\n");
exit(1); exit(1);
@ -214,7 +212,7 @@ usage()
* the string CWHITE, else NO. * the string CWHITE, else NO.
*/ */
void void
init() init(void)
{ {
int i; int i;
const unsigned char *sp; const unsigned char *sp;
@ -246,8 +244,7 @@ init()
* which searches the file. * which searches the file.
*/ */
void void
find_entries(file) find_entries(char *file)
char *file;
{ {
char *cp; char *cp;

View File

@ -140,8 +140,7 @@ PF_funcs()
* do case-independent strcmp * do case-independent strcmp
*/ */
int int
cicmp(cp) cicmp(const char *cp)
const char *cp;
{ {
int len; int len;
char *bp; char *bp;
@ -157,7 +156,7 @@ cicmp(cp)
} }
static void static void
takeprec() takeprec(void)
{ {
for (; isspace(*lbp); ++lbp) for (; isspace(*lbp); ++lbp)
continue; continue;

View File

@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$");
* just look for (def or (DEF * just look for (def or (DEF
*/ */
void void
l_entries() l_entries(void)
{ {
int special; int special;
char *cp; char *cp;

View File

@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$");
* prepare it for printing. * prepare it for printing.
*/ */
void void
getline() getline(void)
{ {
long saveftell; long saveftell;
int c; int c;
@ -98,8 +98,7 @@ getline()
* write out the tags * write out the tags
*/ */
void void
put_entries(node) put_entries(NODE *node)
NODE *node;
{ {
if (node->left) if (node->left)

View File

@ -56,9 +56,7 @@ static void free_tree(NODE *);
* enter a new node in the tree * enter a new node in the tree
*/ */
void void
pfnote(name, ln) pfnote(const char *name, int ln)
const char *name;
int ln;
{ {
NODE *np; NODE *np;
char *fp; char *fp;
@ -98,9 +96,7 @@ pfnote(name, ln)
} }
static void static void
add_node(node, cur_node) add_node(NODE *node, NODE *cur_node)
NODE *node,
*cur_node;
{ {
int dif; int dif;
@ -128,8 +124,7 @@ add_node(node, cur_node)
} }
static void static void
free_tree(node) free_tree(NODE *node)
NODE *node;
{ {
while (node) { while (node) {
if (node->right) if (node->right)

View File

@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$");
* find the yacc tags and put them in. * find the yacc tags and put them in.
*/ */
void void
y_entries() y_entries(void)
{ {
int c; int c;
char *sp; char *sp;
@ -123,7 +123,7 @@ y_entries()
* throw away lines up to the next "\n%%\n" * throw away lines up to the next "\n%%\n"
*/ */
void void
toss_yysec() toss_yysec(void)
{ {
int c; /* read character */ int c; /* read character */
int state; int state;

View File

@ -52,9 +52,7 @@ __FBSDID("$FreeBSD$");
void usage(void); void usage(void);
int int
main(argc, argv) main(int argc, char **argv)
int argc;
char **argv;
{ {
char *p; char *p;
int ch; int ch;
@ -78,7 +76,7 @@ main(argc, argv)
} }
void void
usage() usage(void)
{ {
(void)fprintf(stderr, "usage: dirname path\n"); (void)fprintf(stderr, "usage: dirname path\n");

View File

@ -104,9 +104,7 @@ void ignoreclean(void);
int ignorep(FTSENT *); int ignorep(FTSENT *);
int int
main(argc, argv) main(int argc, char *argv[])
int argc;
char *argv[];
{ {
FTS *fts; FTS *fts;
FTSENT *p; FTSENT *p;
@ -317,8 +315,7 @@ typedef struct _ID {
int int
linkchk(p) linkchk(FTSENT *p)
FTSENT *p;
{ {
static ID *files; static ID *files;
static int maxfiles, nfiles; static int maxfiles, nfiles;
@ -349,8 +346,7 @@ linkchk(p)
* *
*/ */
unit_t unit_t
unit_adjust(val) unit_adjust(double *val)
double *val;
{ {
double abval; double abval;
unit_t unit; unit_t unit;
@ -371,8 +367,7 @@ unit_adjust(val)
} }
void void
prthumanval(bytes) prthumanval(double bytes)
double bytes;
{ {
unit_t unit; unit_t unit;
@ -388,7 +383,7 @@ prthumanval(bytes)
} }
static void static void
usage() usage(void)
{ {
(void)fprintf(stderr, (void)fprintf(stderr,
"usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k] [-x] [-I mask] [file ...]\n"); "usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k] [-x] [-I mask] [file ...]\n");
@ -396,8 +391,7 @@ usage()
} }
void void
ignoreadd(mask) ignoreadd(const char *mask)
const char *mask;
{ {
struct ignentry *ign; struct ignentry *ign;
@ -411,7 +405,7 @@ ignoreadd(mask)
} }
void void
ignoreclean() ignoreclean(void)
{ {
struct ignentry *ign; struct ignentry *ign;
@ -424,8 +418,7 @@ ignoreclean()
} }
int int
ignorep(ent) ignorep(FTSENT *ent)
FTSENT *ent;
{ {
struct ignentry *ign; struct ignentry *ign;