about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2019-03-09 18:01:48 -0500
committerZack Weinberg <zackw@panix.com>2020-01-08 12:56:32 -0500
commit23432307d4e17872f5573df4413f5b1efa0cab6d (patch)
tree13e56484dd269eb341a40eb60da64621e3569973 /sysdeps/unix/sysv/linux
parent9bdd08229bbba415fe9c8e8bb65016adee392412 (diff)
downloadglibc-23432307d4e17872f5573df4413f5b1efa0cab6d.tar.gz
glibc-23432307d4e17872f5573df4413f5b1efa0cab6d.tar.xz
glibc-23432307d4e17872f5573df4413f5b1efa0cab6d.zip
Clean up bits/types.h.
This makes four linked changes to bits/types.h.  First, we use
__(u)?int(16|32|64)_t to define __[SU](16|32|64)_TYPE.  In addition
to reducing the amount of ifdeffage, this means __STD_TYPE is no longer
necessary, since gcc -std=c89 will complain about ‘typedef long long foo_t’
but not ‘typedef __int64_t foo_t’, even if the underlying type
of __int64_t is long long.

Second, we eliminate __UQUAD_TYPE and __SQUAD_TYPE from the set of
macros bits/typesizes.h should use to define __FOO_T_TYPE macros,
since they are always the same as __U64_TYPE and __S64_TYPE
respectively.

Third, we remove __u_char, __u_short, __u_int, __u_long, __u_quad_t,
and __quad_t, we add __uintptr_t, and we define __intmax_t and
__uintmax_t as __int64_t and __uint64_t.

Fourth, we reorganize the list of typedefs into groups by the
standard (if any) that defines them, and sort them alphabetically within
each group.

	* posix/bits/types.h: Move #error for __WORDSIZE neither 32 nor 64
	to first group of conditionals on __WORDSIZE, and make it more
	explicit.  Update commentary.  Define all __foo_t types with
	regular ‘typedef’.  Reorganize all __foo_t types into the same
	groups that sys/types.h uses.
	(__u_char, __u_short, __u_int, __u_long, __quad_t, __u_quad_t)
	(__UQUAD_TYPE, __SQUAD_TYPE, __STD_TYPE): Don’t define.
	(__S16_TYPE): Define unconditionally as __int16_t.
	(__U16_TYPE): Define unconditionally as __uint16_t.
	(__S32_TYPE): Define unconditionally as __int32_t.
	(__U32_TYPE): Define unconditionally as __uint32_t.
	(__S64_TYPE): Define unconditionally as __int64_t.
	(__U64_TYPE): Define unconditionally as __uint64_t.
	(__intmax_t): Define unconditionally as __int64_t.
	(__uintmax_t): Define unconditionally as __uint64_t.
        (__uintptr_t): New typedef.

	* bits/time64.h
	* bits/typesizes.h
	* sysdeps/mach/hurd/bits/typesizes.h
	* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
	* sysdeps/unix/sysv/linux/generic/bits/typesizes.h
	* sysdeps/unix/sysv/linux/mips/bits/typesizes.h
	* sysdeps/unix/sysv/linux/s390/bits/typesizes.h
	* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
	* sysdeps/unix/sysv/linux/x86/bits/typesizes.h:
	Replace all uses of __UQUAD_TYPE with __U64_TYPE, and all
	uses of __SQUAD_TYPE with __S64_TYPE.

        * posix/sys/types.h, rpc/sys/types.h
        (u_char): Define as unsigned char.
        (u_short): Define as unsigned short.
        (u_int): Define as unsigned int.
        (u_long): Define as unsigned long.
        (quad_t): Define as __int64_t.
        (u_quad_t): Define as __uint64_t.

        * stdlib/stdint.h (intptr_t): Define as __intptr_t.
        (uintptr_t): Define as __uintptr_t.

        * scripts/check-obsolete-constructs.py: Update allowed
        definitions for the obsolete types.  No longer allow
        __STD_TYPE as an alias for typedef.
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/generic/bits/typesizes.h14
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/typesizes.h16
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/typesizes.h14
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/typesizes.h14
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/typesizes.h20
5 files changed, 39 insertions, 39 deletions
diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
index c7e72f3ca5..52f7967d1e 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
@@ -27,24 +27,24 @@
 /* See <bits/types.h> for the meaning of these macros.  This file exists so
    that <bits/types.h> need not vary across different GNU platforms.  */
 
