From 290e19f8147d9b3c0166d3520e718ae5603e4cef Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 18 Nov 2012 06:17:03 -0500 Subject: drop support for pre ISO-C compilers This drops __signed, __volatile, and __const. Only the latter was used in the code base, and for uClibc, not consistently. Much of the code used plain "const" which meant "__const" was useless. Really, the point of this is to stay in sync with what glibc did. Signed-off-by: Mike Frysinger --- include/arpa/inet.h | 18 +-- include/assert.h | 2 +- include/crypt.h | 4 +- include/dirent.h | 50 +++---- include/dlfcn.h | 18 +-- include/err.h | 16 +-- include/execinfo.h | 4 +- include/fcntl.h | 18 +-- include/fenv.h | 6 +- include/fnmatch.h | 10 +- include/ftw.h | 28 ++-- include/glob.h | 34 ++--- include/grp.h | 12 +- include/iconv.h | 2 +- include/inttypes.h | 40 +++--- include/libintl.h | 34 ++--- include/locale.h | 4 +- include/mntent.h | 8 +- include/net/if.h | 2 +- include/netdb.h | 84 +++++------ include/netinet/ether.h | 14 +- include/netinet/in.h | 76 +++++----- include/nl_types.h | 4 +- include/printf.h | 14 +- include/pwd.h | 6 +- include/regexp.h | 10 +- include/rpc/auth.h | 8 +- include/rpc/auth_des.h | 8 +- include/rpc/clnt.h | 24 ++-- include/rpc/netdb.h | 4 +- include/rpc/pmap_clnt.h | 20 +-- include/rpc/xdr.h | 12 +- include/sched.h | 6 +- include/search.h | 16 +-- include/sgtty.h | 2 +- include/shadow.h | 10 +- include/signal.h | 42 +++--- include/stdio.h | 108 +++++++------- include/stdlib.h | 76 +++++----- include/string.h | 106 +++++++------- include/strings.h | 16 +-- include/sys/cdefs.h | 4 - include/sys/ipc.h | 2 +- include/sys/mman.h | 12 +- include/sys/mount.h | 10 +- include/sys/msg.h | 2 +- include/sys/poll.h | 4 +- include/sys/resource.h | 6 +- include/sys/sem.h | 2 +- include/sys/shm.h | 4 +- include/sys/socket.h | 12 +- include/sys/stat.h | 42 +++--- include/sys/statfs.h | 6 +- include/sys/statvfs.h | 6 +- include/sys/swap.h | 4 +- include/sys/syslog.h | 6 +- include/sys/time.h | 18 +-- include/sys/uio.h | 4 +- include/sys/wait.h | 2 +- include/sys/xattr.h | 26 ++-- include/termios.h | 6 +- include/time.h | 50 +++---- include/ttyent.h | 2 +- include/unistd.h | 88 ++++++------ include/utime.h | 4 +- include/utmp.h | 22 +-- include/utmpx.h | 16 +-- include/wchar.h | 158 ++++++++++----------- include/wctype.h | 10 +- include/wordexp.h | 2 +- ldso/include/dlfcn.h | 4 +- libc/misc/search/_tsearch.c | 12 +- libc/stdio/_scanf.c | 6 +- libc/stdlib/stdlib.c | 2 +- libc/sysdeps/linux/alpha/bits/fenv.h | 6 +- libc/sysdeps/linux/alpha/sys/acct.h | 2 +- libc/sysdeps/linux/bfin/sys/cachectl.h | 2 +- libc/sysdeps/linux/common/bits/fenv.h | 2 +- libc/sysdeps/linux/common/bits/mathcalls.h | 2 +- libc/sysdeps/linux/common/bits/sigset.h | 4 +- libc/sysdeps/linux/common/bits/sigthread.h | 2 +- libc/sysdeps/linux/common/bits/uClibc_pthread.h | 2 +- libc/sysdeps/linux/common/bits/uClibc_stdio.h | 2 +- libc/sysdeps/linux/common/epoll.c | 6 +- libc/sysdeps/linux/common/futimens.c | 8 +- libc/sysdeps/linux/common/sys/acct.h | 2 +- libc/sysdeps/linux/i386/bits/fenv.h | 4 +- libc/sysdeps/linux/ia64/bits/fenv.h | 6 +- libc/sysdeps/linux/m68k/bits/fenv.h | 4 +- libc/sysdeps/linux/mips/bits/fenv.h | 4 +- libc/sysdeps/linux/mips/sys/cachectl.h | 8 +- libc/sysdeps/linux/mips/sys/sysmips.h | 4 +- libc/sysdeps/linux/powerpc/fenv.h | 6 +- libc/sysdeps/linux/sparc/bits/fenv.h | 4 +- libc/sysdeps/linux/x86_64/bits/fenv.h | 4 +- libc/unistd/exec.c | 2 +- libpthread/linuxthreads.old/internals.h | 6 +- libpthread/linuxthreads.old/semaphore.h | 6 +- .../sysdeps/pthread/bits/libc-lock.h | 6 +- .../linuxthreads.old/sysdeps/pthread/pthread.h | 54 +++---- libpthread/linuxthreads/internals.h | 8 +- libpthread/linuxthreads/semaphore.h | 6 +- .../linuxthreads/sysdeps/pthread/bits/libc-lock.h | 6 +- libpthread/linuxthreads/sysdeps/pthread/pthread.h | 54 +++---- libpthread/nptl/pthreadP.h | 12 +- libpthread/nptl/semaphore.h | 6 +- libpthread/nptl/sysdeps/pthread/bits/libc-lock.h | 6 +- libpthread/nptl/sysdeps/pthread/pthread.h | 74 +++++----- 108 files changed, 924 insertions(+), 936 deletions(-) diff --git a/include/arpa/inet.h b/include/arpa/inet.h index 96c9af96f..4a90cf2cf 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -31,7 +31,7 @@ __BEGIN_DECLS /* Convert Internet host address from numbers-and-dots notation in CP into binary data in network byte order. */ -extern in_addr_t inet_addr (__const char *__cp) __THROW; +extern in_addr_t inet_addr (const char *__cp) __THROW; libc_hidden_proto(inet_addr) /* Return the local host address part of the Internet address in IN. */ @@ -49,7 +49,7 @@ libc_hidden_proto(inet_netof) /* Extract the network number in network byte order from the address in numbers-and-dots natation starting at CP. */ -extern in_addr_t inet_network (__const char *__cp) __THROW; +extern in_addr_t inet_network (const char *__cp) __THROW; libc_hidden_proto(inet_network) /* Convert Internet number in IN to ASCII representation. The return value @@ -64,14 +64,14 @@ extern char *inet_ntoa_r (struct in_addr __in, char *__buf) __THROW; /* Convert from presentation format of an Internet number in buffer starting at CP to the binary network format and store result for interface type AF in buffer starting at BUF. */ -extern int inet_pton (int __af, __const char *__restrict __cp, +extern int inet_pton (int __af, const char *__restrict __cp, void *__restrict __buf) __THROW; libc_hidden_proto(inet_pton) /* Convert a Internet address in binary network format for interface type AF in buffer starting at CP to presentation form and place result in buffer of length LEN astarting at BUF. */ -extern __const char *inet_ntop (int __af, __const void *__restrict __cp, +extern const char *inet_ntop (int __af, const void *__restrict __cp, char *__restrict __buf, socklen_t __len) __THROW; libc_hidden_proto(inet_ntop) @@ -81,7 +81,7 @@ libc_hidden_proto(inet_ntop) #ifdef __USE_MISC /* Convert Internet host address from numbers-and-dots notation in CP into binary data and store the result in the structure INP. */ -extern int inet_aton (__const char *__cp, struct in_addr *__inp) __THROW; +extern int inet_aton (const char *__cp, struct in_addr *__inp) __THROW; libc_hidden_proto(inet_aton) #if 0 @@ -92,24 +92,24 @@ extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW; /* Convert network number for interface type AF in buffer starting at CP to presentation format. The result will specifiy BITS bits of the number. */ -extern char *inet_net_ntop (int __af, __const void *__cp, int __bits, +extern char *inet_net_ntop (int __af, const void *__cp, int __bits, char *__buf, size_t __len) __THROW; /* Convert network number for interface type AF from presentation in buffer starting at CP to network format and store result int buffer starting at BUF of size LEN. */ -extern int inet_net_pton (int __af, __const char *__cp, +extern int inet_net_pton (int __af, const char *__cp, void *__buf, size_t __len) __THROW; /* Convert ASCII representation in hexadecimal form of the Internet address to binary form and place result in buffer of length LEN starting at BUF. */ -extern unsigned int inet_nsap_addr (__const char *__cp, +extern unsigned int inet_nsap_addr (const char *__cp, unsigned char *__buf, int __len) __THROW; /* Convert internet address in binary form in LEN bytes starting at CP a presentation form and place result in BUF. */ -extern char *inet_nsap_ntoa (int __len, __const unsigned char *__cp, +extern char *inet_nsap_ntoa (int __len, const unsigned char *__cp, char *__buf) __THROW; #endif #endif diff --git a/include/assert.h b/include/assert.h index 65159688f..ee8e85fa2 100644 --- a/include/assert.h +++ b/include/assert.h @@ -71,7 +71,7 @@ __END_DECLS # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __ASSERT_FUNCTION __func__ # else -# define __ASSERT_FUNCTION ((__const char *) 0) +# define __ASSERT_FUNCTION ((const char *) 0) # endif # endif diff --git a/include/crypt.h b/include/crypt.h index 563f9b0fc..825e7eb57 100644 --- a/include/crypt.h +++ b/include/crypt.h @@ -25,11 +25,11 @@ __BEGIN_DECLS /* Encrypt characters from KEY using salt to perturb the encryption method. * If salt begins with "$1$", MD5 hashing is used instead of DES. */ -extern char *crypt (__const char *__key, __const char *__salt) +extern char *crypt (const char *__key, const char *__salt) __THROW __nonnull ((1, 2)); /* Setup DES tables according KEY. */ -extern void setkey (__const char *__key) __THROW __nonnull ((1)); +extern void setkey (const char *__key) __THROW __nonnull ((1)); /* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt block in place. */ diff --git a/include/dirent.h b/include/dirent.h index ff59b6b0a..00aa0773e 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -131,7 +131,7 @@ typedef struct __dirstream DIR; This function is a possible cancellation point and therefore not marked with __THROW. */ -extern DIR *opendir (__const char *__name) __nonnull ((1)); +extern DIR *opendir (const char *__name) __nonnull ((1)); libc_hidden_proto(opendir) #ifdef __USE_XOPEN2K8 @@ -255,20 +255,20 @@ libc_hidden_proto(dirfd) sorted using qsort with CMP, and collected in a malloc'd array in *NAMELIST. Returns the number of entries selected, or -1 on error. */ # ifndef __USE_FILE_OFFSET64 -extern int scandir (__const char *__restrict __dir, +extern int scandir (const char *__restrict __dir, struct dirent ***__restrict __namelist, - int (*__selector) (__const struct dirent *), - int (*__cmp) (__const struct dirent **, - __const struct dirent **)) + int (*__selector) (const struct dirent *), + int (*__cmp) (const struct dirent **, + const struct dirent **)) __nonnull ((1, 2)); # else # ifdef __REDIRECT extern int __REDIRECT (scandir, - (__const char *__restrict __dir, + (const char *__restrict __dir, struct dirent ***__restrict __namelist, - int (*__selector) (__const struct dirent *), - int (*__cmp) (__const struct dirent **, - __const struct dirent **)), + int (*__selector) (const struct dirent *), + int (*__cmp) (const struct dirent **, + const struct dirent **)), scandir64) __nonnull ((1, 2)); # else # define scandir scandir64 @@ -278,24 +278,24 @@ extern int __REDIRECT (scandir, # if defined __USE_GNU && defined __USE_LARGEFILE64 /* This function is like `scandir' but it uses the 64bit dirent structure. Please note that the CMP function must now work with struct dirent64 **. */ -extern int scandir64 (__const char *__restrict __dir, +extern int scandir64 (const char *__restrict __dir, struct dirent64 ***__restrict __namelist, - int (*__selector) (__const struct dirent64 *), - int (*__cmp) (__const struct dirent64 **, - __const struct dirent64 **)) + int (*__selector) (const struct dirent64 *), + int (*__cmp) (const struct dirent64 **, + const struct dirent64 **)) __nonnull ((1, 2)); # endif /* Function to compare two `struct dirent's alphabetically. */ # ifndef __USE_FILE_OFFSET64 -extern int alphasort (__const struct dirent **__e1, - __const struct dirent **__e2) +extern int alphasort (const struct dirent **__e1, + const struct dirent **__e2) __THROW __attribute_pure__ __nonnull ((1, 2)); # else # ifdef __REDIRECT extern int __REDIRECT_NTH (alphasort, - (__const struct dirent **__e1, - __const struct dirent **__e2), + (const struct dirent **__e1, + const struct dirent **__e2), alphasort64) __attribute_pure__ __nonnull ((1, 2)); # else # define alphasort alphasort64 @@ -303,8 +303,8 @@ extern int __REDIRECT_NTH (alphasort, # endif # if defined __USE_GNU && defined __USE_LARGEFILE64 -extern int alphasort64 (__const struct dirent64 **__e1, - __const struct dirent64 **__e2) +extern int alphasort64 (const struct dirent64 **__e1, + const struct dirent64 **__e2) __THROW __attribute_pure__ __nonnull ((1, 2)); # endif #endif /* Use BSD or misc or XPG7. */ @@ -343,14 +343,14 @@ extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf, #ifdef __USE_GNU /* Function to compare two `struct dirent's by name & version. */ # ifndef __USE_FILE_OFFSET64 -extern int versionsort (__const struct dirent **__e1, - __const struct dirent **__e2) +extern int versionsort (const struct dirent **__e1, + const struct dirent **__e2) __THROW __attribute_pure__ __nonnull ((1, 2)); # else # ifdef __REDIRECT extern int __REDIRECT_NTH (versionsort, - (__const struct dirent **__e1, - __const struct dirent **__e2), + (const struct dirent **__e1, + const struct dirent **__e2), versionsort64) __attribute_pure__ __nonnull ((1, 2)); # else @@ -359,8 +359,8 @@ extern int __REDIRECT_NTH (versionsort, # endif # ifdef __USE_LARGEFILE64 -extern int versionsort64 (__const struct dirent64 **__e1, - __const struct dirent64 **__e2) +extern int versionsort64 (const struct dirent64 **__e1, + const struct dirent64 **__e2) __THROW __attribute_pure__ __nonnull ((1, 2)); # endif #endif /* Use GNU. */ diff --git a/include/dlfcn.h b/include/dlfcn.h index 90a5d18fc..41d0d6fa4 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -55,7 +55,7 @@ __BEGIN_DECLS /* Open the shared object FILE and map it in; return a handle that can be passed to `dlsym' to get symbol values from it. */ -extern void *dlopen (__const char *__file, int __mode) __THROW; +extern void *dlopen (const char *__file, int __mode) __THROW; /* Unmap and close a shared object opened by `dlopen'. The handle cannot be used again after calling `dlclose'. */ @@ -64,17 +64,17 @@ extern int dlclose (void *__handle) __THROW __nonnull ((1)); /* Find the run-time address in the shared object HANDLE refers to of the symbol called NAME. */ extern void *dlsym (void *__restrict __handle, - __const char *__restrict __name) __THROW __nonnull ((2)); + const char *__restrict __name) __THROW __nonnull ((2)); #if 0 /*def __USE_GNU*/ /* Like `dlopen', but request object to be allocated in a new namespace. */ -extern void *dlmopen (Lmid_t __nsid, __const char *__file, int __mode) __THROW; +extern void *dlmopen (Lmid_t __nsid, const char *__file, int __mode) __THROW; /* Find the run-time address in the shared object HANDLE refers to of the symbol called NAME with VERSION. */ extern void *dlvsym (void *__restrict __handle, - __const char *__restrict __name, - __const char *__restrict __version) + const char *__restrict __name, + const char *__restrict __version) __THROW __nonnull ((2, 3)); #endif @@ -89,20 +89,20 @@ extern char *dlerror (void) __THROW; `dladdr'. */ typedef struct { - __const char *dli_fname; /* File name of defining object. */ + const char *dli_fname; /* File name of defining object. */ void *dli_fbase; /* Load address of that object. */ - __const char *dli_sname; /* Name of nearest symbol. */ + const char *dli_sname; /* Name of nearest symbol. */ void *dli_saddr; /* Exact value of nearest symbol. */ } Dl_info; /* Fill in *INFO with the following information about ADDRESS. Returns 0 iff no shared object's segments contain that address. */ -extern int dladdr (__const void *__address, Dl_info *__info) +extern int dladdr (const void *__address, Dl_info *__info) __THROW __nonnull ((2)); #if 0 /* not supported by uClibc */ /* Same as `dladdr', but additionally sets *EXTRA_INFO according to FLAGS. */ -extern int dladdr1 (__const void *__address, Dl_info *__info, +extern int dladdr1 (const void *__address, Dl_info *__info, void **__extra_info, int __flags) __THROW __nonnull ((2)); /* These are the possible values for the FLAGS argument to `dladdr1'. diff --git a/include/err.h b/include/err.h index 77b7a1b18..25ff4e957 100644 --- a/include/err.h +++ b/include/err.h @@ -31,25 +31,25 @@ __BEGIN_DECLS /* Print "program: ", FORMAT, ": ", the standard error string for errno, and a newline, on stderr. */ -extern void warn (__const char *__format, ...) +extern void warn (const char *__format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); -extern void vwarn (__const char *__format, __gnuc_va_list) +extern void vwarn (const char *__format, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 1, 0))); /* Likewise, but without ": " and the standard error string. */ -extern void warnx (__const char *__format, ...) +extern void warnx (const char *__format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); -extern void vwarnx (__const char *__format, __gnuc_va_list) +extern void vwarnx (const char *__format, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 1, 0))); /* Likewise, and then exit with STATUS. */ -extern void err (int __status, __const char *__format, ...) +extern void err (int __status, const char *__format, ...) __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3))); -extern void verr (int __status, __const char *__format, __gnuc_va_list) +extern void verr (int __status, const char *__format, __gnuc_va_list) __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); -extern void errx (int __status, __const char *__format, ...) +extern void errx (int __status, const char *__format, ...) __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3))); -extern void verrx (int __status, __const char *, __gnuc_va_list) +extern void verrx (int __status, const char *, __gnuc_va_list) __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0))); __END_DECLS diff --git a/include/execinfo.h b/include/execinfo.h index 66cfb9366..503c84662 100644 --- a/include/execinfo.h +++ b/include/execinfo.h @@ -29,13 +29,13 @@ extern int backtrace (void **__array, int __size) __nonnull ((1)); /* Return names of functions from the backtrace list in ARRAY in a newly malloc()ed memory block. */ -extern char **backtrace_symbols (void *__const *__array, int __size) +extern char **backtrace_symbols (void *const *__array, int __size) __THROW __nonnull ((1)); /* This function is similar to backtrace_symbols() but it writes the result immediately to a file. */ -extern void backtrace_symbols_fd (void *__const *__array, int __size, int __fd) +extern void backtrace_symbols_fd (void *const *__array, int __size, int __fd) __THROW __nonnull ((1)); __END_DECLS diff --git a/include/fcntl.h b/include/fcntl.h index 315395d36..ed009dd9a 100644 --- a/include/fcntl.h +++ b/include/fcntl.h @@ -100,7 +100,7 @@ libc_hidden_proto(fcntl64) This function is a cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 -extern int open (__const char *__file, int __oflag, ...) __nonnull ((1)); +extern int open (const char *__file, int __oflag, ...) __nonnull ((1)); libc_hidden_proto(open) # ifdef _LIBC extern int __open2_nocancel(const char *, int) __nonnull ((1)) attribute_hidden; @@ -108,14 +108,14 @@ extern int __open_nocancel(const char *, int, mode_t) __nonnull ((1)) attribute_ # endif #else # ifdef __REDIRECT -extern int __REDIRECT (open, (__const char *__file, int __oflag, ...), open64) +extern int __REDIRECT (open, (const char *__file, int __oflag, ...), open64) __nonnull ((1)); # else # define open open64 # endif #endif #ifdef __USE_LARGEFILE64 -extern int open64 (__const char *__file, int __oflag, ...) __nonnull ((1)); +extern int open64 (const char *__file, int __oflag, ...) __nonnull ((1)); libc_hidden_proto(open64) #endif @@ -130,19 +130,19 @@ libc_hidden_proto(open64) This function is a cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 -extern int openat (int __fd, __const char *__file, int __oflag, ...) +extern int openat (int __fd, const char *__file, int __oflag, ...) __nonnull ((2)); libc_hidden_proto(openat) # else # ifdef __REDIRECT -extern int __REDIRECT (openat, (int __fd, __const char *__file, int __oflag, +extern int __REDIRECT (openat, (int __fd, const char *__file, int __oflag, ...), openat64) __nonnull ((2)); # else # define openat openat64 # endif # endif -extern int openat64 (int __fd, __const char *__file, int __oflag, ...) +extern int openat64 (int __fd, const char *__file, int __oflag, ...) __nonnull ((2)); #endif @@ -152,17 +152,17 @@ extern int openat64 (int __fd, __const char *__file, int __oflag, ...) This function is a cancellation point and therefore not marked with __THROW. */ #ifndef __USE_FILE_OFFSET64 -extern int creat (__const char *__file, __mode_t __mode) __nonnull ((1)); +extern int creat (const char *__file, __mode_t __mode) __nonnull ((1)); #else # ifdef __REDIRECT -extern int __REDIRECT (creat, (__const char *__file, __mode_t __mode), +extern int __REDIRECT (creat, (const char *__file, __mode_t __mode), creat64) __nonnull ((1)); # else # define creat creat64 # endif #endif #ifdef __USE_LARGEFILE64 -extern int creat64 (__const char *__file, __mode_t __mode) __nonnull ((1)); +extern int creat64 (const char *__file, __mode_t __mode) __nonnull ((1)); #endif #if !defined F_LOCK && (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \ diff --git a/include/fenv.h b/include/fenv.h index 77fc060a0..9ba384756 100644 --- a/include/fenv.h +++ b/include/fenv.h @@ -72,7 +72,7 @@ extern int feraiseexcept (int __excepts) __THROW; /* Set complete status for exceptions indicated by EXCEPTS according to the representation in the object pointed to by FLAGP. */ -extern int fesetexceptflag (__const fexcept_t *__flagp, int __excepts) __THROW; +extern int fesetexceptflag (const fexcept_t *__flagp, int __excepts) __THROW; /* Determine which of subset of the exceptions specified by EXCEPTS are currently set. */ @@ -101,12 +101,12 @@ extern int feholdexcept (fenv_t *__envp) __THROW; /* Establish the floating-point environment represented by the object pointed to by ENVP. */ -extern int fesetenv (__const fenv_t *__envp) __THROW; +extern int fesetenv (const fenv_t *__envp) __THROW; /* Save current exceptions in temporary storage, install environment represented by object pointed to by ENVP and raise exceptions according to saved exceptions. */ -extern int feupdateenv (__const fenv_t *__envp) __THROW; +extern int feupdateenv (const fenv_t *__envp) __THROW; /* Include optimization. */ diff --git a/include/fnmatch.h b/include/fnmatch.h index d6e1dca86..d77e4b6b0 100644 --- a/include/fnmatch.h +++ b/include/fnmatch.h @@ -22,14 +22,6 @@ extern "C" { #endif -#ifndef const -# if (defined __STDC__ && __STDC__) || defined __cplusplus -# define __const const -# else -# define __const -# endif -#endif - /* We #undef these before defining them because some losing systems (HP-UX A.08.07 for example) define these in . */ #undef FNM_PATHNAME @@ -61,7 +53,7 @@ extern "C" { /* Match NAME against the filename pattern PATTERN, returning zero if it matches, FNM_NOMATCH if not. */ -extern int fnmatch (__const char *__pattern, __const char *__name, +extern int fnmatch (const char *__pattern, const char *__name, int __flags); libc_hidden_proto(fnmatch) diff --git a/include/ftw.h b/include/ftw.h index 4ccc8a742..528db404d 100644 --- a/include/ftw.h +++ b/include/ftw.h @@ -111,19 +111,19 @@ struct FTW /* Convenient types for callback functions. */ -typedef int (*__ftw_func_t) (__const char *__filename, - __const struct stat *__status, int __flag); +typedef int (*__ftw_func_t) (const char *__filename, + const struct stat *__status, int __flag); #ifdef __USE_LARGEFILE64 -typedef int (*__ftw64_func_t) (__const char *__filename, - __const struct stat64 *__status, int __flag); +typedef int (*__ftw64_func_t) (const char *__filename, + const struct stat64 *__status, int __flag); #endif #ifdef __USE_XOPEN_EXTENDED -typedef int (*__nftw_func_t) (__const char *__filename, - __const struct stat *__status, int __flag, +typedef int (*__nftw_func_t) (const char *__filename, + const struct stat *__status, int __flag, struct FTW *__info); # ifdef __USE_LARGEFILE64 -typedef int (*__nftw64_func_t) (__const char *__filename, - __const struct stat64 *__status, +typedef int (*__nftw64_func_t) (const char *__filename, + const struct stat64 *__status, int __flag, struct FTW *__info); # endif #endif @@ -134,18 +134,18 @@ typedef int (*__nftw64_func_t) (__const char *__filename, This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 -extern int ftw (__const char *__dir, __ftw_func_t __func, int __descriptors) +extern int ftw (const char *__dir, __ftw_func_t __func, int __descriptors) __nonnull ((1, 2)); # else # ifdef __REDIRECT -extern int __REDIRECT (ftw, (__const char *__dir, __ftw_func_t __func, +extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func, int __descriptors), ftw64) __nonnull ((1, 2)); # else # define ftw ftw64 # endif # endif # ifdef __USE_LARGEFILE64 -extern int ftw64 (__const char *__dir, __ftw64_func_t __func, +extern int ftw64 (const char *__dir, __ftw64_func_t __func, int __descriptors) __nonnull ((1, 2)); # endif #endif @@ -157,11 +157,11 @@ extern int ftw64 (__const char *__dir, __ftw64_func_t __func, This function is a possible cancellation point and therefore not marked with __THROW. */ # ifndef __USE_FILE_OFFSET64 -extern int nftw (__const char *__dir, __nftw_func_t __func, int __descriptors, +extern int nftw (const char *__dir, __nftw_func_t __func, int __descriptors, int __flag) __nonnull ((1, 2)); # else # ifdef __REDIRECT -extern int __REDIRECT (nftw, (__const char *__dir, __nftw_func_t __func, +extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func, int __descriptors, int __flag), nftw64) __nonnull ((1, 2)); # else @@ -169,7 +169,7 @@ extern int __REDIRECT (nftw, (__const char *__dir, __nftw_func_t __func, # endif # endif # ifdef __USE_LARGEFILE64 -extern int nftw64 (__const char *__dir, __nftw64_func_t __func, +extern int nftw64 (const char *__dir, __nftw64_func_t __func, int __descriptors, int __flag) __nonnull ((1, 2)); # endif #endif diff --git a/include/glob.h b/include/glob.h index aa87438f8..6d712e56d 100644 --- a/include/glob.h +++ b/include/glob.h @@ -109,13 +109,13 @@ typedef struct #else void *(*gl_readdir) (void *); #endif - void *(*gl_opendir) (__const char *); + void *(*gl_opendir) (const char *); #ifdef __USE_GNU - int (*gl_lstat) (__const char *__restrict, struct stat *__restrict); - int (*gl_stat) (__const char *__restrict, struct stat *__restrict); + int (*gl_lstat) (const char *__restrict, struct stat *__restrict); + int (*gl_stat) (const char *__restrict, struct stat *__restrict); #else - int (*gl_lstat) (__const char *__restrict, void *__restrict); - int (*gl_stat) (__const char *__restrict, void *__restrict); + int (*gl_lstat) (const char *__restrict, void *__restrict); + int (*gl_stat) (const char *__restrict, void *__restrict); #endif #endif #endif /* __UCLIBC_HAS_GNU_GLOB__ */ @@ -142,13 +142,13 @@ typedef struct # else void *(*gl_readdir) (void *); # endif - void *(*gl_opendir) (__const char *); + void *(*gl_opendir) (const char *); # ifdef __USE_GNU - int (*gl_lstat) (__const char *__restrict, struct stat64 *__restrict); - int (*gl_stat) (__const char *__restrict, struct stat64 *__restrict); + int (*gl_lstat) (const char *__restrict, struct stat64 *__restrict); + int (*gl_stat) (const char *__restrict, struct stat64 *__restrict); # else - int (*gl_lstat) (__const char *__restrict, void *__restrict); - int (*gl_stat) (__const char *__restrict, void *__restrict); + int (*gl_lstat) (const char *__restrict, void *__restrict); + int (*gl_stat) (const char *__restrict, void *__restrict); # endif #endif #endif /* __UCLIBC_HAS_GNU_GLOB__ */ @@ -169,8 +169,8 @@ typedef struct If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned. Otherwise, `glob' returns zero. */ #if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2 -extern int glob (__const char *__restrict __pattern, int __flags, - int (*__errfunc) (__const char *, int), +extern int glob (const char *__restrict __pattern, int __flags, + int (*__errfunc) (const char *, int), glob_t *__restrict __pglob) __THROW; libc_hidden_proto(glob) @@ -178,17 +178,17 @@ libc_hidden_proto(glob) extern void globfree (glob_t *__pglob) __THROW; libc_hidden_proto(globfree) #else -extern int __REDIRECT_NTH (glob, (__const char *__restrict __pattern, +extern int __REDIRECT_NTH (glob, (const char *__restrict __pattern, int __flags, - int (*__errfunc) (__const char *, int), + int (*__errfunc) (const char *, int), glob_t *__restrict __pglob), glob64); extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64); #endif #ifdef __USE_LARGEFILE64 -extern int glob64 (__const char *__restrict __pattern, int __flags, - int (*__errfunc) (__const char *, int), +extern int glob64 (const char *__restrict __pattern, int __flags, + int (*__errfunc) (const char *, int), glob64_t *__restrict __pglob) __THROW; libc_hidden_proto(glob64) @@ -203,7 +203,7 @@ libc_hidden_proto(globfree64) This function is not part of the interface specified by POSIX.2 but several programs want to use it. */ -extern int glob_pattern_p (__const char *__pattern, int __quote) __THROW; +extern int glob_pattern_p (const char *__pattern, int __quote) __THROW; libc_hidden_proto(glob_pattern_p) #endif diff --git a/include/grp.h b/include/grp.h index b84ca46dd..676100eb0 100644 --- a/include/grp.h +++ b/include/grp.h @@ -91,7 +91,7 @@ extern struct group *fgetgrent (FILE *__stream); cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ -extern int putgrent (__const struct group *__restrict __p, +extern int putgrent (const struct group *__restrict __p, FILE *__restrict __f); #endif @@ -105,7 +105,7 @@ extern struct group *getgrgid (__gid_t __gid); This function is a possible cancellation point and therefore not marked with __THROW. */ -extern struct group *getgrnam (__const char *__name); +extern struct group *getgrnam (const char *__name); #if defined __USE_POSIX || defined __USE_MISC @@ -148,7 +148,7 @@ libc_hidden_proto(getgrgid_r) This function is a possible cancellation point and therefore not marked with __THROW. */ -extern int getgrnam_r (__const char *__restrict __name, +extern int getgrnam_r (const char *__restrict __name, struct group *__restrict __resultbuf, char *__restrict __buffer, size_t __buflen, struct group **__restrict __result); @@ -186,7 +186,7 @@ libc_hidden_proto(fgetgrent_r) cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ -extern int getgrouplist (__const char *__user, __gid_t __group, +extern int getgrouplist (const char *__user, __gid_t __group, __gid_t *__groups, int *__ngroups); #endif @@ -194,7 +194,7 @@ extern int getgrouplist (__const char *__user, __gid_t __group, #if defined __USE_BSD /* Set the group set for the current user to GROUPS (N of them). */ -extern int setgroups (size_t __n, __const __gid_t *__groups) __THROW; +extern int setgroups (size_t __n, const __gid_t *__groups) __THROW; libc_hidden_proto(setgroups) /* Initialize the group set for the current user @@ -205,7 +205,7 @@ libc_hidden_proto(setgroups) cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ -extern int initgroups (__const char *__user, __gid_t __group); +extern int initgroups (const char *__user, __gid_t __group); #endif /* Use BSD. */ diff --git a/include/iconv.h b/include/iconv.h index 847ada64e..d850de56e 100644 --- a/include/iconv.h +++ b/include/iconv.h @@ -38,7 +38,7 @@ typedef void *iconv_t; This function is a possible cancellation points and therefore not marked with __THROW. */ -extern iconv_t iconv_open (__const char *__tocode, __const char *__fromcode); +extern iconv_t iconv_open (const char *__tocode, const char *__fromcode); /* Convert at most *INBYTESLEFT bytes from *INBUF according to the code conversion algorithm specified by CD and place up to diff --git a/include/inttypes.h b/include/inttypes.h index 554efdc3f..fa6339869 100644 --- a/include/inttypes.h +++ b/include/inttypes.h @@ -303,21 +303,21 @@ extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom) __THROW __attribute__ ((__const__)); /* Like `strtol' but convert to `intmax_t'. */ -extern intmax_t strtoimax (__const char *__restrict __nptr, +extern intmax_t strtoimax (const char *__restrict __nptr, char **__restrict __endptr, int __base) __THROW; /* Like `strtoul' but convert to `uintmax_t'. */ -extern uintmax_t strtoumax (__const char *__restrict __nptr, +extern uintmax_t strtoumax (const char *__restrict __nptr, char ** __restrict __endptr, int __base) __THROW; #ifdef __UCLIBC_HAS_WCHAR__ /* Like `wcstol' but convert to `intmax_t'. */ -extern intmax_t wcstoimax (__const __gwchar_t *__restrict __nptr, +extern intmax_t wcstoimax (const __gwchar_t *__restrict __nptr, __gwchar_t **__restrict __endptr, int __base) __THROW; /* Like `wcstoul' but convert to `uintmax_t'. */ -extern uintmax_t wcstoumax (__const __gwchar_t *__restrict __nptr, +extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr, __gwchar_t ** __restrict __endptr, int __base) __THROW; #endif @@ -326,44 +326,44 @@ extern uintmax_t wcstoumax (__const __gwchar_t *__restrict __nptr, # if __WORDSIZE == 64 -extern long int __strtol_internal (__const char *__restrict __nptr, +extern long int __strtol_internal (const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull ((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr, +__NTH (strtoimax (const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtol_internal (nptr, endptr, base, 0); } -extern unsigned long int __strtoul_internal (__const char * +extern unsigned long int __strtoul_internal (const char * __restrict __nptr, char ** __restrict __endptr, int __base, int __group) __THROW __nonnull ((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr, +__NTH (strtoumax (const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtoul_internal (nptr, endptr, base, 0); } -extern long int __wcstol_internal (__const __gwchar_t * __restrict __nptr, +extern long int __wcstol_internal (const __gwchar_t * __restrict __nptr, __gwchar_t **__restrict __endptr, int __base, int __group) __THROW __nonnull ((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (wcstoimax (__const __gwchar_t *__restrict nptr, +__NTH (wcstoimax (const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base)) { return __wcstol_internal (nptr, endptr, base, 0); } -extern unsigned long int __wcstoul_internal (__const __gwchar_t * +extern unsigned long int __wcstoul_internal (const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, @@ -371,7 +371,7 @@ extern unsigned long int __wcstoul_internal (__const __gwchar_t * __THROW __nonnull ((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (wcstoumax (__const __gwchar_t *__restrict nptr, +__NTH (wcstoumax (const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base)) { return __wcstoul_internal (nptr, endptr, base, 0); @@ -380,20 +380,20 @@ __NTH (wcstoumax (__const __gwchar_t *__restrict nptr, # else /* __WORDSIZE == 32 */ __extension__ -extern long long int __strtoll_internal (__const char *__restrict __nptr, +extern long long int __strtoll_internal (const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __THROW __nonnull ((1)) __wur; /* Like `strtol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr, +__NTH (strtoimax (const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtoll_internal (nptr, endptr, base, 0); } __extension__ -extern unsigned long long int __strtoull_internal (__const char * +extern unsigned long long int __strtoull_internal (const char * __restrict __nptr, char ** __restrict __endptr, @@ -402,21 +402,21 @@ extern unsigned long long int __strtoull_internal (__const char * __THROW __nonnull ((1)) __wur; /* Like `strtoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr, +__NTH (strtoumax (const char *__restrict nptr, char **__restrict endptr, int base)) { return __strtoull_internal (nptr, endptr, base, 0); } __extension__ -extern long long int __wcstoll_internal (__const __gwchar_t * +extern long long int __wcstoll_internal (const __gwchar_t * __restrict __nptr, __gwchar_t **__restrict __endptr, int __base, int __group) __THROW __nonnull ((1)) __wur; /* Like `wcstol' but convert to `intmax_t'. */ __extern_inline intmax_t -__NTH (wcstoimax (__const __gwchar_t *__restrict nptr, +__NTH (wcstoimax (const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base)) { return __wcstoll_internal (nptr, endptr, base, 0); @@ -424,7 +424,7 @@ __NTH (wcstoimax (__const __gwchar_t *__restrict nptr, __extension__ -extern unsigned long long int __wcstoull_internal (__const __gwchar_t * +extern unsigned long long int __wcstoull_internal (const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, @@ -433,7 +433,7 @@ extern unsigned long long int __wcstoull_internal (__const __gwchar_t * __THROW __nonnull ((1)) __wur; /* Like `wcstoul' but convert to `uintmax_t'. */ __extern_inline uintmax_t -__NTH (wcstoumax (__const __gwchar_t *__restrict nptr, +__NTH (wcstoumax (const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base)) { return __wcstoull_internal (nptr, endptr, base, 0); diff --git a/include/libintl.h b/include/libintl.h index feadc3e5e..0cbf758ed 100644 --- a/include/libintl.h +++ b/include/libintl.h @@ -38,46 +38,46 @@ __BEGIN_DECLS /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ -extern char *gettext (__const char *__msgid) +extern char *gettext (const char *__msgid) __THROW __attribute_format_arg__ (1); /* Look up MSGID in the DOMAINNAME message catalog for the current LC_MESSAGES locale. */ -extern char *dgettext (__const char *__domainname, __const char *__msgid) +extern char *dgettext (const char *__domainname, const char *__msgid) __THROW __attribute_format_arg__ (2); #if 0 /* uClibc: disabled */ -extern char *__dgettext (__const char *__domainname, __const char *__msgid) +extern char *__dgettext (const char *__domainname, const char *__msgid) __THROW __attribute_format_arg__ (2); #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ -extern char *dcgettext (__const char *__domainname, - __const char *__msgid, int __category) +extern char *dcgettext (const char *__domainname, + const char *__msgid, int __category) __THROW __attribute_format_arg__ (2); #if 0 /* uClibc: disabled */ -extern char *__dcgettext (__const char *__domainname, - __const char *__msgid, int __category) +extern char *__dcgettext (const char *__domainname, + const char *__msgid, int __category) __THROW __attribute_format_arg__ (2); #endif /* Similar to `gettext' but select the plural form corresponding to the number N. */ -extern char *ngettext (__const char *__msgid1, __const char *__msgid2, +extern char *ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n) __THROW __attribute_format_arg__ (1) __attribute_format_arg__ (2); /* Similar to `dgettext' but select the plural form corresponding to the number N. */ -extern char *dngettext (__const char *__domainname, __const char *__msgid1, - __const char *__msgid2, unsigned long int __n) +extern char *dngettext (const char *__domainname, const char *__msgid1, + const char *__msgid2, unsigned long int __n) __THROW __attribute_format_arg__ (2) __attribute_format_arg__ (3); /* Similar to `dcgettext' but select the plural form corresponding to the number N. */ -extern char *dcngettext (__const char *__domainname, __const char *__msgid1, - __const char *__msgid2, unsigned long int __n, +extern char *dcngettext (const char *__domainname, const char *__msgid1, + const char *__msgid2, unsigned long int __n, int __category) __THROW __attribute_format_arg__ (2) __attribute_format_arg__ (3); @@ -85,17 +85,17 @@ extern char *dcngettext (__const char *__domainname, __const char *__msgid1, /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ -extern char *textdomain (__const char *__domainname) __THROW; +extern char *textdomain (const char *__domainname) __THROW; /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ -extern char *bindtextdomain (__const char *__domainname, - __const char *__dirname) __THROW; +extern char *bindtextdomain (const char *__domainname, + const char *__dirname) __THROW; /* Specify the character encoding in which the messages from the DOMAINNAME message catalog will be returned. */ -extern char *bind_textdomain_codeset (__const char *__domainname, - __const char *__codeset) __THROW; +extern char *bind_textdomain_codeset (const char *__domainname, + const char *__codeset) __THROW; /* Optimized version of the function above. */ diff --git a/include/locale.h b/include/locale.h index 49db759be..3cd6f5ef3 100644 --- a/include/locale.h +++ b/include/locale.h @@ -123,7 +123,7 @@ struct lconv /* Set and/or return the current locale. */ -extern char *setlocale (int __category, __const char *__locale) __THROW; +extern char *setlocale (int __category, const char *__locale) __THROW; /* Return the numeric/monetary information for the current locale. */ extern struct lconv *localeconv (void) __THROW; @@ -151,7 +151,7 @@ __END_NAMESPACE_STD datasets. Unlike for the CATEGORY parameter for `setlocale' the CATEGORY_MASK parameter here uses a single bit for each category, made by OR'ing together LC_*_MASK bits above. */ -extern __locale_t newlocale (int __category_mask, __const char *__locale, +extern __locale_t newlocale (int __category_mask, const char *__locale, __locale_t __base) __THROW; libc_hidden_proto(newlocale) diff --git a/include/mntent.h b/include/mntent.h index daa0a60ea..f9f119db5 100644 --- a/include/mntent.h +++ b/include/mntent.h @@ -63,7 +63,7 @@ struct mntent /* Prepare to begin reading and/or writing mount table entries from the beginning of FILE. MODE is as for `fopen'. */ -extern FILE *setmntent (__const char *__file, __const char *__mode) __THROW; +extern FILE *setmntent (const char *__file, const char *__mode) __THROW; libc_hidden_proto(setmntent) /* Read one mount table entry from STREAM. Returns a pointer to storage @@ -83,7 +83,7 @@ libc_hidden_proto(getmntent_r) /* Write the mount table entry described by MNT to STREAM. Return zero on success, nonzero on failure. */ extern int addmntent (FILE *__restrict __stream, - __const struct mntent *__restrict __mnt) __THROW; + const struct mntent *__restrict __mnt) __THROW; /* Close a stream opened with `setmntent'. */ extern int endmntent (FILE *__stream) __THROW; @@ -91,8 +91,8 @@ libc_hidden_proto(endmntent) /* Search MNT->mnt_opts for an option matching OPT. Returns the address of the substring, or null if none found. */ -extern char *hasmntopt (__const struct mntent *__mnt, - __const char *__opt) __THROW; +extern char *hasmntopt (const struct mntent *__mnt, + const char *__opt) __THROW; __END_DECLS diff --git a/include/net/if.h b/include/net/if.h index 4cb641407..67636e0fc 100644 --- a/include/net/if.h +++ b/include/net/if.h @@ -190,7 +190,7 @@ struct ifconf __BEGIN_DECLS /* Convert an interface name to an index, and vice versa. */ -extern unsigned int if_nametoindex (__const char *__ifname) __THROW; +extern unsigned int if_nametoindex (const char *__ifname) __THROW; libc_hidden_proto(if_nametoindex) extern char *if_indextoname (unsigned int __ifindex, char *__ifname) __THROW; diff --git a/include/netdb.h b/include/netdb.h index 91c9dcd65..14cf3d24d 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -118,11 +118,11 @@ extern int h_errno; #if defined __USE_MISC || defined __USE_GNU /* Print error indicated by `h_errno' variable on standard error. STR if non-null is printed before the error string. */ -extern void herror (__const char *__str) __THROW; +extern void herror (const char *__str) __THROW; libc_hidden_proto(herror) /* Return string associated with error ERR_NUM. */ -extern __const char *hstrerror (int __err_num) __THROW; +extern const char *hstrerror (int __err_num) __THROW; #endif @@ -164,7 +164,7 @@ extern struct hostent *gethostent (void); This function is a possible cancellation point and therefore not marked with __THROW. */ -extern struct hostent *gethostbyaddr (__const void *__addr, __socklen_t __len, +extern struct hostent *gethostbyaddr (const void *__addr, __socklen_t __len, int __type); libc_hidden_proto(gethostbyaddr) @@ -172,7 +172,7 @@ libc_hidden_proto(gethostbyaddr) This function is a possible cancellation point and therefore not marked with __THROW. */ -extern struct hostent *gethostbyname (__const char *__name); +extern struct hostent *gethostbyname (const char *__name); libc_hidden_proto(gethostbyname) #ifdef __USE_MISC @@ -184,7 +184,7 @@ libc_hidden_proto(gethostbyname) cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ -extern struct hostent *gethostbyname2 (__const char *__name, int __af); +extern struct hostent *gethostbyname2 (const char *__name, int __af); libc_hidden_proto(gethostbyname2) /* Reentrant versions of the functions above. The additional @@ -203,7 +203,7 @@ extern int gethostent_r (struct hostent *__restrict __result_buf, int *__restrict __h_errnop); libc_hidden_proto(gethostent_r) -extern int gethostbyaddr_r (__const void *__restrict __addr, __socklen_t __len, +extern int gethostbyaddr_r (const void *__restrict __addr, __socklen_t __len, int __type, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, @@ -211,14 +211,14 @@ extern int gethostbyaddr_r (__const void *__restrict __addr, __socklen_t __len, int *__restrict __h_errnop); libc_hidden_proto(gethostbyaddr_r) -extern int gethostbyname_r (__const char *__restrict __name, +extern int gethostbyname_r (const char *__restrict __name, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop); libc_hidden_proto(gethostbyname_r) -extern int gethostbyname2_r (__const char *__restrict __name, int __af, +extern int gethostbyname2_r (const char *__restrict __name, int __af, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, @@ -260,7 +260,7 @@ extern struct netent *getnetbyaddr (uint32_t __net, int __type); This function is a possible cancellation point and therefore not marked with __THROW. */ -extern struct netent *getnetbyname (__const char *__name); +extern struct netent *getnetbyname (const char *__name); #ifdef __USE_MISC /* Reentrant versions of the functions above. The additional @@ -286,7 +286,7 @@ extern int getnetbyaddr_r (uint32_t __net, int __type, int *__restrict __h_errnop); libc_hidden_proto(getnetbyaddr_r) -extern int getnetbyname_r (__const char *__restrict __name, +extern int getnetbyname_r (const char *__restrict __name, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, @@ -331,15 +331,15 @@ extern struct servent *getservent (void); This function is a possible cancellation point and therefore not marked with __THROW. */ -extern struct servent *getservbyname (__const char *__name, - __const char *__proto); +extern struct servent *getservbyname (const char *__name, + const char *__proto); /* Return entry from service data base which matches port PORT and protocol PROTO. This function is a possible cancellation point and therefore not marked with __THROW. */ -extern struct servent *getservbyport (int __port, __const char *__proto); +extern struct servent *getservbyport (int __port, const char *__proto); libc_hidden_proto(getservbyport) @@ -356,14 +356,14 @@ extern int getservent_r (struct servent *__restrict __result_buf, struct servent **__restrict __result); libc_hidden_proto(getservent_r) -extern int getservbyname_r (__const char *__restrict __name, - __const char *__restrict __proto, +extern int getservbyname_r (const char *__restrict __name, + const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); libc_hidden_proto(getservbyname_r) -extern int getservbyport_r (int __port, __const char *__restrict __proto, +extern int getservbyport_r (int __port, const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result); @@ -405,7 +405,7 @@ extern struct protoent *getprotoent (void); This function is a possible cancellation point and therefore not marked with __THROW. */ -extern struct protoent *getprotobyname (__const char *__name); +extern struct protoent *getprotobyname (const char *__name); /* Return entry from protocol data base which number is PROTO. @@ -427,7 +427,7 @@ extern int getprotoent_r (struct protoent *__restrict __result_buf, struct protoent **__restrict __result); libc_hidden_proto(getprotoent_r) -extern int getprotobyname_r (__const char *__restrict __name, +extern int getprotobyname_r (const char *__restrict __name, struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result); @@ -447,7 +447,7 @@ libc_hidden_proto(getprotobynumber_r) cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ -extern int setnetgrent (__const char *__netgroup); +extern int setnetgrent (const char *__netgroup); /* Free all space allocated by previous `setnetgrent' call. @@ -475,8 +475,8 @@ extern int getnetgrent (char **__restrict __hostp, cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ -extern int innetgr (__const char *__netgroup, __const char *__host, - __const char *__user, __const char *__domain); +extern int innetgr (const char *__netgroup, const char *__host, + const char *__user, const char *__domain); /* Reentrant version of `getnetgrent' where result is placed in BUFFER. @@ -511,9 +511,9 @@ libc_hidden_proto(ruserpass) or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rcmd (char **__restrict __ahost, unsigned short int __rport, - __const char *__restrict __locuser, - __const char *__restrict __remuser, - __const char *__restrict __cmd, int *__restrict __fd2p); + const char *__restrict __locuser, + const char *__restrict __remuser, + const char *__restrict __cmd, int *__restrict __fd2p); #if 0 /* FIXME */ @@ -525,9 +525,9 @@ extern int rcmd (char **__restrict __ahost, unsigned short int __rport, or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport, - __const char *__restrict __locuser, - __const char *__restrict __remuser, - __const char *__restrict __cmd, int *__restrict __fd2p, + const char *__restrict __locuser, + const char *__restrict __remuser, + const char *__restrict __cmd, int *__restrict __fd2p, sa_family_t __af); #endif @@ -542,9 +542,9 @@ extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport, or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rexec (char **__restrict __ahost, int __rport, - __const char *__restrict __name, - __const char *__restrict __pass, - __const char *__restrict __cmd, int *__restrict __fd2p); + const char *__restrict __name, + const char *__restrict __pass, + const char *__restrict __cmd, int *__restrict __fd2p); /* This is the equivalent function where the protocol can be selected and which therefore can be used for IPv6. @@ -554,9 +554,9 @@ extern int rexec (char **__restrict __ahost, int __rport, or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ extern int rexec_af (char **__restrict __ahost, int __rport, - __const char *__restrict __name, - __const char *__restrict __pass, - __const char *__restrict __cmd, int *__restrict __fd2p, + const char *__restrict __name, + const char *__restrict __pass, + const char *__restrict __cmd, int *__restrict __fd2p, sa_family_t __af); libc_hidden_proto(rexec_af) @@ -568,8 +568,8 @@ libc_hidden_proto(rexec_af) cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ -extern int ruserok (__const char *__rhost, int __suser, - __const char *__remuser, __const char *__locuser); +extern int ruserok (const char *__rhost, int __suser, + const char *__remuser, const char *__locuser); #if 0 /* FIXME */ @@ -580,8 +580,8 @@ extern int ruserok (__const char *__rhost, int __suser, cancellation point. But due to similarity with an POSIX interface or due to the implementation it is a cancellation point and therefore not marked with __THROW. */ -extern int ruserok_af (__const char *__rhost, int __suser, - __const char *__remuser, __const char *__locuser, +extern int ruserok_af (const char *__rhost, int __suser, + const char *__remuser, const char *__locuser, sa_family_t __af); #endif @@ -690,9 +690,9 @@ struct addrinfo This function is a possible cancellation point and therefore not marked with __THROW. */ -extern int getaddrinfo (__const char *__restrict __name, - __const char *__restrict __service, - __const struct addrinfo *__restrict __req, +extern int getaddrinfo (const char *__restrict __name, + const char *__restrict __service, + const struct addrinfo *__restrict __req, struct addrinfo **__restrict __pai); libc_hidden_proto(getaddrinfo) @@ -701,13 +701,13 @@ extern void freeaddrinfo (struct addrinfo *__ai) __THROW; libc_hidden_proto(freeaddrinfo) /* Convert error return from getaddrinfo() to a string. */ -extern __const char *gai_strerror (int __ecode) __THROW; +extern const char *gai_strerror (int __ecode) __THROW; /* Translate a socket address to a location and service name. This function is a possible cancellation point and therefore not marked with __THROW. */ -extern int getnameinfo (__const struct sockaddr *__restrict __sa, +extern int getnameinfo (const struct sockaddr *__restrict __sa, socklen_t __salen, char *__restrict __host, socklen_t __hostlen, char *__restrict __serv, socklen_t __servlen, unsigned int __flags); diff --git a/include/netinet/ether.h b/include/netinet/ether.h index 91fa12115..546282066 100644 --- a/include/netinet/ether.h +++ b/include/netinet/ether.h @@ -33,27 +33,27 @@ __BEGIN_DECLS #if defined __UCLIBC_HAS_SOCKET__ || defined __UCLIBC_HAS_IPV4__ || \ defined __UCLIBC_HAS_IPV6__ /* Convert 48 bit Ethernet ADDRess to ASCII. */ -extern char *ether_ntoa (__const struct ether_addr *__addr) __THROW; -extern char *ether_ntoa_r (__const struct ether_addr *__addr, char *__buf) +extern char *ether_ntoa (const struct ether_addr *__addr) __THROW; +extern char *ether_ntoa_r (const struct ether_addr *__addr, char *__buf) __THROW; libc_hidden_proto(ether_ntoa_r) /* Convert ASCII string S to 48 bit Ethernet address. */ -extern struct ether_addr *ether_aton (__const char *__asc) __THROW; -extern struct ether_addr *ether_aton_r (__const char *__asc, +extern struct ether_addr *ether_aton (const char *__asc) __THROW; +extern struct ether_addr *ether_aton_r (const char *__asc, struct ether_addr *__addr) __THROW; libc_hidden_proto(ether_aton_r) /* Map 48 bit Ethernet number ADDR to HOSTNAME. */ -extern int ether_ntohost (char *__hostname, __const struct ether_addr *__addr) +extern int ether_ntohost (char *__hostname, const struct ether_addr *__addr) __THROW; /* Map HOSTNAME to 48 bit Ethernet address. */ -extern int ether_hostton (__const char *__hostname, struct ether_addr *__addr) +extern int ether_hostton (const char *__hostname, struct ether_addr *__addr) __THROW; /* Scan LINE and set ADDR and HOSTNAME. */ -extern int ether_line (__const char *__line, struct ether_addr *__addr, +extern int ether_line (const char *__line, struct ether_addr *__addr, char *__hostname) __THROW; #endif diff --git a/include/netinet/in.h b/include/netinet/in.h index 41bbe0780..884d925c9 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -414,43 +414,43 @@ libc_hidden_proto(htons) #if defined __UCLIBC_HAS_IPV6__ || !defined __UCLIBC_STRICT_HEADERS__ #define IN6_IS_ADDR_UNSPECIFIED(a) \ - (((__const uint32_t *) (a))[0] == 0 \ - && ((__const uint32_t *) (a))[1] == 0 \ - && ((__const uint32_t *) (a))[2] == 0 \ - && ((__const uint32_t *) (a))[3] == 0) + (((const uint32_t *) (a))[0] == 0 \ + && ((const uint32_t *) (a))[1] == 0 \ + && ((const uint32_t *) (a))[2] == 0 \ + && ((const uint32_t *) (a))[3] == 0) #define IN6_IS_ADDR_LOOPBACK(a) \ - (((__const uint32_t *) (a))[0] == 0 \ - && ((__const uint32_t *) (a))[1] == 0 \ - && ((__const uint32_t *) (a))[2] == 0 \ - && ((__const uint32_t *) (a))[3] == htonl (1)) + (((const uint32_t *) (a))[0] == 0 \ + && ((const uint32_t *) (a))[1] == 0 \ + && ((const uint32_t *) (a))[2] == 0 \ + && ((const uint32_t *) (a))[3] == htonl (1)) -#define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff) +#define IN6_IS_ADDR_MULTICAST(a) (((const uint8_t *) (a))[0] == 0xff) #define IN6_IS_ADDR_LINKLOCAL(a) \ - ((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \ + ((((const uint32_t *) (a))[0] & htonl (0xffc00000)) \ == htonl (0xfe800000)) #define IN6_IS_ADDR_SITELOCAL(a) \ - ((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \ + ((((const uint32_t *) (a))[0] & htonl (0xffc00000)) \ == htonl (0xfec00000)) #define IN6_IS_ADDR_V4MAPPED(a) \ - ((((__const uint32_t *) (a))[0] == 0) \ - && (((__const uint32_t *) (a))[1] == 0) \ - && (((__const uint32_t *) (a))[2] == htonl (0xffff))) + ((((const uint32_t *) (a))[0] == 0) \ + && (((const uint32_t *) (a))[1] == 0) \ + && (((const uint32_t *) (a))[2] == htonl (0xffff))) #define IN6_IS_ADDR_V4COMPAT(a) \ - ((((__const uint32_t *) (a))[0] == 0) \ - && (((__const uint32_t *) (a))[1] == 0) \ - && (((__const uint32_t *) (a))[2] == 0) \ - && (ntohl (((__const uint32_t *) (a))[3]) > 1)) + ((((const uint32_t *) (a))[0] == 0) \ + && (((const uint32_t *) (a))[1] == 0) \ + && (((const uint32_t