shithub: femtolisp

Download patch

ref: 4862587eaad8359a2471bcf4b7c8e7f735568ee7
parent: 5a40f2d38ff53e1bdc3f3b56a2d3691179c14183
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Mar 27 17:07:30 EDT 2023

remove unused stuff

--- a/flisp.h
+++ b/flisp.h
@@ -364,7 +364,6 @@
 value_t return_from_uint64(uint64_t Uaccum);
 value_t return_from_int64(int64_t Saccum);
 
-numerictype_t effective_numerictype(double r);
 double conv_to_double(void *data, numerictype_t tag);
 void conv_from_double(void *data, double d, numerictype_t tag);
 int64_t conv_to_int64(void *data, numerictype_t tag);
@@ -385,11 +384,6 @@
 } builtinspec_t;
 
 void assign_global_builtins(builtinspec_t *b);
-
-/* builtins */
-value_t fl_hash(value_t *args, uint32_t nargs);
-value_t cvalue_byte(value_t *args, uint32_t nargs);
-value_t cvalue_wchar(value_t *args, uint32_t nargs);
 
 void fl_init(size_t initial_heapsize);
 int fl_load_system_image(value_t ios);
--- a/operators.c
+++ b/operators.c
@@ -1,32 +1,4 @@
 #include "llt.h"
-#include "ieee754.h"
-
-#if defined(__plan9__)
-double trunc(double x)
-{
-    modf(x, &x);
-    return x;
-}
-#define fpart(x) modf(x, nil)
-#else
-#define fpart(x) ((x) - trunc(x))
-#endif
-
-// given a number, determine an appropriate type for storing it
-// simpler version implementing a smaller preferred type repertoire
-numerictype_t effective_numerictype(double r)
-{
-    double fp;
-
-    fp = fpart(r);
-    if (fp != 0 || r > (double)INT64_MAX || r < INT64_MIN)
-        return T_DOUBLE;
-    else if (r >= INT32_MIN && r <= INT32_MAX)
-        return T_INT32;
-    else if (r <= (double)INT64_MAX)
-        return T_INT64;
-    return T_UINT64;
-}
 
 double conv_to_double(void *data, numerictype_t tag)
 {