diff --git a/ChangeLog b/ChangeLog index 40d196f2b6..12d0a7d23e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,75 @@ +2017-08-08 Joseph Myers + + * malloc/mcheck.c (old_free_hook): Use void * instead of __ptr_t. + (old_malloc_hook): Likewise. + (old_memalign_hook): Likewise. + (old_realloc_hook): Likewise. + (struct hdr): Likewise. + (flood): Likewise. + (freehook): Likewise. + (mallochook): Likewise. + (memalignhook): Likewise. + (reallochook): Likewise. + (mprobe): Likewise. + * malloc/mtrace.c (mallwatch): Likewise. + (tr_old_free_hook): Likewise. + (tr_old_malloc_hook): Likewise. + (tr_old_realloc_hook): Likewise. + (tr_old_memalign_hook): Likewise. + (tr_where): Likewise. + (lock_and_info): Likewise. + (tr_freehook): Likewise. + (tr_mallochook): Likewise. + (tr_reallochook): Likewise. + (tr_memalignhook): Likewise. + * misc/err.h [!__GNUC_VA_LIST] (__gnuc_va_list): Likewise. + * misc/mmap.c (__mmap): Likewise. + * misc/mmap64.c (__mmap64): Likewise. + * misc/mprotect.c (__mprotect): Likewise. + * misc/msync.c (msync): Likewise. + * misc/munmap.c (__munmap): Likewise. + * posix/posix_madvise.c (posix_madvise): Likewise. + * socket/send.c (__send): Likewise. + * socket/sendto.c (__sendto): Likewise. + * socket/setsockopt.c (__setsockopt): Likewise. + * string/memcmp.c (__ptr_t): Remove macro. + (MEMCMP): Use void * instead of ptr_t. + * string/memrchr.c (__ptr_t): Remove macro. + (__memrchr): Use void * instead of ptr_t. + * sysdeps/mach/hurd/dl-sysdep.c (__mmap): Likewise. + * sysdeps/mach/hurd/mmap.c (__mmap): Likewise. + * sysdeps/mach/hurd/mmap64.c (__mmap64): Likewise. + * sysdeps/mach/mprotect.c (__mprotect): Likewise. + * sysdeps/mach/msync.c (msync): Likewise. + * sysdeps/mach/munmap.c (__munmap): Likewise. + * sysdeps/mips/bits/setjmp.h (struct __jmp_buf_internal_tag): + Likewise. + * sysdeps/posix/getcwd.c (__getcwd): Likewise. + * sysdeps/powerpc/powerpc32/memset.S (memset): Likewise. + * sysdeps/powerpc/powerpc32/power4/memcpy.S (memcpy): Likewise. + * sysdeps/powerpc/powerpc32/power4/memset.S (memset): Likewise. + * sysdeps/powerpc/powerpc32/power6/memcpy.S (memcpy): Likewise. + * sysdeps/powerpc/powerpc32/power6/memset.S (memset): Likewise. + * sysdeps/powerpc/powerpc32/power7/memcpy.S (memcpy): Likewise. + * sysdeps/powerpc/powerpc32/power7/mempcpy.S (__mempcpy): + Likewise. + * sysdeps/powerpc/powerpc32/power7/memset.S (memset): Likewise. + * sysdeps/powerpc/powerpc64/memcpy.S (memcpy): Likewise. + * sysdeps/powerpc/powerpc64/memset.S (memset): Likewise. + * sysdeps/powerpc/powerpc64/power4/memcpy.S (memcpy): Likewise. + * sysdeps/powerpc/powerpc64/power4/memset.S (memset): Likewise. + * sysdeps/powerpc/powerpc64/power6/memcpy.S (memcpy): Likewise. + * sysdeps/powerpc/powerpc64/power6/memset.S (memset): Likewise. + * sysdeps/powerpc/powerpc64/power7/memcpy.S (memcpy): Likewise. + * sysdeps/powerpc/powerpc64/power7/mempcpy.S (__mempcpy): + Likewise. + * sysdeps/powerpc/powerpc64/power7/memset.S (memset): Likewise. + * sysdeps/powerpc/powerpc64/power8/memset.S (memset): Likewise. + * sysdeps/tile/memcmp.c (__ptr_t): Remove macro. + (MEMCMP): Use void * instead of ptr_t. + * sysdeps/unix/sysv/linux/alpha/oldglob.c (old_glob_t): Likewise. + * sysdeps/unix/sysv/linux/mmap.c (__mmap): Likewise. + 2017-08-08 Florian Weimer * sysdeps/posix/getaddrinfo.c (gaih_inet): Remove unreachable diff --git a/malloc/mcheck.c b/malloc/mcheck.c index 5128d687fa..e195861c98 100644 --- a/malloc/mcheck.c +++ b/malloc/mcheck.c @@ -28,12 +28,12 @@ #endif /* Old hook values. */ -static void (*old_free_hook)(__ptr_t ptr, const __ptr_t); -static __ptr_t (*old_malloc_hook) (size_t size, const __ptr_t); -static __ptr_t (*old_memalign_hook) (size_t alignment, size_t size, - const __ptr_t); -static __ptr_t (*old_realloc_hook) (__ptr_t ptr, size_t size, - const __ptr_t); +static void (*old_free_hook)(void *ptr, const void *); +static void *(*old_malloc_hook) (size_t size, const void *); +static void *(*old_memalign_hook) (size_t alignment, size_t size, + const void *); +static void *(*old_realloc_hook) (void *ptr, size_t size, + const void *); /* Function to call when something awful happens. */ static void (*abortfunc) (enum mcheck_status); @@ -51,7 +51,7 @@ struct hdr unsigned long int magic; /* Magic number to check header integrity. */ struct hdr *prev; struct hdr *next; - __ptr_t block; /* Real block allocated, for memalign. */ + void *block; /* Real block allocated, for memalign. */ unsigned long int magic2; /* Extra, keeps us doubleword aligned. */ }; @@ -68,9 +68,9 @@ static int pedantic; # include # define flood memset #else -static void flood (__ptr_t, int, size_t); +static void flood (void *, int, size_t); static void -flood (__ptr_t ptr, int val, size_t size) +flood (void *ptr, int val, size_t size) { char *cp = ptr; while (size--) @@ -174,7 +174,7 @@ link_blk (struct hdr *hdr) } } static void -freehook (__ptr_t ptr, const __ptr_t caller) +freehook (void *ptr, const void *caller) { if (pedantic) mcheck_check_all (); @@ -197,8 +197,8 @@ freehook (__ptr_t ptr, const __ptr_t caller) __free_hook = freehook; } -static __ptr_t -mallochook (size_t size, const __ptr_t caller) +static void * +mallochook (size_t size, const void *caller) { struct hdr *hdr; @@ -226,13 +226,13 @@ mallochook (size_t size, const __ptr_t caller) hdr->block = hdr; hdr->magic2 = (uintptr_t) hdr ^ MAGICWORD; ((char *) &hdr[1])[size] = MAGICBYTE; - flood ((__ptr_t) (hdr + 1), MALLOCFLOOD, size); - return (__ptr_t) (hdr + 1); + flood ((void *) (hdr + 1), MALLOCFLOOD, size); + return (void *) (hdr + 1); } -static __ptr_t +static void * memalignhook (size_t alignment, size_t size, - const __ptr_t caller) + const void *caller) { struct hdr *hdr; size_t slop; @@ -262,15 +262,15 @@ memalignhook (size_t alignment, size_t size, hdr->size = size; link_blk (hdr); - hdr->block = (__ptr_t) block; + hdr->block = (void *) block; hdr->magic2 = (uintptr_t) block ^ MAGICWORD; ((char *) &hdr[1])[size] = MAGICBYTE; - flood ((__ptr_t) (hdr + 1), MALLOCFLOOD, size); - return (__ptr_t) (hdr + 1); + flood ((void *) (hdr + 1), MALLOCFLOOD, size); + return (void *) (hdr + 1); } -static __ptr_t -reallochook (__ptr_t ptr, size_t size, const __ptr_t caller) +static void * +reallochook (void *ptr, size_t size, const void *caller) { if (size == 0) { @@ -310,11 +310,11 @@ reallochook (__ptr_t ptr, size_t size, const __ptr_t caller) __memalign_hook = old_memalign_hook; __realloc_hook = old_realloc_hook; if (old_realloc_hook != NULL) - hdr = (struct hdr *) (*old_realloc_hook)((__ptr_t) hdr, + hdr = (struct hdr *) (*old_realloc_hook)((void *) hdr, sizeof (struct hdr) + size + 1, caller); else - hdr = (struct hdr *) realloc ((__ptr_t) hdr, + hdr = (struct hdr *) realloc ((void *) hdr, sizeof (struct hdr) + size + 1); __free_hook = freehook; __malloc_hook = mallochook; @@ -330,7 +330,7 @@ reallochook (__ptr_t ptr, size_t size, const __ptr_t caller) ((char *) &hdr[1])[size] = MAGICBYTE; if (size > osize) flood ((char *) (hdr + 1) + osize, MALLOCFLOOD, size - osize); - return (__ptr_t) (hdr + 1); + return (void *) (hdr + 1); } __attribute__ ((noreturn)) @@ -410,7 +410,7 @@ mcheck_pedantic (void (*func) (enum mcheck_status)) } enum mcheck_status -mprobe (__ptr_t ptr) +mprobe (void *ptr) { return mcheck_used ? checkhdr (((struct hdr *) ptr) - 1) : MCHECK_DISABLED; } diff --git a/malloc/mtrace.c b/malloc/mtrace.c index 02c53eb9fe..d6eb49757b 100644 --- a/malloc/mtrace.c +++ b/malloc/mtrace.c @@ -50,15 +50,15 @@ static char *malloc_trace_buffer; __libc_lock_define_initialized (static, lock); /* Address to breakpoint on accesses to... */ -__ptr_t mallwatch; +void *mallwatch; /* Old hook values. */ -static void (*tr_old_free_hook) (__ptr_t ptr, const __ptr_t); -static __ptr_t (*tr_old_malloc_hook) (size_t size, const __ptr_t); -static __ptr_t (*tr_old_realloc_hook) (__ptr_t ptr, size_t size, - const __ptr_t); -static __ptr_t (*tr_old_memalign_hook) (size_t __alignment, size_t __size, - const __ptr_t); +static void (*tr_old_free_hook) (void *ptr, const void *); +static void *(*tr_old_malloc_hook) (size_t size, const void *); +static void *(*tr_old_realloc_hook) (void *ptr, size_t size, + const void *); +static void *(*tr_old_memalign_hook) (size_t __alignment, size_t __size, + const void *); /* This function is called when the block being alloc'd, realloc'd, or freed has an address matching the variable "mallwatch". In a debugger, @@ -74,7 +74,7 @@ tr_break (void) libc_hidden_def (tr_break) static void internal_function -tr_where (const __ptr_t caller, Dl_info *info) +tr_where (const void *caller, Dl_info *info) { if (caller != NULL) { @@ -87,12 +87,12 @@ tr_where (const __ptr_t caller, Dl_info *info) buf = alloca (len + 6 + 2 * sizeof (void *)); buf[0] = '('; - __stpcpy (_fitoa (caller >= (const __ptr_t) info->dli_saddr - ? caller - (const __ptr_t) info->dli_saddr - : (const __ptr_t) info->dli_saddr - caller, + __stpcpy (_fitoa (caller >= (const void *) info->dli_saddr + ? caller - (const void *) info->dli_saddr + : (const void *) info->dli_saddr - caller, __stpcpy (__mempcpy (buf + 1, info->dli_sname, len), - caller >= (__ptr_t) info->dli_saddr + caller >= (void *) info->dli_saddr ? "+0x" : "-0x"), 16, 0), ")"); @@ -108,7 +108,7 @@ tr_where (const __ptr_t caller, Dl_info *info) } static Dl_info * -lock_and_info (const __ptr_t caller, Dl_info *mem) +lock_and_info (const void *caller, Dl_info *mem) { if (caller == NULL) return NULL; @@ -121,7 +121,7 @@ lock_and_info (const __ptr_t caller, Dl_info *mem) } static void -tr_freehook (__ptr_t ptr, const __ptr_t caller) +tr_freehook (void *ptr, const void *caller) { if (ptr == NULL) return; @@ -146,19 +146,19 @@ tr_freehook (__ptr_t ptr, const __ptr_t caller) __libc_lock_unlock (lock); } -static __ptr_t -tr_mallochook (size_t size, const __ptr_t caller) +static void * +tr_mallochook (size_t size, const void *caller) { - __ptr_t hdr; + void *hdr; Dl_info mem; Dl_info *info = lock_and_info (caller, &mem); __malloc_hook = tr_old_malloc_hook; if (tr_old_malloc_hook != NULL) - hdr = (__ptr_t) (*tr_old_malloc_hook)(size, caller); + hdr = (void *) (*tr_old_malloc_hook)(size, caller); else - hdr = (__ptr_t) malloc (size); + hdr = (void *) malloc (size); __malloc_hook = tr_mallochook; tr_where (caller, info); @@ -173,10 +173,10 @@ tr_mallochook (size_t size, const __ptr_t caller) return hdr; } -static __ptr_t -tr_reallochook (__ptr_t ptr, size_t size, const __ptr_t caller) +static void * +tr_reallochook (void *ptr, size_t size, const void *caller) { - __ptr_t hdr; + void *hdr; if (ptr == mallwatch) tr_break (); @@ -188,9 +188,9 @@ tr_reallochook (__ptr_t ptr, size_t size, const __ptr_t caller) __malloc_hook = tr_old_malloc_hook; __realloc_hook = tr_old_realloc_hook; if (tr_old_realloc_hook != NULL) - hdr = (__ptr_t) (*tr_old_realloc_hook)(ptr, size, caller); + hdr = (void *) (*tr_old_realloc_hook)(ptr, size, caller); else - hdr = (__ptr_t) realloc (ptr, size); + hdr = (void *) realloc (ptr, size); __free_hook = tr_freehook; __malloc_hook = tr_mallochook; __realloc_hook = tr_reallochook; @@ -221,10 +221,10 @@ tr_reallochook (__ptr_t ptr, size_t size, const __ptr_t caller) return hdr; } -static __ptr_t -tr_memalignhook (size_t alignment, size_t size, const __ptr_t caller) +static void * +tr_memalignhook (size_t alignment, size_t size, const void *caller) { - __ptr_t hdr; + void *hdr; Dl_info mem; Dl_info *info = lock_and_info (caller, &mem); @@ -232,9 +232,9 @@ tr_memalignhook (size_t alignment, size_t size, const __ptr_t caller) __memalign_hook = tr_old_memalign_hook; __malloc_hook = tr_old_malloc_hook; if (tr_old_memalign_hook != NULL) - hdr = (__ptr_t) (*tr_old_memalign_hook)(alignment, size, caller); + hdr = (void *) (*tr_old_memalign_hook)(alignment, size, caller); else - hdr = (__ptr_t) memalign (alignment, size); + hdr = (void *) memalign (alignment, size); __memalign_hook = tr_memalignhook; __malloc_hook = tr_mallochook; diff --git a/misc/err.h b/misc/err.h index d893a25eac..ea12845e98 100644 --- a/misc/err.h +++ b/misc/err.h @@ -24,7 +24,7 @@ #define __need___va_list #include #ifndef __GNUC_VA_LIST -# define __gnuc_va_list __ptr_t +# define __gnuc_va_list void * #endif __BEGIN_DECLS diff --git a/misc/mmap.c b/misc/mmap.c index 4172d76ef6..2c4ed3e93c 100644 --- a/misc/mmap.c +++ b/misc/mmap.c @@ -28,8 +28,8 @@ for errors (in which case `errno' is set). A successful `mmap' call deallocates any previous mapping for the affected region. */ -__ptr_t -__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) +void * +__mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset) { __set_errno (ENOSYS); return MAP_FAILED; diff --git a/misc/mmap64.c b/misc/mmap64.c index 845b847587..ccd286431f 100644 --- a/misc/mmap64.c +++ b/misc/mmap64.c @@ -28,8 +28,8 @@ for errors (in which case `errno' is set). A successful `mmap' call deallocates any previous mapping for the affected region. */ -__ptr_t -__mmap64 (__ptr_t addr, size_t len, int prot, int flags, int fd, +void * +__mmap64 (void *addr, size_t len, int prot, int flags, int fd, __off64_t offset) { off_t small_offset = (off_t) offset; diff --git a/misc/mprotect.c b/misc/mprotect.c index 271106426c..91611239c2 100644 --- a/misc/mprotect.c +++ b/misc/mprotect.c @@ -24,7 +24,7 @@ (and sets errno). */ int -__mprotect (__ptr_t addr, size_t len, int prot) +__mprotect (void *addr, size_t len, int prot) { __set_errno (ENOSYS); return -1; diff --git a/misc/msync.c b/misc/msync.c index 361185e83d..4f79c0215e 100644 --- a/misc/msync.c +++ b/misc/msync.c @@ -24,7 +24,7 @@ unpredictable before this is done. */ int -msync (__ptr_t addr, size_t len, int flags) +msync (void *addr, size_t len, int flags) { __set_errno (ENOSYS); return -1; diff --git a/misc/munmap.c b/misc/munmap.c index b3ba789d3b..525c8d7cb9 100644 --- a/misc/munmap.c +++ b/misc/munmap.c @@ -23,7 +23,7 @@ bytes. Returns 0 if successful, -1 for errors (and sets errno). */ int -__munmap (__ptr_t addr, size_t len) +__munmap (void *addr, size_t len) { __set_errno (ENOSYS); return -1; diff --git a/posix/posix_madvise.c b/posix/posix_madvise.c index 19f2bad4dd..e289ecbfd5 100644 --- a/posix/posix_madvise.c +++ b/posix/posix_madvise.c @@ -23,7 +23,7 @@ for the region starting at ADDR and extending LEN bytes. */ int -posix_madvise (__ptr_t addr, size_t len, int advice) +posix_madvise (void *addr, size_t len, int advice) { return ENOSYS; } diff --git a/socket/send.c b/socket/send.c index 7217ab8138..f6c7c2514b 100644 --- a/socket/send.c +++ b/socket/send.c @@ -20,7 +20,7 @@ /* Send N bytes of BUF to socket FD. Returns the number sent or -1. */ ssize_t -__send (int fd, const __ptr_t buf, size_t n, int flags) +__send (int fd, const void *buf, size_t n, int flags) { __set_errno (ENOSYS); return -1; diff --git a/socket/sendto.c b/socket/sendto.c index 9db72147f0..c7641d5d1c 100644 --- a/socket/sendto.c +++ b/socket/sendto.c @@ -21,7 +21,7 @@ /* Send N bytes of BUF on socket FD to peer at address ADDR (which is ADDR_LEN bytes long). Returns the number sent, or -1 for errors. */ ssize_t -__sendto (int fd, const __ptr_t buf, size_t n, int flags, +__sendto (int fd, const void *buf, size_t n, int flags, __CONST_SOCKADDR_ARG addr, socklen_t addr_len) { __set_errno (ENOSYS); diff --git a/socket/setsockopt.c b/socket/setsockopt.c index 4b09bead2e..346dfa75f4 100644 --- a/socket/setsockopt.c +++ b/socket/setsockopt.c @@ -22,7 +22,7 @@ to *OPTVAL (which is OPTLEN bytes long). Returns 0 on success, -1 for errors. */ int -__setsockopt (int fd, int level, int optname, const __ptr_t optval, +__setsockopt (int fd, int level, int optname, const void *optval, socklen_t optlen) { __set_errno (ENOSYS); diff --git a/string/memcmp.c b/string/memcmp.c index c53ab3185d..abd4f24fe4 100644 --- a/string/memcmp.c +++ b/string/memcmp.c @@ -20,9 +20,6 @@ # include "config.h" #endif -#undef __ptr_t -#define __ptr_t void * - #if defined HAVE_STRING_H || defined _LIBC # include #endif @@ -301,7 +298,7 @@ memcmp_not_common_alignment (long int srcp1, long int srcp2, size_t len) } int -MEMCMP (const __ptr_t s1, const __ptr_t s2, size_t len) +MEMCMP (const void *s1, const void *s2, size_t len) { op_t a0; op_t b0; diff --git a/string/memrchr.c b/string/memrchr.c index 0ecfe08842..f9e49a4b7f 100644 --- a/string/memrchr.c +++ b/string/memrchr.c @@ -27,9 +27,6 @@ # include #endif -#undef __ptr_t -#define __ptr_t void * - #if defined _LIBC # include # include @@ -55,13 +52,13 @@ #endif /* Search no more than N bytes of S for C. */ -__ptr_t +void * #ifndef MEMRCHR __memrchr #else MEMRCHR #endif - (const __ptr_t s, int c_in, size_t n) + (const void *s, int c_in, size_t n) { const unsigned char *char_ptr; const unsigned long int *longword_ptr; @@ -77,7 +74,7 @@ MEMRCHR & (sizeof (longword) - 1)) != 0; --n) if (*--char_ptr == c) - return (__ptr_t) char_ptr; + return (void *) char_ptr; /* All these elucidatory comments refer to 4-byte longwords, but the theory applies equally well to 8-byte longwords. */ @@ -162,22 +159,22 @@ MEMRCHR #if LONG_MAX > 2147483647 if (cp[7] == c) - return (__ptr_t) &cp[7]; + return (void *) &cp[7]; if (cp[6] == c) - return (__ptr_t) &cp[6]; + return (void *) &cp[6]; if (cp[5] == c) - return (__ptr_t) &cp[5]; + return (void *) &cp[5]; if (cp[4] == c) - return (__ptr_t) &cp[4]; + return (void *) &cp[4]; #endif if (cp[3] == c) - return (__ptr_t) &cp[3]; + return (void *) &cp[3]; if (cp[2] == c) - return (__ptr_t) &cp[2]; + return (void *) &cp[2]; if (cp[1] == c) - return (__ptr_t) &cp[1]; + return (void *) &cp[1]; if (cp[0] == c) - return (__ptr_t) cp; + return (void *) cp; } n -= sizeof (longword); @@ -188,7 +185,7 @@ MEMRCHR while (n-- > 0) { if (*--char_ptr == c) - return (__ptr_t) char_ptr; + return (void *) char_ptr; } return 0; diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index 4f274b4d65..3794aed521 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -453,8 +453,8 @@ __libc_lseek64 (int fd, off64_t offset, int whence) return offset; } -__ptr_t weak_function -__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) +void *weak_function +__mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset) { error_t err; vm_prot_t vmprot; @@ -512,7 +512,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) if (err) return __hurd_fail (err), MAP_FAILED; - return (__ptr_t) mapaddr; + return (void *) mapaddr; } int weak_function diff --git a/sysdeps/mach/hurd/mmap.c b/sysdeps/mach/hurd/mmap.c index dbd718a688..72706c3332 100644 --- a/sysdeps/mach/hurd/mmap.c +++ b/sysdeps/mach/hurd/mmap.c @@ -26,12 +26,12 @@ is nonzero, it is the desired mapping address. If the MAP_FIXED bit is set in FLAGS, the mapping will be at ADDR exactly (which must be page-aligned); otherwise the system chooses a convenient nearby address. - The return value is the actual mapping address chosen or (__ptr_t) -1 + The return value is the actual mapping address chosen or (void *) -1 for errors (in which case `errno' is set). A successful `mmap' call deallocates any previous mapping for the affected region. */ -__ptr_t -__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) +void * +__mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset) { error_t err; vm_prot_t vmprot; @@ -42,7 +42,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) /* ADDR and OFFSET must be page-aligned. */ if ((mapaddr & (__vm_page_size - 1)) || (offset & (__vm_page_size - 1))) - return (__ptr_t) (long int) __hurd_fail (EINVAL); + return (void *) (long int) __hurd_fail (EINVAL); if ((flags & (MAP_TYPE|MAP_INHERIT)) == MAP_ANON && prot == (PROT_READ|PROT_WRITE)) /* cf VM_PROT_DEFAULT */ @@ -64,7 +64,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) err = __vm_allocate (__mach_task_self (), &mapaddr, len, 1); } - return err ? (__ptr_t) (long int) __hurd_fail (err) : (__ptr_t) mapaddr; + return err ? (void *) (long int) __hurd_fail (err) : (void *) mapaddr; } vmprot = VM_PROT_NONE; @@ -78,7 +78,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) switch (flags & MAP_TYPE) { default: - return (__ptr_t) (long int) __hurd_fail (EINVAL); + return (void *) (long int) __hurd_fail (EINVAL); case MAP_ANON: memobj = MACH_PORT_NULL; @@ -92,7 +92,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) { if (err == MIG_BAD_ID || err == EOPNOTSUPP || err == ENOSYS) err = ENODEV; /* File descriptor doesn't support mmap. */ - return (__ptr_t) (long int) __hurd_dfail (fd, err); + return (void *) (long int) __hurd_dfail (fd, err); } switch (prot & (PROT_READ|PROT_WRITE)) { @@ -129,7 +129,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) else { __mach_port_deallocate (__mach_task_self (), wobj); - return (__ptr_t) (long int) __hurd_fail (EACCES); + return (void *) (long int) __hurd_fail (EACCES); } break; default: @@ -180,9 +180,9 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) __mach_port_deallocate (__mach_task_self (), memobj); if (err) - return (__ptr_t) (long int) __hurd_fail (err); + return (void *) (long int) __hurd_fail (err); - return (__ptr_t) mapaddr; + return (void *) mapaddr; } weak_alias (__mmap, mmap) diff --git a/sysdeps/mach/hurd/mmap64.c b/sysdeps/mach/hurd/mmap64.c index ced469db18..282b7525c8 100644 --- a/sysdeps/mach/hurd/mmap64.c +++ b/sysdeps/mach/hurd/mmap64.c @@ -28,8 +28,8 @@ for errors (in which case `errno' is set). A successful `mmap' call deallocates any previous mapping for the affected region. */ -__ptr_t -__mmap64 (__ptr_t addr, size_t len, int prot, int flags, int fd, +void * +__mmap64 (void *addr, size_t len, int prot, int flags, int fd, __off64_t offset) { vm_offset_t small_offset = (vm_offset_t) offset; diff --git a/sysdeps/mach/mprotect.c b/sysdeps/mach/mprotect.c index 477017da39..84a72850ac 100644 --- a/sysdeps/mach/mprotect.c +++ b/sysdeps/mach/mprotect.c @@ -25,7 +25,7 @@ (and sets errno). */ int -__mprotect (__ptr_t addr, size_t len, int prot) +__mprotect (void *addr, size_t len, int prot) { kern_return_t err; vm_prot_t vmprot; diff --git a/sysdeps/mach/msync.c b/sysdeps/mach/msync.c index f84553269e..b908fed141 100644 --- a/sysdeps/mach/msync.c +++ b/sysdeps/mach/msync.c @@ -33,7 +33,7 @@ unpredictable before this is done. */ int -msync (__ptr_t addr, size_t len, int flags) +msync (void *addr, size_t len, int flags) { vm_sync_t sync_flags = 0; kern_return_t err; diff --git a/sysdeps/mach/munmap.c b/sysdeps/mach/munmap.c index b5fdaeaf1b..4a98613baf 100644 --- a/sysdeps/mach/munmap.c +++ b/sysdeps/mach/munmap.c @@ -24,7 +24,7 @@ bytes. Returns 0 if successful, -1 for errors (and sets errno). */ int -__munmap (__ptr_t addr, size_t len) +__munmap (void *addr, size_t len) { kern_return_t err; diff --git a/sysdeps/mips/bits/setjmp.h b/sysdeps/mips/bits/setjmp.h index 91c64505f4..0b9643748c 100644 --- a/sysdeps/mips/bits/setjmp.h +++ b/sysdeps/mips/bits/setjmp.h @@ -29,19 +29,19 @@ typedef struct __jmp_buf_internal_tag { #if _MIPS_SIM == _ABIO32 /* Program counter. */ - __ptr_t __pc; + void *__pc; /* Stack pointer. */ - __ptr_t __sp; + void *__sp; /* Callee-saved registers s0 through s7. */ int __regs[8]; /* The frame pointer. */ - __ptr_t __fp; + void *__fp; /* The global pointer. */ - __ptr_t __gp; + void *__gp; #else /* Program counter. */ __extension__ long long __pc; diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c index eb1706aa5c..75bcfd23cf 100644 --- a/sysdeps/posix/getcwd.c +++ b/sysdeps/posix/getcwd.c @@ -318,7 +318,7 @@ __getcwd (char *buf, size_t size) } else { - new = realloc ((__ptr_t) dotlist, dotsize * 2 + 1); + new = realloc ((void *) dotlist, dotsize * 2 + 1); if (new == NULL) goto lose; dotp = &new[dotsize]; @@ -492,7 +492,7 @@ __getcwd (char *buf, size_t size) #ifndef __ASSUME_ATFCTS if (dotlist != dots) - free ((__ptr_t) dotlist); + free ((void *) dotlist); #endif size_t used = path + allocated - pathp; @@ -516,7 +516,7 @@ __getcwd (char *buf, size_t size) int save_errno = errno; #ifndef __ASSUME_ATFCTS if (dotlist != dots) - free ((__ptr_t) dotlist); + free ((void *) dotlist); #endif if (dirstream != NULL) __closedir (dirstream); diff --git a/sysdeps/powerpc/powerpc32/memset.S b/sysdeps/powerpc/powerpc32/memset.S index 8913a02698..be20bb63a0 100644 --- a/sysdeps/powerpc/powerpc32/memset.S +++ b/sysdeps/powerpc/powerpc32/memset.S @@ -18,7 +18,7 @@ #include -/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5])); +/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5])); Returns 's'. The memset is done in four sizes: byte (8 bits), word (32 bits), diff --git a/sysdeps/powerpc/powerpc32/power4/memcpy.S b/sysdeps/powerpc/powerpc32/power4/memcpy.S index 37bc712dd9..886b83c37f 100644 --- a/sysdeps/powerpc/powerpc32/power4/memcpy.S +++ b/sysdeps/powerpc/powerpc32/power4/memcpy.S @@ -18,7 +18,7 @@ #include -/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]); +/* void * [r3] memcpy (void *dst [r3], void *src [r4], size_t len [r5]); Returns 'dst'. Memcpy handles short copies (< 32-bytes) using a binary move blocks diff --git a/sysdeps/powerpc/powerpc32/power4/memset.S b/sysdeps/powerpc/powerpc32/power4/memset.S index 25319f7233..62cd33fc25 100644 --- a/sysdeps/powerpc/powerpc32/power4/memset.S +++ b/sysdeps/powerpc/powerpc32/power4/memset.S @@ -18,7 +18,7 @@ #include -/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5])); +/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5])); Returns 's'. The memset is done in three sizes: byte (8 bits), word (32 bits), diff --git a/sysdeps/powerpc/powerpc32/power6/memcpy.S b/sysdeps/powerpc/powerpc32/power6/memcpy.S index 81b62cba21..0bf4d3feb4 100644 --- a/sysdeps/powerpc/powerpc32/power6/memcpy.S +++ b/sysdeps/powerpc/powerpc32/power6/memcpy.S @@ -18,7 +18,7 @@ #include -/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]); +/* void * [r3] memcpy (void *dst [r3], void *src [r4], size_t len [r5]); Returns 'dst'. Memcpy handles short copies (< 32-bytes) using a binary move blocks diff --git a/sysdeps/powerpc/powerpc32/power6/memset.S b/sysdeps/powerpc/powerpc32/power6/memset.S index f221c32d2f..8d17491ff2 100644 --- a/sysdeps/powerpc/powerpc32/power6/memset.S +++ b/sysdeps/powerpc/powerpc32/power6/memset.S @@ -18,7 +18,7 @@ #include -/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5])); +/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5])); Returns 's'. The memset is done in three sizes: byte (8 bits), word (32 bits), diff --git a/sysdeps/powerpc/powerpc32/power7/memcpy.S b/sysdeps/powerpc/powerpc32/power7/memcpy.S index 8e33c1d733..7332b72717 100644 --- a/sysdeps/powerpc/powerpc32/power7/memcpy.S +++ b/sysdeps/powerpc/powerpc32/power7/memcpy.S @@ -19,7 +19,7 @@ #include -/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]); +/* void * [r3] memcpy (void *dst [r3], void *src [r4], size_t len [r5]); Returns 'dst'. */ .machine power7 diff --git a/sysdeps/powerpc/powerpc32/power7/mempcpy.S b/sysdeps/powerpc/powerpc32/power7/mempcpy.S index 1682fbcd2a..10714c9057 100644 --- a/sysdeps/powerpc/powerpc32/power7/mempcpy.S +++ b/sysdeps/powerpc/powerpc32/power7/mempcpy.S @@ -19,7 +19,7 @@ #include -/* __ptr_t [r3] __mempcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]); +/* void * [r3] __mempcpy (void *dst [r3], void *src [r4], size_t len [r5]); Returns 'dst' + 'len'. */ .machine power7 diff --git a/sysdeps/powerpc/powerpc32/power7/memset.S b/sysdeps/powerpc/powerpc32/power7/memset.S index b431f5086d..520b9ce06a 100644 --- a/sysdeps/powerpc/powerpc32/power7/memset.S +++ b/sysdeps/powerpc/powerpc32/power7/memset.S @@ -19,7 +19,7 @@ #include -/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5])); +/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5])); Returns 's'. */ .machine power7 diff --git a/sysdeps/powerpc/powerpc64/memcpy.S b/sysdeps/powerpc/powerpc64/memcpy.S index b6a11055d8..ba80908c6c 100644 --- a/sysdeps/powerpc/powerpc64/memcpy.S +++ b/sysdeps/powerpc/powerpc64/memcpy.S @@ -18,7 +18,7 @@ #include -/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]); +/* void * [r3] memcpy (void *dst [r3], void *src [r4], size_t len [r5]); Returns 'dst'. Memcpy handles short copies (< 32-bytes) using a binary move blocks diff --git a/sysdeps/powerpc/powerpc64/memset.S b/sysdeps/powerpc/powerpc64/memset.S index 34db4d7041..ae4ffb1299 100644 --- a/sysdeps/powerpc/powerpc64/memset.S +++ b/sysdeps/powerpc/powerpc64/memset.S @@ -24,7 +24,7 @@ .section ".text" .align 2 -/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5])); +/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5])); Returns 's'. The memset is done in three sizes: byte (8 bits), word (32 bits), diff --git a/sysdeps/powerpc/powerpc64/power4/memcpy.S b/sysdeps/powerpc/powerpc64/power4/memcpy.S index 4bec39ce86..26577ba351 100644 --- a/sysdeps/powerpc/powerpc64/power4/memcpy.S +++ b/sysdeps/powerpc/powerpc64/power4/memcpy.S @@ -18,7 +18,7 @@ #include -/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]); +/* void * [r3] memcpy (void *dst [r3], void *src [r4], size_t len [r5]); Returns 'dst'. Memcpy handles short copies (< 32-bytes) using a binary move blocks diff --git a/sysdeps/powerpc/powerpc64/power4/memset.S b/sysdeps/powerpc/powerpc64/power4/memset.S index 0aafce785b..c44f3de629 100644 --- a/sysdeps/powerpc/powerpc64/power4/memset.S +++ b/sysdeps/powerpc/powerpc64/power4/memset.S @@ -18,7 +18,7 @@ #include -/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5])); +/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5])); Returns 's'. The memset is done in three sizes: byte (8 bits), word (32 bits), diff --git a/sysdeps/powerpc/powerpc64/power6/memcpy.S b/sysdeps/powerpc/powerpc64/power6/memcpy.S index ac177ca4b7..342bac6c39 100644 --- a/sysdeps/powerpc/powerpc64/power6/memcpy.S +++ b/sysdeps/powerpc/powerpc64/power6/memcpy.S @@ -18,7 +18,7 @@ #include -/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]); +/* void * [r3] memcpy (void *dst [r3], void *src [r4], size_t len [r5]); Returns 'dst'. Memcpy handles short copies (< 32-bytes) using a binary move blocks diff --git a/sysdeps/powerpc/powerpc64/power6/memset.S b/sysdeps/powerpc/powerpc64/power6/memset.S index 8bbb8c4cb1..37c3f2fba1 100644 --- a/sysdeps/powerpc/powerpc64/power6/memset.S +++ b/sysdeps/powerpc/powerpc64/power6/memset.S @@ -18,7 +18,7 @@ #include -/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5])); +/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5])); Returns 's'. The memset is done in three sizes: byte (8 bits), word (32 bits), diff --git a/sysdeps/powerpc/powerpc64/power7/memcpy.S b/sysdeps/powerpc/powerpc64/power7/memcpy.S index 641c7e2118..1ccbc2e153 100644 --- a/sysdeps/powerpc/powerpc64/power7/memcpy.S +++ b/sysdeps/powerpc/powerpc64/power7/memcpy.S @@ -20,7 +20,7 @@ #include -/* __ptr_t [r3] memcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]); +/* void * [r3] memcpy (void *dst [r3], void *src [r4], size_t len [r5]); Returns 'dst'. */ #ifndef MEMCPY diff --git a/sysdeps/powerpc/powerpc64/power7/mempcpy.S b/sysdeps/powerpc/powerpc64/power7/mempcpy.S index 904fac5d1c..1883907ad3 100644 --- a/sysdeps/powerpc/powerpc64/power7/mempcpy.S +++ b/sysdeps/powerpc/powerpc64/power7/mempcpy.S @@ -20,7 +20,7 @@ #include -/* __ptr_t [r3] __mempcpy (__ptr_t dst [r3], __ptr_t src [r4], size_t len [r5]); +/* void * [r3] __mempcpy (void *dst [r3], void *src [r4], size_t len [r5]); Returns 'dst' + 'len'. */ #ifndef MEMPCPY diff --git a/sysdeps/powerpc/powerpc64/power7/memset.S b/sysdeps/powerpc/powerpc64/power7/memset.S index f2e2fa1b37..c90ae243f4 100644 --- a/sysdeps/powerpc/powerpc64/power7/memset.S +++ b/sysdeps/powerpc/powerpc64/power7/memset.S @@ -19,7 +19,7 @@ #include -/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5])); +/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5])); Returns 's'. */ #ifndef MEMSET diff --git a/sysdeps/powerpc/powerpc64/power8/memset.S b/sysdeps/powerpc/powerpc64/power8/memset.S index 7ad3bb1b00..369b95894a 100644 --- a/sysdeps/powerpc/powerpc64/power8/memset.S +++ b/sysdeps/powerpc/powerpc64/power8/memset.S @@ -20,7 +20,7 @@ #define MTVSRD_V1_R4 .long 0x7c240166 /* mtvsrd v1,r4 */ -/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5])); +/* void * [r3] memset (void *s [r3], int c [r4], size_t n [r5])); Returns 's'. */ #ifndef MEMSET diff --git a/sysdeps/tile/memcmp.c b/sysdeps/tile/memcmp.c index 83c62be059..c3ed88bca7 100644 --- a/sysdeps/tile/memcmp.c +++ b/sysdeps/tile/memcmp.c @@ -19,9 +19,6 @@ # include "config.h" #endif -#undef __ptr_t -#define __ptr_t void * - #if defined HAVE_STRING_H || defined _LIBC # include #endif @@ -294,7 +291,7 @@ memcmp_not_common_alignment (long int srcp1, long int srcp2, size_t len) } int -MEMCMP (const __ptr_t s1, const __ptr_t s2, size_t len) +MEMCMP (const void *s1, const void *s2, size_t len) { op_t a0; op_t b0; diff --git a/sysdeps/unix/sysv/linux/alpha/oldglob.c b/sysdeps/unix/sysv/linux/alpha/oldglob.c index edd6d47ba9..988c92ba45 100644 --- a/sysdeps/unix/sysv/linux/alpha/oldglob.c +++ b/sysdeps/unix/sysv/linux/alpha/oldglob.c @@ -36,7 +36,7 @@ typedef struct are used instead of the normal file access functions. */ void (*gl_closedir) (void *); struct dirent *(*gl_readdir) (void *); - __ptr_t (*gl_opendir) (const char *); + void *(*gl_opendir) (const char *); int (*gl_lstat) (const char *, struct stat *); int (*gl_stat) (const char *, struct stat *); } old_glob_t; diff --git a/sysdeps/unix/sysv/linux/mmap.c b/sysdeps/unix/sysv/linux/mmap.c index 98c2f88eb8..2024bee001 100644 --- a/sysdeps/unix/sysv/linux/mmap.c +++ b/sysdeps/unix/sysv/linux/mmap.c @@ -36,7 +36,7 @@ __mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset) MMAP_CHECK_PAGE_UNIT (); if (offset & MMAP_OFF_LOW_MASK) - return (__ptr_t) INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); + return (void *) INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); #ifdef __NR_mmap2 return (void *) MMAP_CALL (mmap2, addr, len, prot, flags, fd,