summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arith.c2
-rw-r--r--arith.h3
-rw-r--r--sysif.c6
3 files changed, 6 insertions, 5 deletions
diff --git a/arith.c b/arith.c
index 62b53618..e45ad050 100644
--- a/arith.c
+++ b/arith.c
@@ -154,7 +154,7 @@ int num_to_buffer(val num, mem_t *buf, int bytes)
#if HAVE_DOUBLE_INTPTR_T
-static val bignum_dbl_ipt(double_intptr_t di)
+val bignum_dbl_ipt(double_intptr_t di)
{
val n = make_bignum();
mp_set_double_intptr(mp(n), di);
diff --git a/arith.h b/arith.h
index 22c8bbe2..919de83c 100644
--- a/arith.h
+++ b/arith.h
@@ -33,6 +33,9 @@ val num_from_buffer(mem_t *buf, int bytes);
int num_to_buffer(val num, mem_t *buf, int bytes);
int highest_bit(int_ptr_t n);
val normalize(val bignum);
+#if HAVE_DOUBLE_INTPTR_T
+val bignum_dbl_ipt(double_intptr_t di);
+#endif
val in_int_ptr_range(val bignum);
ucnum c_unum(val num);
val unum(ucnum u);
diff --git a/sysif.c b/sysif.c
index 9de6e12d..43f8fe80 100644
--- a/sysif.c
+++ b/sysif.c
@@ -1351,11 +1351,9 @@ val num_off_t(off_t off)
} else {
#if HAVE_DOUBLE_INTPTR_T
if (sizeof (off_t) <= sizeof (double_intptr_t)) {
- val n = make_bignum();
- mp_set_double_intptr(mp(n), off);
- return n;
+ return bignum_dbl_ipt(off);
} else {
- abort();
+ internal_error("portme: unsupported off_t size");
}
#else
#error port me!