summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-04-22 19:20:43 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-04-22 19:20:43 -0700
commit1bbd2db0de63a5f884db060989539e99db0063a7 (patch)
tree278d9b5a98b9302e133daff2390734a01d6a53c4
parent423d823c227f8c8ffb41ef32c6909e77e1ccd8f3 (diff)
downloadtxr-1bbd2db0de63a5f884db060989539e99db0063a7.tar.gz
txr-1bbd2db0de63a5f884db060989539e99db0063a7.tar.bz2
txr-1bbd2db0de63a5f884db060989539e99db0063a7.zip
arith: move c_unum and unum declaration into lib.h
The c_unum and unum functions are fairly often needed and and are closely related to c_num and num, which have always been declared in lib.h even though they live in arith.c. Files not doing arithmetic are including "arith.h" just for the sake of c_num or unum. * arith.h (c_unum, unum): Declarations removed. * lib.h (c_unum, unum): Declarations moved here. * chksum.c, debug.c, stream.c, strudel.c, sysif.c, vm.c: These files no longer require #include "arith.h" as a result, which is therefore removed.
-rw-r--r--arith.h2
-rw-r--r--chksum.c1
-rw-r--r--debug.c1
-rw-r--r--lib.h2
-rw-r--r--stream.c1
-rw-r--r--strudel.c1
-rw-r--r--sysif.c1
-rw-r--r--vm.c1
8 files changed, 2 insertions, 8 deletions
diff --git a/arith.h b/arith.h
index cf352040..177b2417 100644
--- a/arith.h
+++ b/arith.h
@@ -39,8 +39,6 @@ val bignum_dbl_ipt(double_intptr_t di);
val bignum_dbl_uipt(double_uintptr_t dui);
#endif
val in_int_ptr_range(val bignum);
-ucnum c_unum(val num);
-val unum(ucnum u);
#if HAVE_DOUBLE_INTPTR_T
double_intptr_t c_dbl_num(val num);
double_uintptr_t c_dbl_unum(val num);
diff --git a/chksum.c b/chksum.c
index 63d2c7bd..6b62ac0c 100644
--- a/chksum.c
+++ b/chksum.c
@@ -40,7 +40,6 @@
#include "unwind.h"
#include "eval.h"
#include "stream.h"
-#include "arith.h"
#include "utf8.h"
#include "buf.h"
#include "chksums/sha256.h"
diff --git a/debug.c b/debug.c
index 47672366..b2a3d942 100644
--- a/debug.c
+++ b/debug.c
@@ -40,7 +40,6 @@
#include "parser.h"
#include "struct.h"
#include "eval.h"
-#include "arith.h"
#include "txr.h"
#include "debug.h"
diff --git a/lib.h b/lib.h
index f039568f..e8cc31d6 100644
--- a/lib.h
+++ b/lib.h
@@ -711,8 +711,10 @@ val memp(val key, val plist);
val plist_to_alist(val list);
val improper_plist_to_alist(val list, val boolean_keys);
val num(cnum val);
+val unum(ucnum u);
val flo(double val);
cnum c_num(val num);
+ucnum c_unum(val num);
cnum c_fixnum(val num, val self);
double c_flo(val self, val num);
val fixnump(val num);
diff --git a/stream.c b/stream.c
index d264da16..5148e506 100644
--- a/stream.c
+++ b/stream.c
@@ -71,7 +71,6 @@
#include "eval.h"
#include "regex.h"
#include "txr.h"
-#include "arith.h"
#include "buf.h"
/* Adhere to ISO C rules about direction switching on update streams. */
diff --git a/strudel.c b/strudel.c
index e36389b7..354417bd 100644
--- a/strudel.c
+++ b/strudel.c
@@ -37,7 +37,6 @@
#include "gc.h"
#include "eval.h"
#include "struct.h"
-#include "arith.h"
#include "buf.h"
#include "strudel.h"
diff --git a/sysif.c b/sysif.c
index 40dec6f0..4bf76a38 100644
--- a/sysif.c
+++ b/sysif.c
@@ -96,7 +96,6 @@
#include "eval.h"
#include "args.h"
#include "struct.h"
-#include "arith.h"
#include "itypes.h"
#include "txr.h"
#include "sysif.h"
diff --git a/vm.c b/vm.c
index 9c8e270c..257157a9 100644
--- a/vm.c
+++ b/vm.c
@@ -43,7 +43,6 @@
#include "args.h"
#include "itypes.h"
#include "buf.h"
-#include "arith.h"
#include "vmop.h"
#include "vm.h"