summary refs log tree commit diff
path: root/misc
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2017-08-08 17:14:49 +0000
committerJoseph Myers <joseph@codesourcery.com>2017-08-08 17:14:49 +0000
commitf17a42333f2eb0bd7ef5194167dd52f9770a6680 (patch)
tree412b74849f8d26ddf201a572a4d1f7f644fe2198 /misc
parent0df595b23a829c9169ec418a19eef9006b4ae801 (diff)
downloadglibc-f17a42333f2eb0bd7ef5194167dd52f9770a6680.tar.gz
glibc-f17a42333f2eb0bd7ef5194167dd52f9770a6680.tar.xz
glibc-f17a42333f2eb0bd7ef5194167dd52f9770a6680.zip
Do not use __ptr_t.
sys/cdefs.h has a macro __ptr_t, which a few places in glibc use
instead of void *.  void * is a well-understood standard type for that
purpose and in a post-C89 context there is no need for a macro for it;
this patch changes those places to use void * directly instead.

Unlike __long_double_t, __ptr_t is widely used outside glibc (or at
least has many hits on codesearch.debian.net).  I don't know how many
of those uses would break if sys/cdefs.h ceased to define the macro,
but there's enough risk that this patch leaves the definition and just
removes the uses within glibc; removal of the definition can be
considered separately if desired.

Tested for x86_64, and with build-many-glibcs.py.

	* 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.
Diffstat (limited to 'misc')
-rw-r--r--misc/err.h2
-rw-r--r--misc/mmap.c4
-rw-r--r--misc/mmap64.c4
-rw-r--r--misc/mprotect.c2
-rw-r--r--misc/msync.c2
-rw-r--r--misc/munmap.c2
6 files changed, 8 insertions, 8 deletions
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 <stdarg.h>
 #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;