-#define __DEV_T_TYPE		__UQUAD_TYPE
+#define __DEV_T_TYPE		__U64_TYPE
 #define __UID_T_TYPE		__U32_TYPE
 #define __GID_T_TYPE		__U32_TYPE
 #define __INO_T_TYPE		__ULONGWORD_TYPE
-#define __INO64_T_TYPE		__UQUAD_TYPE
+#define __INO64_T_TYPE		__U64_TYPE
 #define __MODE_T_TYPE		__U32_TYPE
 #define __NLINK_T_TYPE		__U32_TYPE
 #define __OFF_T_TYPE		__SLONGWORD_TYPE
-#define __OFF64_T_TYPE		__SQUAD_TYPE
+#define __OFF64_T_TYPE		__S64_TYPE
 #define __PID_T_TYPE		__S32_TYPE
 #define __RLIM_T_TYPE		__ULONGWORD_TYPE
-#define __RLIM64_T_TYPE		__UQUAD_TYPE
+#define __RLIM64_T_TYPE		__U64_TYPE
 #define	__BLKCNT_T_TYPE		__SLONGWORD_TYPE
-#define	__BLKCNT64_T_TYPE	__SQUAD_TYPE
+#define	__BLKCNT64_T_TYPE	__S64_TYPE
 #define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
-#define	__FSBLKCNT64_T_TYPE	__UQUAD_TYPE
+#define	__FSBLKCNT64_T_TYPE	__U64_TYPE
 #define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE
-#define	__FSFILCNT64_T_TYPE	__UQUAD_TYPE
+#define	__FSFILCNT64_T_TYPE	__U64_TYPE
 #define	__FSWORD_T_TYPE		__SWORD_TYPE
 #define	__ID_T_TYPE		__U32_TYPE
 #define __CLOCK_T_TYPE		__SLONGWORD_TYPE
diff --git a/sysdeps/unix/sysv/linux/mips/bits/typesizes.h b/sysdeps/unix/sysv/linux/mips/bits/typesizes.h
index 7c1bedd9af..e73bba4ee7 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/typesizes.h
@@ -26,24 +26,24 @@
 /* See <bits/types.h> for the meaning of these macros.  This file exists so
    that <bits/types.h> need not vary across different GNU platforms.  */
 
-#define __DEV_T_TYPE		__UQUAD_TYPE
+#define __DEV_T_TYPE		__U64_TYPE
 #define __UID_T_TYPE		__U32_TYPE
 #define __GID_T_TYPE		__U32_TYPE
 #define __INO_T_TYPE		__ULONGWORD_TYPE
-#define __INO64_T_TYPE		__UQUAD_TYPE
+#define __INO64_T_TYPE		__U64_TYPE
 #define __MODE_T_TYPE		__U32_TYPE
 #define __NLINK_T_TYPE		__UWORD_TYPE
 #define __OFF_T_TYPE		__SLONGWORD_TYPE
-#define __OFF64_T_TYPE		__SQUAD_TYPE
+#define __OFF64_T_TYPE		__S64_TYPE
 #define __PID_T_TYPE		__S32_TYPE
 #define __RLIM_T_TYPE		__ULONGWORD_TYPE
-#define __RLIM64_T_TYPE		__UQUAD_TYPE
+#define __RLIM64_T_TYPE		__U64_TYPE
 #define	__BLKCNT_T_TYPE		__SLONGWORD_TYPE
-#define	__BLKCNT64_T_TYPE	__SQUAD_TYPE
+#define	__BLKCNT64_T_TYPE	__S64_TYPE
 #define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
-#define	__FSBLKCNT64_T_TYPE	__UQUAD_TYPE
+#define	__FSBLKCNT64_T_TYPE	__U64_TYPE
 #define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE
