diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2006-01-15 22:41:03 +0000 |
---|---|---|
committer | Peter S. Mazinger <ps.m@gmx.net> | 2006-01-15 22:41:03 +0000 |
commit | 0d212a2b26a764bba1c8220ee84547247bd78ad8 (patch) | |
tree | e34fb551f34f3500c5fafc5234bb95e0b7722d6c /libc | |
parent | c50ee9bde4fa794cd2bb962dd1f3f44d0fbf8274 (diff) |
make gcc4 happy w/ hidden_def/proto, correct some typos
Diffstat (limited to 'libc')
57 files changed, 132 insertions, 125 deletions
diff --git a/libc/inet/rpc/authunix_prot.c b/libc/inet/rpc/authunix_prot.c index ad26f2c1e..c2f706cd6 100644 --- a/libc/inet/rpc/authunix_prot.c +++ b/libc/inet/rpc/authunix_prot.c @@ -40,7 +40,6 @@ #include <rpc/auth_unix.h> libc_hidden_proto(xdr_string) -libc_hidden_def(xdr_string) libc_hidden_proto(xdr_u_int) libc_hidden_proto(xdr_array) libc_hidden_proto(xdr_u_long) diff --git a/libc/inet/socketcalls.c b/libc/inet/socketcalls.c index 880eab3d8..4b22120d0 100644 --- a/libc/inet/socketcalls.c +++ b/libc/inet/socketcalls.c @@ -49,8 +49,8 @@ int __libc_accept(int s, struct sockaddr *addr, socklen_t * addrlen) return __socketcall(SYS_ACCEPT, args); } #endif -strong_alias(__libc_accept,accept) libc_hidden_proto(accept) +strong_alias(__libc_accept,accept) libc_hidden_def(accept) #endif @@ -87,8 +87,8 @@ int __libc_connect(int sockfd, const struct sockaddr *saddr, socklen_t addrlen) return __socketcall(SYS_CONNECT, args); } #endif -strong_alias(__libc_connect,connect) libc_hidden_proto(connect) +strong_alias(__libc_connect,connect) libc_hidden_def(connect) #endif @@ -185,8 +185,8 @@ ssize_t __libc_recv(int sockfd, __ptr_t buffer, size_t len, int flags) return (recvfrom(sockfd, buffer, len, flags, NULL, NULL)); } #endif -strong_alias(__libc_recv,recv) libc_hidden_proto(recv) +strong_alias(__libc_recv,recv) libc_hidden_def(recv) #endif @@ -211,8 +211,8 @@ ssize_t __libc_recvfrom(int sockfd, __ptr_t buffer, size_t len, int flags, return (__socketcall(SYS_RECVFROM, args)); } #endif -strong_alias(__libc_recvfrom,recvfrom) libc_hidden_proto(recvfrom) +strong_alias(__libc_recvfrom,recvfrom) libc_hidden_def(recvfrom) #endif @@ -231,8 +231,8 @@ ssize_t __libc_recvmsg(int sockfd, struct msghdr *msg, int flags) return (__socketcall(SYS_RECVMSG, args)); } #endif -strong_alias(__libc_recvmsg,recvmsg) libc_hidden_proto(recvmsg) +strong_alias(__libc_recvmsg,recvmsg) libc_hidden_def(recvmsg) #endif @@ -259,8 +259,8 @@ ssize_t __libc_send(int sockfd, const void *buffer, size_t len, int flags) return (sendto(sockfd, buffer, len, flags, NULL, 0)); } #endif -strong_alias(__libc_send,send) libc_hidden_proto(send) +strong_alias(__libc_send,send) libc_hidden_def(send) #endif @@ -279,8 +279,8 @@ ssize_t __libc_sendmsg(int sockfd, const struct msghdr *msg, int flags) return (__socketcall(SYS_SENDMSG, args)); } #endif -strong_alias(__libc_sendmsg,sendmsg) libc_hidden_proto(sendmsg) +strong_alias(__libc_sendmsg,sendmsg) libc_hidden_def(sendmsg) #endif @@ -305,8 +305,8 @@ ssize_t __libc_sendto(int sockfd, const void *buffer, size_t len, int flags, return (__socketcall(SYS_SENDTO, args)); } #endif -strong_alias(__libc_sendto,sendto) libc_hidden_proto(sendto) +strong_alias(__libc_sendto,sendto) libc_hidden_def(sendto) #endif diff --git a/libc/misc/fnmatch/fnmatch.c b/libc/misc/fnmatch/fnmatch.c index dc18c2f59..ac7dbcf2b 100644 --- a/libc/misc/fnmatch/fnmatch.c +++ b/libc/misc/fnmatch/fnmatch.c @@ -475,7 +475,6 @@ compat_symbol (libc, __fnmatch_old, fnmatch, GLIBC_2_0); libc_hidden_ver (__fnmatch, fnmatch) # endif # else -libc_hidden_proto(fnmatch) libc_hidden_def(fnmatch) # endif diff --git a/libc/misc/glob/glob.c b/libc/misc/glob/glob.c index cbc232076..8cb9a3ae5 100644 --- a/libc/misc/glob/glob.c +++ b/libc/misc/glob/glob.c @@ -15,6 +15,7 @@ License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define _GNU_SOURCE #include <features.h> #include <stdlib.h> #include <string.h> @@ -25,7 +26,6 @@ Cambridge, MA 02139, USA. */ #include <dirent.h> #include <malloc.h> #include <fnmatch.h> -#define _GNU_SOURCE #include <glob.h> libc_hidden_proto(memcpy) @@ -40,6 +40,7 @@ libc_hidden_proto(fnmatch) libc_hidden_proto(qsort) libc_hidden_proto(lstat) + extern __ptr_t (*__glob_opendir_hook) __P ((const char *directory)) attribute_hidden; extern void (*__glob_closedir_hook) __P ((__ptr_t stream)) attribute_hidden; extern const char *(*__glob_readdir_hook) __P ((__ptr_t stream)) attribute_hidden; @@ -53,20 +54,20 @@ static int prefix_array __P ((const char *prefix, char **array, size_t n, int add_slash)); static int collated_compare __P ((const __ptr_t, const __ptr_t)); +libc_hidden_proto(glob_pattern_p) #ifdef __GLOB64 -extern int __glob_pattern_p(const char *pattern, int quote) attribute_hidden; +libc_hidden_proto(glob64) +libc_hidden_proto(globfree64) libc_hidden_proto(readdir64) #define __readdir readdir64 #else -extern int __glob (__const char *__restrict __pattern, int __flags, - int (*__errfunc) (__const char *, int), - glob_t *__restrict __pglob) __THROW attribute_hidden; -extern void __globfree (glob_t *__pglob) __THROW attribute_hidden; +libc_hidden_proto(glob) +libc_hidden_proto(globfree) #define __readdir readdir libc_hidden_proto(readdir) /* Return nonzero if PATTERN contains any metacharacters. Metacharacters can be quoted with backslashes if QUOTE is nonzero. */ -int attribute_hidden __glob_pattern_p(const char *pattern, int quote) +int glob_pattern_p(const char *pattern, int quote) { const char *p; int open = 0; @@ -95,7 +96,7 @@ int attribute_hidden __glob_pattern_p(const char *pattern, int quote) return 0; } -strong_alias(__glob_pattern_p,glob_pattern_p) +libc_hidden_def(glob_pattern_p) #endif @@ -107,8 +108,8 @@ strong_alias(__glob_pattern_p,glob_pattern_p) `glob' returns GLOB_ABEND; if it returns zero, the error is ignored. If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned. Otherwise, `glob' returns zero. */ -int attribute_hidden -__glob (pattern, flags, errfunc, pglob) +int +glob (pattern, flags, errfunc, pglob) const char *pattern; int flags; int (*errfunc) __P ((const char *, int)); @@ -153,7 +154,7 @@ __glob (pattern, flags, errfunc, pglob) if (filename[0] == '\0' && dirlen > 1) /* "pattern/". Expand "pattern", appending slashes. */ { - int val = __glob (dirname, flags | GLOB_MARK, errfunc, pglob); + int val = glob (dirname, flags | GLOB_MARK, errfunc, pglob); if (val == 0) pglob->gl_flags = (pglob->gl_flags & ~GLOB_MARK) | (flags & GLOB_MARK); return val; @@ -167,7 +168,7 @@ __glob (pattern, flags, errfunc, pglob) oldcount = pglob->gl_pathc; - if (__glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE))) + if (glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE))) { /* The directory name contains metacharacters, so we have to glob for the directory, and then glob for @@ -175,7 +176,7 @@ __glob (pattern, flags, errfunc, pglob) glob_t dirs; register int i; - status = __glob (dirname, + status = glob (dirname, ((flags & (GLOB_ERR | GLOB_NOCHECK | GLOB_NOESCAPE)) | GLOB_NOSORT), errfunc, &dirs); @@ -196,8 +197,8 @@ __glob (pattern, flags, errfunc, pglob) if (interrupt_state) { - __globfree (&dirs); - __globfree (&files); + globfree (&dirs); + globfree (&files); return GLOB_ABEND; } } @@ -213,8 +214,8 @@ __glob (pattern, flags, errfunc, pglob) if (status != 0) { - __globfree (&dirs); - __globfree (pglob); + globfree (&dirs); + globfree (pglob); return status; } @@ -224,8 +225,8 @@ __glob (pattern, flags, errfunc, pglob) pglob->gl_pathc - oldcount, flags & GLOB_MARK)) { - __globfree (&dirs); - __globfree (pglob); + globfree (&dirs); + globfree (pglob); return GLOB_NOSPACE; } } @@ -284,7 +285,7 @@ __glob (pattern, flags, errfunc, pglob) pglob->gl_pathc - oldcount, flags & GLOB_MARK)) { - __globfree (pglob); + globfree (pglob); return GLOB_NOSPACE; } } @@ -311,15 +312,15 @@ __glob (pattern, flags, errfunc, pglob) return 0; } #ifdef __GLOB64 -strong_alias(__glob64,glob64) +libc_hidden_def(glob64) #else -strong_alias(__glob,glob) +libc_hidden_def(glob) #endif /* Free storage allocated in PGLOB by a previous `glob' call. */ -void attribute_hidden -__globfree (pglob) +void +globfree (pglob) register glob_t *pglob; { if (pglob->gl_pathv != NULL) @@ -332,9 +333,9 @@ __globfree (pglob) } } #ifdef __GLOB64 -strong_alias(__globfree64,globfree64) +libc_hidden_def(globfree64) #else -strong_alias(__globfree,globfree) +libc_hidden_def(globfree) #endif @@ -432,7 +433,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) return GLOB_ABORTED; } - meta = __glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE)); + meta = glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE)); if (meta) flags |= GLOB_MAGCHAR; diff --git a/libc/misc/glob/glob64.c b/libc/misc/glob/glob64.c index 5baf86810..8c19e81bb 100644 --- a/libc/misc/glob/glob64.c +++ b/libc/misc/glob/glob64.c @@ -1,3 +1,10 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#define _GNU_SOURCE #include <features.h> #ifdef __UCLIBC_HAS_LFS__ @@ -18,20 +25,11 @@ #include <glob.h> #include <sys/stat.h> - -extern int __glob64 (__const char *__restrict __pattern, int __flags, - int (*__errfunc) (__const char *, int), - glob64_t *__restrict __pglob) __THROW attribute_hidden; -extern void __globfree (glob_t *__pglob) __THROW attribute_hidden; -extern void __globfree64 (glob64_t *__pglob) __THROW attribute_hidden; #define dirent dirent64 #define glob_t glob64_t -#define __glob(pattern, flags, errfunc, pglob) \ - __glob64 (pattern, flags, errfunc, pglob) #define glob(pattern, flags, errfunc, pglob) \ glob64 (pattern, flags, errfunc, pglob) -#define __globfree(pglob) __globfree64 (pglob) #define globfree(pglob) globfree64 (pglob) #undef stat diff --git a/libc/misc/ttyent/getttyent.c b/libc/misc/ttyent/getttyent.c index 9754e9b49..c11811769 100644 --- a/libc/misc/ttyent/getttyent.c +++ b/libc/misc/ttyent/getttyent.c @@ -98,7 +98,8 @@ static char * value(register char *p) return ((p = strchr(p, '=')) ? ++p : NULL); } -int attribute_hidden __setttyent(void) +libc_hidden_proto(setttyent) +int setttyent(void) { if (tf) { @@ -113,15 +114,16 @@ int attribute_hidden __setttyent(void) } return (0); } -strong_alias(__setttyent,setttyent) +libc_hidden_def(setttyent) -struct ttyent attribute_hidden * __getttyent(void) +libc_hidden_proto(getttyent) +struct ttyent * getttyent(void) { register int c; register char *p; static char *line = NULL; - if (!tf && !__setttyent()) + if (!tf && !setttyent()) return (NULL); if (!line) { @@ -191,9 +193,10 @@ struct ttyent attribute_hidden * __getttyent(void) *p = '\0'; return (&tty); } -strong_alias(__getttyent,getttyent) +libc_hidden_def(getttyent) -int attribute_hidden __endttyent(void) +libc_hidden_proto(endttyent) +int endttyent(void) { int rval; @@ -204,16 +207,16 @@ int attribute_hidden __endttyent(void) } return (1); } -strong_alias(__endttyent,endttyent) +libc_hidden_def(endttyent) struct ttyent * getttynam(const char *tty) { register struct ttyent *t; - __setttyent(); - while ((t = __getttyent())) + setttyent(); + while ((t = getttyent())) if (!strcmp(tty, t->ty_name)) break; - __endttyent(); + endttyent(); return (t); } diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c index c1932d7d7..b865cc271 100644 --- a/libc/misc/utmp/utent.c +++ b/libc/misc/utmp/utent.c @@ -112,7 +112,8 @@ struct utmp *getutent(void) } /* Locking is done in __getutent */ -struct utmp attribute_hidden *__getutid (const struct utmp *utmp_entry) +libc_hidden_proto(getutid) +struct utmp *getutid (const struct utmp *utmp_entry) { struct utmp *lutmp; @@ -137,7 +138,7 @@ struct utmp attribute_hidden *__getutid (const struct utmp *utmp_entry) return NULL; } -strong_alias(__getutid,getutid) +libc_hidden_def(getutid) /* Locking is done in __getutent */ struct utmp *getutline(const struct utmp *utmp_entry) @@ -162,7 +163,7 @@ struct utmp *pututline (const struct utmp *utmp_entry) the file pointer where they want it, everything will work out. */ lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR); - if (__getutid(utmp_entry) != NULL) { + if (getutid(utmp_entry) != NULL) { lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR); if (write(static_fd, utmp_entry, sizeof(struct utmp)) != sizeof(struct utmp)) return NULL; diff --git a/libc/misc/wchar/wstdio.c b/libc/misc/wchar/wstdio.c index 69287f871..00311a41d 100644 --- a/libc/misc/wchar/wstdio.c +++ b/libc/misc/wchar/wstdio.c @@ -56,6 +56,9 @@ #include <errno.h> #include <assert.h> +libc_hidden_proto(fgetwc_unlocked) +libc_hidden_proto(fputwc_unlocked) + #ifndef __UCLIBC_HAS_THREADS__ #ifdef __BCC__ @@ -259,7 +262,6 @@ UNLOCKED(wint_t,fgetwc,(register FILE *stream),(stream)) return wi; } -libc_hidden_proto(fgetwc_unlocked) libc_hidden_def(fgetwc_unlocked) strong_alias(fgetwc_unlocked,getwc_unlocked) @@ -269,8 +271,6 @@ strong_alias(fgetwc,getwc) /**********************************************************************/ #ifdef L_getwchar -libc_hidden_proto(fgetwc_unlocked) - UNLOCKED_STREAM(wint_t,getwchar,(void),(),stdin) { register FILE *stream = stdin; /* This helps bcc optimize. */ @@ -282,8 +282,6 @@ UNLOCKED_STREAM(wint_t,getwchar,(void),(),stdin) /**********************************************************************/ #ifdef L_fgetws -libc_hidden_proto(fgetwc_unlocked) - UNLOCKED(wchar_t *,fgetws,(wchar_t *__restrict ws, int n, FILE *__restrict stream),(ws, n, stream)) { @@ -333,7 +331,6 @@ UNLOCKED(wint_t,fputwc,(wchar_t wc, FILE *stream),(wc, stream)) ? wc : WEOF; #endif } -libc_hidden_proto(fputwc_unlocked) libc_hidden_def(fputwc_unlocked) strong_alias(fputwc_unlocked,putwc_unlocked) @@ -343,8 +340,6 @@ strong_alias(fputwc,putwc) /**********************************************************************/ #ifdef L_putwchar -libc_hidden_proto(fputwc_unlocked) - UNLOCKED_STREAM(wint_t,putwchar,(wchar_t wc),(wc),stdout) { register FILE *stream = stdout; /* This helps bcc optimize. */ diff --git a/libc/signal/sigaction.c b/libc/signal/sigaction.c index f0569b392..0d941be33 100644 --- a/libc/signal/sigaction.c +++ b/libc/signal/sigaction.c @@ -104,7 +104,7 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact) #endif #ifndef LIBC_SIGACTION -strong_alias(__libc_sigaction,sigaction) libc_hidden_proto(sigaction) +strong_alias(__libc_sigaction,sigaction) libc_hidden_def(sigaction) #endif diff --git a/libc/signal/signal.c b/libc/signal/signal.c index 87bd7ab84..6a0beb9f7 100644 --- a/libc/signal/signal.c +++ b/libc/signal/signal.c @@ -51,6 +51,6 @@ __bsd_signal (int sig, __sighandler_t handler) return oact.sa_handler; } strong_alias(__bsd_signal,bsd_signal) -strong_alias(__bsd_signal,signal) libc_hidden_proto(signal) +strong_alias(__bsd_signal,signal) libc_hidden_def(signal) diff --git a/libc/stdio/fflush.c b/libc/stdio/fflush.c index a03c311e0..c0f58d8af 100644 --- a/libc/stdio/fflush.c +++ b/libc/stdio/fflush.c @@ -130,8 +130,8 @@ int fflush_unlocked(register FILE *stream) libc_hidden_def(fflush_unlocked) #ifndef __UCLIBC_HAS_THREADS__ -strong_alias(fflush_unlocked,fflush) libc_hidden_proto(fflush) +strong_alias(fflush_unlocked,fflush) libc_hidden_def(fflush) #endif diff --git a/libc/stdio/fgetc.c b/libc/stdio/fgetc.c index eb8c58254..7eb2b6ea2 100644 --- a/libc/stdio/fgetc.c +++ b/libc/stdio/fgetc.c @@ -75,21 +75,23 @@ int __fgetc_unlocked(FILE *stream) } libc_hidden_def(__fgetc_unlocked) -strong_alias(__fgetc_unlocked,fgetc_unlocked) libc_hidden_proto(fgetc_unlocked) +strong_alias(__fgetc_unlocked,fgetc_unlocked) libc_hidden_def(fgetc_unlocked) -//strong_alias(__fgetc_unlocked,__getc_unlocked) //libc_hidden_proto(__getc_unlocked) +//strong_alias(__fgetc_unlocked,__getc_unlocked) //libc_hidden_def(__getc_unlocked) -strong_alias(__fgetc_unlocked,getc_unlocked) + libc_hidden_proto(getc_unlocked) +strong_alias(__fgetc_unlocked,getc_unlocked) libc_hidden_def(getc_unlocked) #ifndef __UCLIBC_HAS_THREADS__ -strong_alias(__fgetc_unlocked,fgetc) libc_hidden_proto(fgetc) +strong_alias(__fgetc_unlocked,fgetc) libc_hidden_def(fgetc) + strong_alias(__fgetc_unlocked,getc) #endif diff --git a/libc/stdio/fgets.c b/libc/stdio/fgets.c index ae2ecdc8d..5acaf91ed 100644 --- a/libc/stdio/fgets.c +++ b/libc/stdio/fgets.c @@ -64,8 +64,8 @@ char *fgets_unlocked(char *__restrict s, int n, libc_hidden_def(fgets_unlocked) #ifndef __UCLIBC_HAS_THREADS__ -strong_alias(fgets_unlocked,fgets) libc_hidden_proto(fgets) +strong_alias(fgets_unlocked,fgets) libc_hidden_def(fgets) #endif diff --git a/libc/stdio/fgetwc.c b/libc/stdio/fgetwc.c index 716a8e9c0..062d825d6 100644 --- a/libc/stdio/fgetwc.c +++ b/libc/stdio/fgetwc.c @@ -113,9 +113,10 @@ libc_hidden_def(fgetwc_unlocked) strong_alias(fgetwc_unlocked,getwc_unlocked) #ifndef __UCLIBC_HAS_THREADS__ -strong_alias(fgetwc_unlocked,fgetwc) libc_hidden_proto(fgetwc) +strong_alias(fgetwc_unlocked,fgetwc) libc_hidden_def(fgetwc) + strong_alias(fgetwc_unlocked,getwc) #endif @@ -136,6 +137,6 @@ wint_t fgetwc(register FILE *stream) return retval; } libc_hidden_def(fgetwc) -strong_alias(fgetwc,getwc) +strong_alias(fgetwc,getwc) #endif diff --git a/libc/stdio/fileno.c b/libc/stdio/fileno.c index deeff71b1..929936bfd 100644 --- a/libc/stdio/fileno.c +++ b/libc/stdio/fileno.c @@ -25,8 +25,8 @@ int fileno_unlocked(register FILE *stream) libc_hidden_def(fileno_unlocked) #ifndef __UCLIBC_HAS_THREADS__ -strong_alias(fileno_unlocked,fileno) libc_hidden_proto(fileno) +strong_alias(fileno_unlocked,fileno) libc_hidden_def(fileno) #endif diff --git a/libc/stdio/fputc.c b/libc/stdio/fputc.c index bbc72ab86..8c80bff27 100644 --- a/libc/stdio/fputc.c +++ b/libc/stdio/fputc.c @@ -74,14 +74,14 @@ libc_hidden_def(__fputc_unlocked) strong_alias(__fputc_unlocked,fputc_unlocked) -strong_alias(__fputc_unlocked,putc_unlocked) libc_hidden_proto(putc_unlocked) +strong_alias(__fputc_unlocked,putc_unlocked) libc_hidden_def(putc_unlocked) #ifndef __UCLIBC_HAS_THREADS__ strong_alias(__fputc_unlocked,fputc) -strong_alias(__fputc_unlocked,putc) libc_hidden_proto(putc) +strong_alias(__fputc_unlocked,putc) libc_hidden_def(putc) #endif |