Scrub up some function prototypes.

-Erik
This commit is contained in:
Eric Andersen 2001-10-18 04:11:39 +00:00
parent 8acbf1d307
commit 74400ccfd0
22 changed files with 95 additions and 114 deletions

View File

@ -86,7 +86,7 @@ STRIPTOOL = $(CROSS)strip
# To compile vs uClibc, just use the compiler wrapper built by uClibc...
# Everything should compile and work as expected these days...
#CC = ../uClibc/extra/gcc-uClibc/i386-uclibc-gcc
#CC = /usr/i386-linux-uclibc/usr/bin/i386-uclibc-gcc
# To compile vs some other alternative libc, you may need to use/adjust
# the following lines to meet your needs...
@ -110,8 +110,7 @@ STRIPTOOL = $(CROSS)strip
OPTIMIZATION := $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
then echo "-Os"; else echo "-O2" ; fi)
WARNINGS = -Wall -Wshadow
WARNINGS=-Wall -Wstrict-prototypes -Wshadow
ARFLAGS = -r
#

View File

@ -354,7 +354,7 @@ static void clear_bufs(void)
bytes_in = 0L;
}
static void write_error_msg()
static void write_error_msg(void)
{
fprintf(stderr, "\n");
perror("");

View File

@ -115,13 +115,13 @@ static const unsigned short mask_bits[] = {
* Signal and error handler.
*/
static void abort_gzip()
static void abort_gzip(void)
{
error_msg("gzip aborted\n");
exit(ERROR);
}
static void make_crc_table()
static void make_crc_table(void)
{
unsigned long table_entry; /* crc shift register */
unsigned long poly = 0; /* polynomial exclusive-or pattern */
@ -853,7 +853,7 @@ static int inflate_block(int *e)
*
* GLOBAL VARIABLES: outcnt, bk, bb, hufts, inptr
*/
static int inflate()
static int inflate(void)
{
int e; /* last block flag */
int r; /* result code */

View File

@ -115,13 +115,13 @@ static const unsigned short mask_bits[] = {
* Signal and error handler.
*/
static void abort_gzip()
static void abort_gzip(void)
{
error_msg("gzip aborted\n");
exit(ERROR);
}
static void make_crc_table()
static void make_crc_table(void)
{
unsigned long table_entry; /* crc shift register */
unsigned long poly = 0; /* polynomial exclusive-or pattern */
@ -853,7 +853,7 @@ static int inflate_block(int *e)
*
* GLOBAL VARIABLES: outcnt, bk, bb, hufts, inptr
*/
static int inflate()
static int inflate(void)
{
int e; /* last block flag */
int r; /* result code */

31
ash.c
View File

@ -2508,9 +2508,7 @@ out:
* of all the rest.)
*/
static inline void
evalpipe(n)
union node *n;
static inline void evalpipe(union node *n)
{
struct job *jp;
struct nodelist *lp;
@ -3453,8 +3451,8 @@ pgetc(void)
* PEOF may be pushed back.
*/
static void
pungetc() {
static void pungetc(void)
{
parsenleft++;
parsenextc--;
}
@ -3496,8 +3494,8 @@ popallfiles(void) {
* after a fork is done.
*/
static void
closescript() {
static void closescript(void)
{
popallfiles();
if (parsefile->fd > 0) {
close(parsefile->fd);
@ -3511,9 +3509,7 @@ closescript() {
* interrupts off.
*/
static void
setinputfd(fd, push)
int fd, push;
static void setinputfd(int fd, int push)
{
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
if (push) {
@ -4471,10 +4467,7 @@ expandarg(arg, arglist, flag)
* input string.
*/
static inline char *
evalvar(p, flag)
char *p;
int flag;
static inline char * evalvar(char *p, int flag)
{
int subtype;
int varflags;
@ -6075,7 +6068,7 @@ static inline void putprompt(const char *s) {
#ifdef ASH_ALIAS
static int
pgetc2()
pgetc2(void)
{
int c;
do {
@ -6349,7 +6342,8 @@ static int fd0_redirected = 0;
/* Return true if fd 0 has already been redirected at least once. */
static inline int
fd0_redirected_p () {
fd0_redirected_p (void)
{
return fd0_redirected != 0;
}
@ -7971,8 +7965,7 @@ readcmdfile(const char *name)
static inline char *
find_dot_file(mybasename)
char *mybasename;
find_dot_file(char *mybasename)
{
char *fullname;
const char *path = pathval();
@ -12761,7 +12754,7 @@ findvar(struct var **vpp, const char *name)
/*
* Copyright (c) 1999 Herbert Xu <herbert@debian.org>
* This file contains code for the times builtin.
* $Id: ash.c,v 1.25 2001/09/11 01:14:02 mjn3 Exp $
* $Id: ash.c,v 1.26 2001/10/18 04:11:38 andersen Exp $
*/
static int timescmd (int argc, char **argv)
{

View File

@ -51,7 +51,7 @@ static void tailbuf_append(char *buf, int len)
taillen += len;
}
static void tailbuf_trunc()
static void tailbuf_trunc(void)
{
char *s;
s = memchr(tailbuf, '\n', taillen);

View File

@ -158,21 +158,21 @@ static struct t_op const *t_wp_op;
static gid_t *group_array = NULL;
static int ngroups;
static enum token t_lex();
static int oexpr();
static int aexpr();
static int nexpr();
static int binop();
static int primary();
static int filstat();
static int getn();
static int newerf();
static int olderf();
static int equalf();
static void syntax();
static int test_eaccess();
static int is_a_group_member();
static void initialize_group_array();
static enum token t_lex(char* s);
static int oexpr(enum token n);
static int aexpr(enum token n);
static int nexpr(enum token n);
static int binop(void);
static int primary(enum token n);
static int filstat(char *nm, enum token mode);
static int getn(const char *s);
static int newerf(const char *f1, const char *f2);
static int olderf(const char *f1, const char *f2);
static int equalf(const char *f1, const char *f2);
static void syntax(const char *op, const char *msg);
static int test_eaccess(char *path, int mode);
static int is_a_group_member(gid_t gid);
static void initialize_group_array(void);
extern int
test_main(int argc, char** argv)
@ -226,8 +226,8 @@ test_main(int argc, char** argv)
static void
syntax(op, msg)
char *op;
char *msg;
const char *op;
const char *msg;
{
if (op && *op)
error_msg_and_die("%s: %s", op, msg);
@ -458,7 +458,7 @@ t_lex(s)
/* atoi with error detection */
static int
getn(s)
char *s;
const char *s;
{
char *p;
long r;
@ -480,7 +480,7 @@ getn(s)
static int
newerf (f1, f2)
char *f1, *f2;
const char *f1, *f2;
{
struct stat b1, b2;
@ -491,7 +491,7 @@ char *f1, *f2;
static int
olderf (f1, f2)
char *f1, *f2;
const char *f1, *f2;
{
struct stat b1, b2;
@ -502,7 +502,7 @@ char *f1, *f2;
static int
equalf (f1, f2)
char *f1, *f2;
const char *f1, *f2;
{
struct stat b1, b2;

View File

@ -30,7 +30,6 @@
extern int optind; /* in unistd.h */
extern int errno; /* for use with strerror() */
extern void xregcomp(regex_t *preg, const char *regex, int cflags); /* in busybox.h */
/* options */

1
grep.c
View File

@ -30,7 +30,6 @@
extern int optind; /* in unistd.h */
extern int errno; /* for use with strerror() */
extern void xregcomp(regex_t *preg, const char *regex, int cflags); /* in busybox.h */
/* options */

2
gzip.c
View File

@ -354,7 +354,7 @@ static void clear_bufs(void)
bytes_in = 0L;
}
static void write_error_msg()
static void write_error_msg(void)
{
fprintf(stderr, "\n");
perror("");

8
init.c
View File

@ -179,7 +179,7 @@ static char console[32] = _PATH_CONSOLE;
static void delete_initAction(initAction * action);
static void loop_forever()
static void loop_forever(void)
{
while (1)
sleep (1);
@ -289,7 +289,7 @@ static void set_term(int fd)
/* How much memory does this machine have?
Units are kBytes to avoid overflow on 4GB machines */
static int check_free_memory()
static int check_free_memory(void)
{
struct sysinfo info;
unsigned int result, u, s=10;
@ -310,7 +310,7 @@ static int check_free_memory()
return result;
}
static void console_init()
static void console_init(void)
{
int fd;
int tried_devcons = 0;
@ -585,7 +585,7 @@ static int waitfor(char *command, char *terminal, int get_enter)
/* Make sure there is enough memory to do something useful. *
* Calls "swapon -a" if needed so be sure /etc/fstab is present... */
static void check_memory()
static void check_memory(void)
{
struct stat statBuf;

View File

@ -179,7 +179,7 @@ static char console[32] = _PATH_CONSOLE;
static void delete_initAction(initAction * action);
static void loop_forever()
static void loop_forever(void)
{
while (1)
sleep (1);
@ -289,7 +289,7 @@ static void set_term(int fd)
/* How much memory does this machine have?
Units are kBytes to avoid overflow on 4GB machines */
static int check_free_memory()
static int check_free_memory(void)
{
struct sysinfo info;
unsigned int result, u, s=10;
@ -310,7 +310,7 @@ static int check_free_memory()
return result;
}
static void console_init()
static void console_init(void)
{
int fd;
int tried_devcons = 0;
@ -585,7 +585,7 @@ static int waitfor(char *command, char *terminal, int get_enter)
/* Make sure there is enough memory to do something useful. *
* Calls "swapon -a" if needed so be sure /etc/fstab is present... */
static void check_memory()
static void check_memory(void)
{
struct stat statBuf;

View File

@ -115,13 +115,13 @@ static const unsigned short mask_bits[] = {
* Signal and error handler.
*/
static void abort_gzip()
static void abort_gzip(void)
{
error_msg("gzip aborted\n");
exit(ERROR);
}
static void make_crc_table()
static void make_crc_table(void)
{
unsigned long table_entry; /* crc shift register */
unsigned long poly = 0; /* polynomial exclusive-or pattern */
@ -853,7 +853,7 @@ static int inflate_block(int *e)
*
* GLOBAL VARIABLES: outcnt, bk, bb, hufts, inptr
*/
static int inflate()
static int inflate(void)
{
int e; /* last block flag */
int r; /* result code */

View File

@ -27,12 +27,11 @@
#include <stdarg.h>
#include <netdb.h>
extern int h_errno;
#include <stdio.h>
#include "libbb.h"
extern void vherror_msg(const char *s, va_list p)
{
if(s == 0)

View File

@ -22,10 +22,9 @@
*/
#include <netdb.h>
extern int h_errno;
#include "libbb.h"
struct hostent *xgethostbyname(const char *name)
{
struct hostent *retval;

View File

@ -81,7 +81,7 @@ static struct swap_header_v1 {
unsigned int badpages[1];
} *p;
static void init_signature_page()
static void init_signature_page(void)
{
pagesize = getpagesize();

View File

@ -2508,9 +2508,7 @@ out:
* of all the rest.)
*/
static inline void
evalpipe(n)
union node *n;
static inline void evalpipe(union node *n)
{
struct job *jp;
struct nodelist *lp;
@ -3453,8 +3451,8 @@ pgetc(void)
* PEOF may be pushed back.
*/
static void
pungetc() {
static void pungetc(void)
{
parsenleft++;
parsenextc--;
}
@ -3496,8 +3494,8 @@ popallfiles(void) {
* after a fork is done.
*/
static void
closescript() {
static void closescript(void)
{
popallfiles();
if (parsefile->fd > 0) {
close(parsefile->fd);
@ -3511,9 +3509,7 @@ closescript() {
* interrupts off.
*/
static void
setinputfd(fd, push)
int fd, push;
static void setinputfd(int fd, int push)
{
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
if (push) {
@ -4471,10 +4467,7 @@ expandarg(arg, arglist, flag)
* input string.
*/
static inline char *
evalvar(p, flag)
char *p;
int flag;
static inline char * evalvar(char *p, int flag)
{
int subtype;
int varflags;
@ -6075,7 +6068,7 @@ static inline void putprompt(const char *s) {
#ifdef ASH_ALIAS
static int
pgetc2()
pgetc2(void)
{
int c;
do {
@ -6349,7 +6342,8 @@ static int fd0_redirected = 0;
/* Return true if fd 0 has already been redirected at least once. */
static inline int
fd0_redirected_p () {
fd0_redirected_p (void)
{
return fd0_redirected != 0;
}
@ -7971,8 +7965,7 @@ readcmdfile(const char *name)
static inline char *
find_dot_file(mybasename)
char *mybasename;
find_dot_file(char *mybasename)
{
char *fullname;
const char *path = pathval();
@ -12761,7 +12754,7 @@ findvar(struct var **vpp, const char *name)
/*
* Copyright (c) 1999 Herbert Xu <herbert@debian.org>
* This file contains code for the times builtin.
* $Id: ash.c,v 1.25 2001/09/11 01:14:02 mjn3 Exp $
* $Id: ash.c,v 1.26 2001/10/18 04:11:38 andersen Exp $
*/
static int timescmd (int argc, char **argv)
{

View File

@ -59,7 +59,7 @@ static void swap_enable_disable(char *device)
perror_msg_and_die(applet_name);
}
static void do_em_all()
static void do_em_all(void)
{
struct mntent *m;
FILE *f = setmntent("/etc/fstab", "r");

2
tail.c
View File

@ -51,7 +51,7 @@ static void tailbuf_append(char *buf, int len)
taillen += len;
}
static void tailbuf_trunc()
static void tailbuf_trunc(void)
{
char *s;
s = memchr(tailbuf, '\n', taillen);

42
test.c
View File

@ -158,21 +158,21 @@ static struct t_op const *t_wp_op;
static gid_t *group_array = NULL;
static int ngroups;
static enum token t_lex();
static int oexpr();
static int aexpr();
static int nexpr();
static int binop();
static int primary();
static int filstat();
static int getn();
static int newerf();
static int olderf();
static int equalf();
static void syntax();
static int test_eaccess();
static int is_a_group_member();
static void initialize_group_array();
static enum token t_lex(char* s);
static int oexpr(enum token n);
static int aexpr(enum token n);
static int nexpr(enum token n);
static int binop(void);
static int primary(enum token n);
static int filstat(char *nm, enum token mode);
static int getn(const char *s);
static int newerf(const char *f1, const char *f2);
static int olderf(const char *f1, const char *f2);
static int equalf(const char *f1, const char *f2);
static void syntax(const char *op, const char *msg);
static int test_eaccess(char *path, int mode);
static int is_a_group_member(gid_t gid);
static void initialize_group_array(void);
extern int
test_main(int argc, char** argv)
@ -226,8 +226,8 @@ test_main(int argc, char** argv)
static void
syntax(op, msg)
char *op;
char *msg;
const char *op;
const char *msg;
{
if (op && *op)
error_msg_and_die("%s: %s", op, msg);
@ -458,7 +458,7 @@ t_lex(s)
/* atoi with error detection */
static int
getn(s)
char *s;
const char *s;
{
char *p;
long r;
@ -480,7 +480,7 @@ getn(s)
static int
newerf (f1, f2)
char *f1, *f2;
const char *f1, *f2;
{
struct stat b1, b2;
@ -491,7 +491,7 @@ char *f1, *f2;
static int
olderf (f1, f2)
char *f1, *f2;
const char *f1, *f2;
{
struct stat b1, b2;
@ -502,7 +502,7 @@ char *f1, *f2;
static int
equalf (f1, f2)
char *f1, *f2;
const char *f1, *f2;
{
struct stat b1, b2;

View File

@ -81,7 +81,7 @@ static struct swap_header_v1 {
unsigned int badpages[1];
} *p;
static void init_signature_page()
static void init_signature_page(void)
{
pagesize = getpagesize();

View File

@ -59,7 +59,7 @@ static void swap_enable_disable(char *device)
perror_msg_and_die(applet_name);
}
static void do_em_all()
static void do_em_all(void)
{
struct mntent *m;
FILE *f = setmntent("/etc/fstab", "r");