-#define	__FSFILCNT64_T_TYPE	__UQUAD_TYPE
+#define	__FSFILCNT64_T_TYPE	__U64_TYPE
 #define	__FSWORD_T_TYPE		__SWORD_TYPE
 #define	__ID_T_TYPE		__U32_TYPE
 #define __CLOCK_T_TYPE		__SLONGWORD_TYPE
@@ -61,7 +61,7 @@
 #define __CPU_MASK_TYPE 	__ULONGWORD_TYPE
 
 #if defined _ABIN32 && _MIPS_SIM == _ABIN32
-#define __REGISTER_T_TYPE	__SQUAD_TYPE
+#define __REGISTER_T_TYPE	__S64_TYPE
 #else
 #define __REGISTER_T_TYPE	__SWORD_TYPE
 #endif
diff --git a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
index e812109140..3671355225 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
@@ -26,24 +26,24 @@
 /* See <bits/types.h> for the meaning of these macros.  This file exists so
    that <bits/types.h> need not vary across different GNU platforms.  */
 
-#define __DEV_T_TYPE		__UQUAD_TYPE
+#define __DEV_T_TYPE		__U64_TYPE
 #define __UID_T_TYPE		__U32_TYPE
 #define __GID_T_TYPE		__U32_TYPE
 #define __INO_T_TYPE		__ULONGWORD_TYPE
-#define __INO64_T_TYPE		__UQUAD_TYPE
+#define __INO64_T_TYPE		__U64_TYPE
 #define __MODE_T_TYPE		__U32_TYPE
 #define __NLINK_T_TYPE		__UWORD_TYPE
 #define __OFF_T_TYPE		__SLONGWORD_TYPE
-#define __OFF64_T_TYPE		__SQUAD_TYPE
+#define __OFF64_T_TYPE		__S64_TYPE
 #define __PID_T_TYPE		__S32_TYPE
 #define __RLIM_T_TYPE		__ULONGWORD_TYPE
-#define __RLIM64_T_TYPE		__UQUAD_TYPE
+#define __RLIM64_T_TYPE		__U64_TYPE
 #define	__BLKCNT_T_TYPE		__SLONGWORD_TYPE
-#define	__BLKCNT64_T_TYPE	__SQUAD_TYPE
+#define	__BLKCNT64_T_TYPE	__S64_TYPE
 #define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
-#define	__FSBLKCNT64_T_TYPE	__UQUAD_TYPE
+#define	__FSBLKCNT64_T_TYPE	__U64_TYPE
 #define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE
-#define	__FSFILCNT64_T_TYPE	__UQUAD_TYPE
+#define	__FSFILCNT64_T_TYPE	__U64_TYPE
 #define	__FSWORD_T_TYPE		__SWORD_TYPE
 #define	__ID_T_TYPE		__U32_TYPE
 #define __CLOCK_T_TYPE		__SLONGWORD_TYPE
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
index 830a45f01c..37627bd297 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
@@ -26,24 +26,24 @@
 /* See <bits/types.h> for the meaning of these macros.  This file exists so
    that <bits/types.h> need not vary across different GNU platforms.  */
 
-#define __DEV_T_TYPE		__UQUAD_TYPE
+#define __DEV_T_TYPE		__U64_TYPE
 #define __UID_T_TYPE		__U32_TYPE
 #define __GID_T_TYPE		__U32_TYPE
 #define __INO_T_TYPE		__ULONGWORD_TYPE
-#define __INO64_T_TYPE		__UQUAD_TYPE
+#define __INO64_T_TYPE		__U64_TYPE
 #define __MODE_T_TYPE		__U32_TYPE
 #define __NLINK_T_TYPE		__U32_TYPE
 #define __OFF_T_TYPE		__SLONGWORD_TYPE
-#define __OFF64_T_TYPE		__SQUAD_TYPE
+#define __OFF64_T_TYPE		__S64_TYPE
 #define __PID_T_TYPE		__S32_TYPE
 #define __RLIM_T_TYPE		__ULONGWORD_TYPE
