commit 2d0310bc013bbf2bced1662ba0f33a4739f6a77a
parent 55dac6463872529b706115661516cca7a15e7e9e
Author: Robert Russell <robertrussell.72001@gmail.com>
Date: Wed, 15 Mar 2023 13:49:31 -0700
Remove stupid {i,u}word types
Diffstat:
| M | inc/def.h | | | 32 | +------------------------------- |
1 file changed, 1 insertion(+), 31 deletions(-)
diff --git a/inc/def.h b/inc/def.h
@@ -35,7 +35,7 @@
* STATIC(char[], "abc")
* STATIC(struct {int a; int b;}, {1, 2})
* The result of each of these expressions is a pointer to static data, which
- * in particular mean it can be passed to functions that retain pointers after
+ * in particular means it can be passed to functions that retain pointers after
* the caller returns. In the last use case, the value argument contains a
* comma outside of parentheses, which is why we use varargs in the
* implementation. The type argument must never contain a comma outside of
@@ -54,19 +54,6 @@
#define R_HAVE_128 1
#endif
-/* Here, roughly speaking, "word" means the largest unit that the machine can
- * operate on in one instruction (typically the same width as registers and
- * the bus). This detection is probably wrong on some weird machines, but this
- * is the best we can do in C.
- * XXX: Is this used anywhere? We should probably just assume 64 bit. */
-#if UINTPTR_MAX == UINT32_MAX
-#define WORD_SIZE 4
-#elif UINTPTR_MAX == UINT64_MAX
-#define WORD_SIZE 8
-#else /* This won't happen except on weird archs */
-#error "Could not determine machine word size"
-#endif
-
/* Correct the mistakes of whoever named these macros */
#define SHORT_MIN SHRT_MIN
#define SHORT_MAX SHRT_MAX
@@ -124,15 +111,6 @@ typedef int64_t isize;
#error "Could not find suitable type for isize"
#endif
-#define IWORD_MIN INTPTR_MIN
-#define IWORD_MAX INTPTR_MAX
-#if WORD_SIZE == 4
-#define IWORD_C INT32_C
-#else /* WORD_SIZE == 8 */
-#define IWORD_C INT64_C
-#endif
-typedef intptr_t iword;
-
#define U8_MAX UINT8_MAX
#define U8_C UINT8_C
typedef uint8_t u8;
@@ -164,14 +142,6 @@ typedef uintptr_t uptr;
#define USIZE_MAX SIZE_MAX
typedef size_t usize;
-#define UWORD_MAX UINTPTR_MAX
-#if WORD_SIZE == 4
-#define UWORD_C UINT32_C
-#else /* WORD_SIZE == 8 */
-#define UWORD_C UINT64_C
-#endif
-typedef uintptr_t uword;
-
#define RUNE_BAD RUNE_C(0xFFFD)
#define RUNE_MAX RUNE_C(0x10FFFF)
#define RUNE_C UINT32_C