aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-05 02:37:45 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-05 02:37:45 -0400
commitfa5ca582ffc543b8093762d2e0c876b3c6068351 (patch)
tree634d8cad9e24b2e123727da8ffb74d26cb6a748c
parentf5140086ae3b7a474206754e76d91142c1d0d607 (diff)
Clean up some imports
-rw-r--r--builtins/range.c1
-rw-r--r--builtins/text.c1
-rw-r--r--parse.c3
-rw-r--r--typecheck.c5
4 files changed, 1 insertions, 9 deletions
diff --git a/builtins/range.c b/builtins/range.c
index 362174b0..d170e6b7 100644
--- a/builtins/range.c
+++ b/builtins/range.c
@@ -2,7 +2,6 @@
#include <ctype.h>
#include <err.h>
-#include <gmp.h>
#include <gc.h>
#include <math.h>
#include <stdbool.h>
diff --git a/builtins/text.c b/builtins/text.c
index bd329ea6..54b9d3d5 100644
--- a/builtins/text.c
+++ b/builtins/text.c
@@ -51,7 +51,6 @@
#include <ctype.h>
#include <err.h>
#include <gc.h>
-#include <gmp.h>
#include <limits.h>
#include <printf.h>
#include <stdbool.h>
diff --git a/parse.c b/parse.c
index f1273bee..22bb883d 100644
--- a/parse.c
+++ b/parse.c
@@ -1,9 +1,6 @@
// Recursive descent parser for parsing code
#include <ctype.h>
#include <gc.h>
-#include <gmp.h>
-#include <libgen.h>
-#include <linux/limits.h>
#include <math.h>
#include <setjmp.h>
#include <stdarg.h>
diff --git a/typecheck.c b/typecheck.c
index af1ea770..19860017 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -1,7 +1,6 @@
// Logic for getting a type from an AST node
#include <ctype.h>
#include <gc.h>
-#include <gmp.h>
#include <signal.h>
#include <stdarg.h>
#include <stdlib.h>
@@ -1369,9 +1368,7 @@ bool is_constant(env_t *env, ast_t *ast)
auto info = Match(ast, Int);
if (info->bits == IBITS_UNSPECIFIED) {
Int_t int_val = Int$from_text(Text$from_str(info->str), NULL);
- mpz_t i;
- mpz_init_set_int(i, int_val);
- return (mpz_cmpabs_ui(i, BIGGEST_SMALL_INT) <= 0);
+ return (Int$compare_value(int_val, I(BIGGEST_SMALL_INT)) <= 0);
}
return true;
}