From 2c124e13bd7941fe0b885eecdc5de6f09aacf06a Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 7 May 2024 09:17:51 -0400 Subject: stdint.h: derive limits from __LONG_MAX, use common fast16 types the bits file is retained, but as a single generic version, to allow for the unlikely future possibility of letting a new arch define something differently. --- arch/aarch64/bits/stdint.h | 20 -------------------- arch/arm/bits/stdint.h | 20 -------------------- arch/generic/bits/stdint.h | 29 +++++++++++++++++++++++++++++ arch/i386/bits/stdint.h | 20 -------------------- arch/loongarch64/bits/stdint.h | 20 -------------------- arch/m68k/bits/stdint.h | 20 -------------------- arch/microblaze/bits/stdint.h | 20 -------------------- arch/mips/bits/stdint.h | 20 -------------------- arch/mips64/bits/stdint.h | 20 -------------------- arch/mipsn32/bits/stdint.h | 20 -------------------- arch/or1k/bits/stdint.h | 20 -------------------- arch/powerpc/bits/stdint.h | 20 -------------------- arch/powerpc64/bits/stdint.h | 20 -------------------- arch/riscv32/bits/stdint.h | 20 -------------------- arch/riscv64/bits/stdint.h | 20 -------------------- arch/s390x/bits/stdint.h | 20 -------------------- arch/sh/bits/stdint.h | 20 -------------------- arch/x32/bits/stdint.h | 20 -------------------- arch/x86_64/bits/stdint.h | 20 -------------------- 19 files changed, 29 insertions(+), 360 deletions(-) delete mode 100644 arch/aarch64/bits/stdint.h delete mode 100644 arch/arm/bits/stdint.h create mode 100644 arch/generic/bits/stdint.h delete mode 100644 arch/i386/bits/stdint.h delete mode 100644 arch/loongarch64/bits/stdint.h delete mode 100644 arch/m68k/bits/stdint.h delete mode 100644 arch/microblaze/bits/stdint.h delete mode 100644 arch/mips/bits/stdint.h delete mode 100644 arch/mips64/bits/stdint.h delete mode 100644 arch/mipsn32/bits/stdint.h delete mode 100644 arch/or1k/bits/stdint.h delete mode 100644 arch/powerpc/bits/stdint.h delete mode 100644 arch/powerpc64/bits/stdint.h delete mode 100644 arch/riscv32/bits/stdint.h delete mode 100644 arch/riscv64/bits/stdint.h delete mode 100644 arch/s390x/bits/stdint.h delete mode 100644 arch/sh/bits/stdint.h delete mode 100644 arch/x32/bits/stdint.h delete mode 100644 arch/x86_64/bits/stdint.h diff --git a/arch/aarch64/bits/stdint.h b/arch/aarch64/bits/stdint.h deleted file mode 100644 index 1bb147f..0000000 --- a/arch/aarch64/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT64_MIN -#define INTPTR_MAX INT64_MAX -#define UINTPTR_MAX UINT64_MAX -#define PTRDIFF_MIN INT64_MIN -#define PTRDIFF_MAX INT64_MAX -#define SIZE_MAX UINT64_MAX diff --git a/arch/arm/bits/stdint.h b/arch/arm/bits/stdint.h deleted file mode 100644 index d1b2712..0000000 --- a/arch/arm/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX -#define PTRDIFF_MIN INT32_MIN -#define PTRDIFF_MAX INT32_MAX -#define SIZE_MAX UINT32_MAX diff --git a/arch/generic/bits/stdint.h b/arch/generic/bits/stdint.h new file mode 100644 index 0000000..8648918 --- /dev/null +++ b/arch/generic/bits/stdint.h @@ -0,0 +1,29 @@ +typedef int32_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef uint32_t uint_fast16_t; +typedef uint32_t uint_fast32_t; + +#define INT_FAST16_MIN INT32_MIN +#define INT_FAST32_MIN INT32_MIN + +#define INT_FAST16_MAX INT32_MAX +#define INT_FAST32_MAX INT32_MAX + +#define UINT_FAST16_MAX UINT32_MAX +#define UINT_FAST32_MAX UINT32_MAX + +#if __LONG_MAX == 0x7fffffffL +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#define UINTPTR_MAX UINT32_MAX +#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MAX INT32_MAX +#define SIZE_MAX UINT32_MAX +#else +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX +#define SIZE_MAX UINT64_MAX +#endif diff --git a/arch/i386/bits/stdint.h b/arch/i386/bits/stdint.h deleted file mode 100644 index d1b2712..0000000 --- a/arch/i386/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX -#define PTRDIFF_MIN INT32_MIN -#define PTRDIFF_MAX INT32_MAX -#define SIZE_MAX UINT32_MAX diff --git a/arch/loongarch64/bits/stdint.h b/arch/loongarch64/bits/stdint.h deleted file mode 100644 index 1bb147f..0000000 --- a/arch/loongarch64/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT64_MIN -#define INTPTR_MAX INT64_MAX -#define UINTPTR_MAX UINT64_MAX -#define PTRDIFF_MIN INT64_MIN -#define PTRDIFF_MAX INT64_MAX -#define SIZE_MAX UINT64_MAX diff --git a/arch/m68k/bits/stdint.h b/arch/m68k/bits/stdint.h deleted file mode 100644 index d1b2712..0000000 --- a/arch/m68k/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX -#define PTRDIFF_MIN INT32_MIN -#define PTRDIFF_MAX INT32_MAX -#define SIZE_MAX UINT32_MAX diff --git a/arch/microblaze/bits/stdint.h b/arch/microblaze/bits/stdint.h deleted file mode 100644 index d1b2712..0000000 --- a/arch/microblaze/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX -#define PTRDIFF_MIN INT32_MIN -#define PTRDIFF_MAX INT32_MAX -#define SIZE_MAX UINT32_MAX diff --git a/arch/mips/bits/stdint.h b/arch/mips/bits/stdint.h deleted file mode 100644 index d1b2712..0000000 --- a/arch/mips/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX -#define PTRDIFF_MIN INT32_MIN -#define PTRDIFF_MAX INT32_MAX -#define SIZE_MAX UINT32_MAX diff --git a/arch/mips64/bits/stdint.h b/arch/mips64/bits/stdint.h deleted file mode 100644 index 1bb147f..0000000 --- a/arch/mips64/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT64_MIN -#define INTPTR_MAX INT64_MAX -#define UINTPTR_MAX UINT64_MAX -#define PTRDIFF_MIN INT64_MIN -#define PTRDIFF_MAX INT64_MAX -#define SIZE_MAX UINT64_MAX diff --git a/arch/mipsn32/bits/stdint.h b/arch/mipsn32/bits/stdint.h deleted file mode 100644 index d1b2712..0000000 --- a/arch/mipsn32/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX -#define PTRDIFF_MIN INT32_MIN -#define PTRDIFF_MAX INT32_MAX -#define SIZE_MAX UINT32_MAX diff --git a/arch/or1k/bits/stdint.h b/arch/or1k/bits/stdint.h deleted file mode 100644 index d1b2712..0000000 --- a/arch/or1k/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX -#define PTRDIFF_MIN INT32_MIN -#define PTRDIFF_MAX INT32_MAX -#define SIZE_MAX UINT32_MAX diff --git a/arch/powerpc/bits/stdint.h b/arch/powerpc/bits/stdint.h deleted file mode 100644 index d1b2712..0000000 --- a/arch/powerpc/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX -#define PTRDIFF_MIN INT32_MIN -#define PTRDIFF_MAX INT32_MAX -#define SIZE_MAX UINT32_MAX diff --git a/arch/powerpc64/bits/stdint.h b/arch/powerpc64/bits/stdint.h deleted file mode 100644 index 1bb147f..0000000 --- a/arch/powerpc64/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT64_MIN -#define INTPTR_MAX INT64_MAX -#define UINTPTR_MAX UINT64_MAX -#define PTRDIFF_MIN INT64_MIN -#define PTRDIFF_MAX INT64_MAX -#define SIZE_MAX UINT64_MAX diff --git a/arch/riscv32/bits/stdint.h b/arch/riscv32/bits/stdint.h deleted file mode 100644 index d1b2712..0000000 --- a/arch/riscv32/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX -#define PTRDIFF_MIN INT32_MIN -#define PTRDIFF_MAX INT32_MAX -#define SIZE_MAX UINT32_MAX diff --git a/arch/riscv64/bits/stdint.h b/arch/riscv64/bits/stdint.h deleted file mode 100644 index 1bb147f..0000000 --- a/arch/riscv64/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT64_MIN -#define INTPTR_MAX INT64_MAX -#define UINTPTR_MAX UINT64_MAX -#define PTRDIFF_MIN INT64_MIN -#define PTRDIFF_MAX INT64_MAX -#define SIZE_MAX UINT64_MAX diff --git a/arch/s390x/bits/stdint.h b/arch/s390x/bits/stdint.h deleted file mode 100644 index 1bb147f..0000000 --- a/arch/s390x/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT64_MIN -#define INTPTR_MAX INT64_MAX -#define UINTPTR_MAX UINT64_MAX -#define PTRDIFF_MIN INT64_MIN -#define PTRDIFF_MAX INT64_MAX -#define SIZE_MAX UINT64_MAX diff --git a/arch/sh/bits/stdint.h b/arch/sh/bits/stdint.h deleted file mode 100644 index d1b2712..0000000 --- a/arch/sh/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX -#define PTRDIFF_MIN INT32_MIN -#define PTRDIFF_MAX INT32_MAX -#define SIZE_MAX UINT32_MAX diff --git a/arch/x32/bits/stdint.h b/arch/x32/bits/stdint.h deleted file mode 100644 index d1b2712..0000000 --- a/arch/x32/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX -#define PTRDIFF_MIN INT32_MIN -#define PTRDIFF_MAX INT32_MAX -#define SIZE_MAX UINT32_MAX diff --git a/arch/x86_64/bits/stdint.h b/arch/x86_64/bits/stdint.h deleted file mode 100644 index 1bb147f..0000000 --- a/arch/x86_64/bits/stdint.h +++ /dev/null @@ -1,20 +0,0 @@ -typedef int32_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef uint32_t uint_fast16_t; -typedef uint32_t uint_fast32_t; - -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN - -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX - -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX - -#define INTPTR_MIN INT64_MIN -#define INTPTR_MAX INT64_MAX -#define UINTPTR_MAX UINT64_MAX -#define PTRDIFF_MIN INT64_MIN -#define PTRDIFF_MAX INT64_MAX -#define SIZE_MAX UINT64_MAX -- cgit v1.1