mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 16:21:06 +00:00
Convert a few more function definitions to prototype style.
This patch converts a few more function definitions in glibc from old-style K&R to prototype style. This is sufficient to build and test on x86_64 and x86 with -Wold-style-definition (I'll test on some more architectures before proposing the actual addition of -Wold-style-definition). Tested for x86_64 and x86 with -Wold-style-definition in use (testsuite - this patch affects files containing assertions). * io/fts.c (fts_open): Convert to prototype-style function definition. * malloc/mcheck.c (mcheck): Likewise. (mcheck_pedantic): Likewise. * posix/regexec.c (re_search_2_stub): Likewise. Use internal_function. (re_search_internal): Likewise. * resolv/res_init.c [RESOLVSORT] (net_mask): Convert to prototype-style function definition. * sunrpc/clnt_udp.c (clntudp_call): Likewise. * sunrpc/pmap_rmt.c (clnt_broadcast): Likewise. * sunrpc/rpcsvc/rusers.x (xdr_utmp): Likewise. (xdr_utmpptr): Likewise. (xdr_utmparr): Likewise. (xdr_utmpidle): Likewise. (xdr_utmpidleptr): Likewise. (xdr_utmpidlearr): Likewise.
This commit is contained in:
parent
ca88f362a7
commit
85231522bb
18
ChangeLog
18
ChangeLog
@ -1,5 +1,23 @@
|
|||||||
2015-10-21 Joseph Myers <joseph@codesourcery.com>
|
2015-10-21 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
* io/fts.c (fts_open): Convert to prototype-style function
|
||||||
|
definition.
|
||||||
|
* malloc/mcheck.c (mcheck): Likewise.
|
||||||
|
(mcheck_pedantic): Likewise.
|
||||||
|
* posix/regexec.c (re_search_2_stub): Likewise. Use
|
||||||
|
internal_function.
|
||||||
|
(re_search_internal): Likewise.
|
||||||
|
* resolv/res_init.c [RESOLVSORT] (net_mask): Convert to
|
||||||
|
prototype-style function definition.
|
||||||
|
* sunrpc/clnt_udp.c (clntudp_call): Likewise.
|
||||||
|
* sunrpc/pmap_rmt.c (clnt_broadcast): Likewise.
|
||||||
|
* sunrpc/rpcsvc/rusers.x (xdr_utmp): Likewise.
|
||||||
|
(xdr_utmpptr): Likewise.
|
||||||
|
(xdr_utmparr): Likewise.
|
||||||
|
(xdr_utmpidle): Likewise.
|
||||||
|
(xdr_utmpidleptr): Likewise.
|
||||||
|
(xdr_utmpidlearr): Likewise.
|
||||||
|
|
||||||
* math/auto-libm-test-in: Add more tests of hypot, j0, j1, jn,
|
* math/auto-libm-test-in: Add more tests of hypot, j0, j1, jn,
|
||||||
log, log10 and log2.
|
log, log10 and log2.
|
||||||
* math/auto-libm-test-out: Regenerated.
|
* math/auto-libm-test-out: Regenerated.
|
||||||
|
6
io/fts.c
6
io/fts.c
@ -85,10 +85,8 @@ static int fts_safe_changedir (FTS *, FTSENT *, int, const char *)
|
|||||||
#define BREAD 3 /* fts_read */
|
#define BREAD 3 /* fts_read */
|
||||||
|
|
||||||
FTS *
|
FTS *
|
||||||
fts_open(argv, options, compar)
|
fts_open (char * const *argv, int options,
|
||||||
char * const *argv;
|
int (*compar) (const FTSENT **, const FTSENT **))
|
||||||
int options;
|
|
||||||
int (*compar) (const FTSENT **, const FTSENT **);
|
|
||||||
{
|
{
|
||||||
FTS *sp;
|
FTS *sp;
|
||||||
FTSENT *p, *root;
|
FTSENT *p, *root;
|
||||||
|
@ -369,8 +369,8 @@ mabort (enum mcheck_status status)
|
|||||||
#define malloc_opt_barrier(x) \
|
#define malloc_opt_barrier(x) \
|
||||||
({ __typeof (x) __x = x; __asm ("" : "+m" (__x)); __x; })
|
({ __typeof (x) __x = x; __asm ("" : "+m" (__x)); __x; })
|
||||||
|
|
||||||
int mcheck (func)
|
int
|
||||||
void (*func)(enum mcheck_status);
|
mcheck (void (*func) (enum mcheck_status))
|
||||||
{
|
{
|
||||||
abortfunc = (func != NULL) ? func : &mabort;
|
abortfunc = (func != NULL) ? func : &mabort;
|
||||||
|
|
||||||
@ -400,8 +400,8 @@ void (*func)(enum mcheck_status);
|
|||||||
libc_hidden_def (mcheck)
|
libc_hidden_def (mcheck)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int mcheck_pedantic (func)
|
int
|
||||||
void (*func)(enum mcheck_status);
|
mcheck_pedantic (void (*func) (enum mcheck_status))
|
||||||
{
|
{
|
||||||
int res = mcheck (func);
|
int res = mcheck (func);
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
|
@ -345,12 +345,11 @@ weak_alias (__re_search_2, re_search_2)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
re_search_2_stub (bufp, string1, length1, string2, length2, start, range, regs,
|
internal_function
|
||||||
stop, ret_len)
|
re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1,
|
||||||
struct re_pattern_buffer *bufp;
|
int length1, const char *string2, int length2, int start,
|
||||||
const char *string1, *string2;
|
int range, struct re_registers *regs,
|
||||||
int length1, length2, start, range, stop, ret_len;
|
int stop, int ret_len)
|
||||||
struct re_registers *regs;
|
|
||||||
{
|
{
|
||||||
const char *str;
|
const char *str;
|
||||||
int rval;
|
int rval;
|
||||||
@ -606,14 +605,10 @@ re_exec (const char *s)
|
|||||||
(START + RANGE >= 0 && START + RANGE <= LENGTH) */
|
(START + RANGE >= 0 && START + RANGE <= LENGTH) */
|
||||||
|
|
||||||
static reg_errcode_t
|
static reg_errcode_t
|
||||||
__attribute_warn_unused_result__
|
__attribute_warn_unused_result__ internal_function
|
||||||
re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch,
|
re_search_internal (const regex_t *preg, const char *string, int length,
|
||||||
eflags)
|
int start, int range, int stop, size_t nmatch,
|
||||||
const regex_t *preg;
|
regmatch_t pmatch[], int eflags)
|
||||||
const char *string;
|
|
||||||
int length, start, range, stop, eflags;
|
|
||||||
size_t nmatch;
|
|
||||||
regmatch_t pmatch[];
|
|
||||||
{
|
{
|
||||||
reg_errcode_t err;
|
reg_errcode_t err;
|
||||||
const re_dfa_t *dfa = (const re_dfa_t *) preg->buffer;
|
const re_dfa_t *dfa = (const re_dfa_t *) preg->buffer;
|
||||||
|
@ -554,9 +554,9 @@ res_setoptions(res_state statp, const char *options, const char *source) {
|
|||||||
|
|
||||||
#ifdef RESOLVSORT
|
#ifdef RESOLVSORT
|
||||||
/* XXX - should really support CIDR which means explicit masks always. */
|
/* XXX - should really support CIDR which means explicit masks always. */
|
||||||
|
/* XXX - should really use system's version of this */
|
||||||
static u_int32_t
|
static u_int32_t
|
||||||
net_mask(in) /* XXX - should really use system's version of this */
|
net_mask (struct in_addr in)
|
||||||
struct in_addr in;
|
|
||||||
{
|
{
|
||||||
u_int32_t i = ntohl(in.s_addr);
|
u_int32_t i = ntohl(in.s_addr);
|
||||||
|
|
||||||
|
@ -257,14 +257,20 @@ is_network_up (int sock)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static enum clnt_stat
|
static enum clnt_stat
|
||||||
clntudp_call (cl, proc, xargs, argsp, xresults, resultsp, utimeout)
|
clntudp_call (/* client handle */
|
||||||
CLIENT *cl; /* client handle */
|
CLIENT *cl,
|
||||||
u_long proc; /* procedure number */
|
/* procedure number */
|
||||||
xdrproc_t xargs; /* xdr routine for args */
|
u_long proc,
|
||||||
caddr_t argsp; /* pointer to args */
|
/* xdr routine for args */
|
||||||
xdrproc_t xresults; /* xdr routine for results */
|
xdrproc_t xargs,
|
||||||
caddr_t resultsp; /* pointer to results */
|
/* pointer to args */
|
||||||
struct timeval utimeout; /* seconds to wait before giving up */
|
caddr_t argsp,
|
||||||
|
/* xdr routine for results */
|
||||||
|
xdrproc_t xresults,
|
||||||
|
/* pointer to results */
|
||||||
|
caddr_t resultsp,
|
||||||
|
/* seconds to wait before giving up */
|
||||||
|
struct timeval utimeout)
|
||||||
{
|
{
|
||||||
struct cu_data *cu = (struct cu_data *) cl->cl_private;
|
struct cu_data *cu = (struct cu_data *) cl->cl_private;
|
||||||
XDR *xdrs;
|
XDR *xdrs;
|
||||||
|
@ -196,15 +196,22 @@ getbroadcastnets (struct in_addr *addrs, int naddrs)
|
|||||||
|
|
||||||
|
|
||||||
enum clnt_stat
|
enum clnt_stat
|
||||||
clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
|
clnt_broadcast (/* program number */
|
||||||
u_long prog; /* program number */
|
u_long prog,
|
||||||
u_long vers; /* version number */
|
/* version number */
|
||||||
u_long proc; /* procedure number */
|
u_long vers,
|
||||||
xdrproc_t xargs; /* xdr routine for args */
|
/* procedure number */
|
||||||
caddr_t argsp; /* pointer to args */
|
u_long proc,
|
||||||
xdrproc_t xresults; /* xdr routine for results */
|
/* xdr routine for args */
|
||||||
caddr_t resultsp; /* pointer to results */
|
xdrproc_t xargs,
|
||||||
resultproc_t eachresult; /* call with each result obtained */
|
/* pointer to args */
|
||||||
|
caddr_t argsp,
|
||||||
|
/* xdr routine for results */
|
||||||
|
xdrproc_t xresults,
|
||||||
|
/* pointer to results */
|
||||||
|
caddr_t resultsp,
|
||||||
|
/* call with each result obtained */
|
||||||
|
resultproc_t eachresult)
|
||||||
{
|
{
|
||||||
enum clnt_stat stat = RPC_FAILED;
|
enum clnt_stat stat = RPC_FAILED;
|
||||||
AUTH *unix_auth = authunix_create_default ();
|
AUTH *unix_auth = authunix_create_default ();
|
||||||
|
@ -137,9 +137,7 @@ program RUSERSPROG {
|
|||||||
%bool_t xdr_utmp (XDR *xdrs, struct ru_utmp *objp);
|
%bool_t xdr_utmp (XDR *xdrs, struct ru_utmp *objp);
|
||||||
%
|
%
|
||||||
%bool_t
|
%bool_t
|
||||||
%xdr_utmp(xdrs, objp)
|
%xdr_utmp (XDR *xdrs, struct ru_utmp *objp)
|
||||||
% XDR *xdrs;
|
|
||||||
% struct ru_utmp *objp;
|
|
||||||
%{
|
%{
|
||||||
% /* Since the fields are char foo [xxx], we should not free them. */
|
% /* Since the fields are char foo [xxx], we should not free them. */
|
||||||
% if (xdrs->x_op != XDR_FREE)
|
% if (xdrs->x_op != XDR_FREE)
|
||||||
@ -171,9 +169,7 @@ program RUSERSPROG {
|
|||||||
%bool_t xdr_utmpptr(XDR *xdrs, struct ru_utmp **objpp);
|
%bool_t xdr_utmpptr(XDR *xdrs, struct ru_utmp **objpp);
|
||||||
%
|
%
|
||||||
%bool_t
|
%bool_t
|
||||||
%xdr_utmpptr(xdrs, objpp)
|
%xdr_utmpptr (XDR *xdrs, struct ru_utmp **objpp)
|
||||||
% XDR *xdrs;
|
|
||||||
% struct ru_utmp **objpp;
|
|
||||||
%{
|
%{
|
||||||
% if (!xdr_reference(xdrs, (char **) objpp, sizeof (struct ru_utmp),
|
% if (!xdr_reference(xdrs, (char **) objpp, sizeof (struct ru_utmp),
|
||||||
% (xdrproc_t) xdr_utmp)) {
|
% (xdrproc_t) xdr_utmp)) {
|
||||||
@ -183,9 +179,7 @@ program RUSERSPROG {
|
|||||||
%}
|
%}
|
||||||
%
|
%
|
||||||
%bool_t
|
%bool_t
|
||||||
%xdr_utmparr(xdrs, objp)
|
%xdr_utmparr (XDR *xdrs, struct utmparr *objp)
|
||||||
% XDR *xdrs;
|
|
||||||
% struct utmparr *objp;
|
|
||||||
%{
|
%{
|
||||||
% if (!xdr_array(xdrs, (char **)&objp->uta_arr, (u_int *)&objp->uta_cnt,
|
% if (!xdr_array(xdrs, (char **)&objp->uta_arr, (u_int *)&objp->uta_cnt,
|
||||||
% MAXUSERS, sizeof(struct ru_utmp *),
|
% MAXUSERS, sizeof(struct ru_utmp *),
|
||||||
@ -198,9 +192,7 @@ program RUSERSPROG {
|
|||||||
%bool_t xdr_utmpidle(XDR *xdrs, struct utmpidle *objp);
|
%bool_t xdr_utmpidle(XDR *xdrs, struct utmpidle *objp);
|
||||||
%
|
%
|
||||||
%bool_t
|
%bool_t
|
||||||
%xdr_utmpidle(xdrs, objp)
|
%xdr_utmpidle (XDR *xdrs, struct utmpidle *objp)
|
||||||
% XDR *xdrs;
|
|
||||||
% struct utmpidle *objp;
|
|
||||||
%{
|
%{
|
||||||
% if (!xdr_utmp(xdrs, &objp->ui_utmp)) {
|
% if (!xdr_utmp(xdrs, &objp->ui_utmp)) {
|
||||||
% return (FALSE);
|
% return (FALSE);
|
||||||
@ -214,9 +206,7 @@ program RUSERSPROG {
|
|||||||
%bool_t xdr_utmpidleptr(XDR *xdrs, struct utmpidle **objp);
|
%bool_t xdr_utmpidleptr(XDR *xdrs, struct utmpidle **objp);
|
||||||
%
|
%
|
||||||
%bool_t
|
%bool_t
|
||||||
%xdr_utmpidleptr(xdrs, objpp)
|
%xdr_utmpidleptr (XDR *xdrs, struct utmpidle **objpp)
|
||||||
% XDR *xdrs;
|
|
||||||
% struct utmpidle **objpp;
|
|
||||||
%{
|
%{
|
||||||
% if (!xdr_reference(xdrs, (char **) objpp, sizeof (struct utmpidle),
|
% if (!xdr_reference(xdrs, (char **) objpp, sizeof (struct utmpidle),
|
||||||
% (xdrproc_t) xdr_utmpidle)) {
|
% (xdrproc_t) xdr_utmpidle)) {
|
||||||
@ -226,9 +216,7 @@ program RUSERSPROG {
|
|||||||
%}
|
%}
|
||||||
%
|
%
|
||||||
%bool_t
|
%bool_t
|
||||||
%xdr_utmpidlearr(xdrs, objp)
|
%xdr_utmpidlearr (XDR *xdrs, struct utmpidlearr *objp)
|
||||||
% XDR *xdrs;
|
|
||||||
% struct utmpidlearr *objp;
|
|
||||||
%{
|
%{
|
||||||
% if (!xdr_array(xdrs, (char **)&objp->uia_arr, (u_int *)&objp->uia_cnt,
|
% if (!xdr_array(xdrs, (char **)&objp->uia_arr, (u_int *)&objp->uia_cnt,
|
||||||
% MAXUSERS, sizeof(struct utmpidle *),
|
% MAXUSERS, sizeof(struct utmpidle *),
|
||||||
|
Loading…
Reference in New Issue
Block a user