From b35ab48437b912b51143391f9333d48b63454954 Mon Sep 17 00:00:00 2001 From: Lassi Kortela Date: Fri, 9 Aug 2019 21:04:19 +0300 Subject: [PATCH] Replace "preferred int type" with intptr_t --- c/cvalues.h | 8 ++++---- c/dtypes.h | 4 ---- c/flisp.h | 4 ++-- c/hashing.c | 2 +- c/hashing.h | 2 +- c/htable_inc.h | 2 +- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/c/cvalues.h b/c/cvalues.h index 49efc37..612010e 100644 --- a/c/cvalues.h +++ b/c/cvalues.h @@ -1293,7 +1293,7 @@ static int num_to_ptr(value_t a, fixnum_t *pi, numerictype_t *pt, void **pp) */ int numeric_compare(value_t a, value_t b, int eq, int eqnans, char *fname) { - int_t ai, bi; + intptr_t ai, bi; numerictype_t ta, tb; void *aptr, *bptr; @@ -1336,7 +1336,7 @@ static void DivideByZeroError(void) static value_t fl_div2(value_t a, value_t b) { double da, db; - int_t ai, bi; + intptr_t ai, bi; numerictype_t ta, tb; void *aptr, *bptr; @@ -1360,7 +1360,7 @@ static value_t fl_div2(value_t a, value_t b) static value_t fl_idiv2(value_t a, value_t b) { - int_t ai, bi; + intptr_t ai, bi; numerictype_t ta, tb; void *aptr, *bptr; int64_t a64, b64; @@ -1407,7 +1407,7 @@ div_error: static value_t fl_bitwise_op(value_t a, value_t b, int opcode, char *fname) { - int_t ai, bi; + intptr_t ai, bi; numerictype_t ta, tb, itmp; void *aptr = NULL, *bptr = NULL, *ptmp; int64_t b64; diff --git a/c/dtypes.h b/c/dtypes.h index 0835f18..c04fd20 100644 --- a/c/dtypes.h +++ b/c/dtypes.h @@ -104,8 +104,6 @@ typedef int bool_t; #ifdef BITS64 #define TOP_BIT 0x8000000000000000 #define NBITS 64 -typedef unsigned long uint_t; // preferred int type on platform -typedef long int_t; typedef int64_t offset_t; typedef uint64_t index_t; typedef int64_t ptrint_t; // pointer-size int @@ -113,8 +111,6 @@ typedef uint64_t u_ptrint_t; #else #define TOP_BIT 0x80000000 #define NBITS 32 -typedef unsigned long uint_t; -typedef long int_t; typedef int32_t offset_t; typedef uint32_t index_t; typedef int32_t ptrint_t; diff --git a/c/flisp.h b/c/flisp.h index 8b418dd..8aca541 100644 --- a/c/flisp.h +++ b/c/flisp.h @@ -1,6 +1,6 @@ typedef uptrint_t value_t; -typedef int_t fixnum_t; -typedef uint_t ufixnum_t; +typedef intptr_t fixnum_t; +typedef uintptr_t ufixnum_t; #ifdef BITS64 #define T_FIXNUM T_INT64 #else diff --git a/c/hashing.c b/c/hashing.c index 42a1ba1..0511256 100644 --- a/c/hashing.c +++ b/c/hashing.c @@ -27,7 +27,7 @@ typedef unsigned short uint16_t; #include "ios.h" #include "random.h" -uint_t nextipow2(uint_t i) +uintptr_t nextipow2(uintptr_t i) { if (i == 0) return 1; diff --git a/c/hashing.h b/c/hashing.h index ced1e07..b974e78 100644 --- a/c/hashing.h +++ b/c/hashing.h @@ -1,4 +1,4 @@ -uint_t nextipow2(uint_t i); +uintptr_t nextipow2(uintptr_t i); uint32_t int32hash(uint32_t a); uint64_t int64hash(uint64_t key); uint32_t int64to32hash(uint64_t key); diff --git a/c/htable_inc.h b/c/htable_inc.h index 0e902ca..5b27bcb 100644 --- a/c/htable_inc.h +++ b/c/htable_inc.h @@ -13,7 +13,7 @@ #define HTIMPL(HTNAME, HFUNC, EQFUNC) \ static void **HTNAME##_lookup_bp(struct htable *h, void *key) \ { \ - uint_t hv; \ + uintptr_t hv; \ size_t i, orig, index, iter; \ size_t newsz, sz = hash_size(h); \ size_t maxprobe = max_probe(sz); \