diff options
-rw-r--r-- | arith.c | 2 | ||||
-rw-r--r-- | arith.h | 2 | ||||
-rw-r--r-- | itypes.c | 6 | ||||
-rw-r--r-- | lib.h | 1 | ||||
-rw-r--r-- | rand.c | 2 |
5 files changed, 7 insertions, 6 deletions
@@ -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: @@ -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); @@ -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); @@ -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)) @@ -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; |