summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arith.c2
-rw-r--r--arith.h2
-rw-r--r--itypes.c6
-rw-r--r--lib.h1
-rw-r--r--rand.c2
5 files changed, 7 insertions, 6 deletions
diff --git a/arith.c b/arith.c
index e9ecdf54..5678453d 100644
--- a/arith.c
+++ b/arith.c
@@ -156,7 +156,7 @@ static val in_uint_ptr_range(val bignum)
mp_cmp_mag(mp(bignum), &UINT_PTR_MAX_MP) == MP_GT) ? nil : t;
}
-uint_ptr_t c_uint_ptr_num(val num)
+ucnum c_unum(val num)
{
switch (type(num)) {
case CHR: case NUM:
diff --git a/arith.h b/arith.h
index 96ba365e..f9866f8a 100644
--- a/arith.h
+++ b/arith.h
@@ -34,7 +34,7 @@ int num_to_buffer(val num, mem_t *buf, int bytes);
int highest_bit(int_ptr_t n);
val normalize(val bignum);
val in_int_ptr_range(val bignum);
-uint_ptr_t c_uint_ptr_num(val num);
+ucnum c_unum(val num);
val cum_norm_dist(val x);
val n_choose_k(val n, val k);
val n_perm_k(val n, val k);
diff --git a/itypes.c b/itypes.c
index 2d4c962f..e5e8697b 100644
--- a/itypes.c
+++ b/itypes.c
@@ -89,7 +89,7 @@ i32_t c_i32(val n, val self)
u32_t c_u32(val n, val self)
{
- uint_ptr_t v = c_uint_ptr_num(n);
+ uint_ptr_t v = c_unum(n);
if (v < 0 || v > 0xFFFFFFFF)
uw_throwf(error_s, lit("~a: value ~s is out of signed 32 bit range"),
self, n, nao);
@@ -110,7 +110,7 @@ i64_t c_i64(val n, val self)
u64_t c_u64(val n, val self)
{
- uint_ptr_t v = c_uint_ptr_num(n);
+ uint_ptr_t v = c_unum(n);
if (v < (cnum) -0x8000000000000000 || v > (cnum) 0x7FFFFFFFFFFFFFFF)
uw_throwf(error_s, lit("~a: value ~s is out of signed 64 bit range"),
self, n, nao);
@@ -181,7 +181,7 @@ int c_int(val n, val self)
unsigned int c_uint(val n, val self)
{
- uint_ptr_t v = c_uint_ptr_num(n);
+ uint_ptr_t v = c_unum(n);
if (v < 0 || v > UINT_MAX)
uw_throwf(error_s, lit("~a: value ~s is out of int range"),
self, n, nao);
diff --git a/lib.h b/lib.h
index 44074453..e78e8789 100644
--- a/lib.h
+++ b/lib.h
@@ -28,6 +28,7 @@
#include "mpi/mpi.h"
typedef int_ptr_t cnum;
+typedef uint_ptr_t ucnum;
#ifdef __cplusplus
#define strip_qual(TYPE, EXPR) (const_cast<TYPE>(EXPR))
diff --git a/rand.c b/rand.c
index d29fbecc..1dec0a9e 100644
--- a/rand.c
+++ b/rand.c
@@ -163,7 +163,7 @@ val make_random_state(val seed, val warmup)
seed, nao);
for (i = 0; i < 16; i++)
- r->state[i] = c_uint_ptr_num(seed->v.vec[i]);
+ r->state[i] = c_unum(seed->v.vec[i]);
r->cur = c_num(seed->v.vec[i]);
return rs;