-#define __RLIM64_T_TYPE		__UQUAD_TYPE
+#define __RLIM64_T_TYPE		__U64_TYPE
 #define	__BLKCNT_T_TYPE		__SLONGWORD_TYPE
-#define	__BLKCNT64_T_TYPE	__SQUAD_TYPE
+#define	__BLKCNT64_T_TYPE	__S64_TYPE
 #define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
-#define	__FSBLKCNT64_T_TYPE	__UQUAD_TYPE
+#define	__FSBLKCNT64_T_TYPE	__U64_TYPE
 #define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE
-#define	__FSFILCNT64_T_TYPE	__UQUAD_TYPE
+#define	__FSFILCNT64_T_TYPE	__U64_TYPE
 #define	__FSWORD_T_TYPE		__SWORD_TYPE
 #define	__ID_T_TYPE		__U32_TYPE
 #define __CLOCK_T_TYPE		__SLONGWORD_TYPE
diff --git a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
index 55f9a4c430..e4f3698976 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
@@ -28,20 +28,20 @@
 
 /* X32 kernel interface is 64-bit.  */
 #if defined __x86_64__ && defined __ILP32__
-# define __SYSCALL_SLONG_TYPE	__SQUAD_TYPE
-# define __SYSCALL_ULONG_TYPE	__UQUAD_TYPE
-# define __REGISTER_T_TYPE	__SQUAD_TYPE
+# define __SYSCALL_SLONG_TYPE	__S64_TYPE
+# define __SYSCALL_ULONG_TYPE	__U64_TYPE
+# define __REGISTER_T_TYPE	__S64_TYPE
 #else
 # define __SYSCALL_SLONG_TYPE	__SLONGWORD_TYPE
 # define __SYSCALL_ULONG_TYPE	__ULONGWORD_TYPE
 # define __REGISTER_T_TYPE	__SWORD_TYPE
 #endif
 
-#define __DEV_T_TYPE		__UQUAD_TYPE
+#define __DEV_T_TYPE		__U64_TYPE
 #define __UID_T_TYPE		__U32_TYPE
 #define __GID_T_TYPE		__U32_TYPE
 #define __INO_T_TYPE		__SYSCALL_ULONG_TYPE
-#define __INO64_T_TYPE		__UQUAD_TYPE
+#define __INO64_T_TYPE		__U64_TYPE
 #define __MODE_T_TYPE		__U32_TYPE
 #ifdef __x86_64__
 # define __NLINK_T_TYPE		__SYSCALL_ULONG_TYPE
@@ -51,16 +51,16 @@
 # define __FSWORD_T_TYPE	__SWORD_TYPE
 #endif
 #define __OFF_T_TYPE		__SYSCALL_SLONG_TYPE
-#define __OFF64_T_TYPE		__SQUAD_TYPE
+#define __OFF64_T_TYPE		__S64_TYPE
 #define __PID_T_TYPE		__S32_TYPE
 #define __RLIM_T_TYPE		__SYSCALL_ULONG_TYPE
-#define __RLIM64_T_TYPE		__UQUAD_TYPE
+#define __RLIM64_T_TYPE		__U64_TYPE
 #define __BLKCNT_T_TYPE		__SYSCALL_SLONG_TYPE
-#define __BLKCNT64_T_TYPE	__SQUAD_TYPE
+#define __BLKCNT64_T_TYPE	__S64_TYPE
 #define __FSBLKCNT_T_TYPE	__SYSCALL_ULONG_TYPE
-#define __FSBLKCNT64_T_TYPE	__UQUAD_TYPE
+#define __FSBLKCNT64_T_TYPE	__U64_TYPE
 #define __FSFILCNT_T_TYPE	__SYSCALL_ULONG_TYPE
-#define __FSFILCNT64_T_TYPE	__UQUAD_TYPE
+#define __FSFILCNT64_T_TYPE	__U64_TYPE
 #define __ID_T_TYPE		__U32_TYPE
 #define __CLOCK_T_TYPE		__SYSCALL_SLONG_TYPE
 #define __TIME_T_TYPE		__SYSCALL_SLONG_TYPE