#include "lisp.h"
#include "sysproc.h" /* For qxe_getpid */
-#include "ent-gmp.h"
+#include "ent.h"
static mpf_t float_print_min, float_print_max;
gmp_randstate_t random_state;
\f
/************************* Big Rational Integers ****************************/
static void
-bigz_print (Lisp_Object obj, Lisp_Object printcharfun, int UNUSED(escapeflag))
+bigz_print (Lisp_Object obj, Lisp_Object printcharfun, int SXE_UNUSED(escapeflag))
{
Bufbyte *bstr;
}
static int
-bigz_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED(depth))
+bigz_equal (Lisp_Object obj1, Lisp_Object obj2, int SXE_UNUSED(depth))
{
return bigz_eql(XBIGZ_DATA(obj1), XBIGZ_DATA(obj2));
}
static unsigned long
-bigz_hash (Lisp_Object obj, int UNUSED(depth))
+bigz_hash (Lisp_Object obj, int SXE_UNUSED(depth))
{
return (unsigned long)bigz_hashcode(XBIGZ_DATA(obj));
}
static const struct lrecord_description bigz_description[] = {
- { XD_OPAQUE_DATA_PTR, offsetof(Lisp_Bigz, data) },
+ { XD_OPAQUE_DATA_PTR, offsetof(Lisp_Bigz, data) },
{ XD_END }
};
\f
/************************** Rational Integer Fractions **********************/
static void
-bigq_print (Lisp_Object obj, Lisp_Object printcharfun, int UNUSED(escapeflag))
+bigq_print (Lisp_Object obj, Lisp_Object printcharfun, int SXE_UNUSED(escapeflag))
{
Bufbyte *rstr;
}
static int
-bigq_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED(depth))
+bigq_equal (Lisp_Object obj1, Lisp_Object obj2, int SXE_UNUSED(depth))
{
return bigq_eql(XBIGQ_DATA(obj1), XBIGQ_DATA(obj2));
}
static unsigned long
-bigq_hash (Lisp_Object obj, int UNUSED(depth))
+bigq_hash (Lisp_Object obj, int SXE_UNUSED(depth))
{
return bigq_hashcode(XBIGQ_DATA(obj));
}
static const struct lrecord_description bigq_description[] = {
{ XD_OPAQUE_DATA_PTR, offsetof (Lisp_Bigq, data) },
- { XD_END }
+ { XD_END }
};
DEFINE_BASIC_LRECORD_IMPLEMENTATION("bigq", bigq,
\f
/********************************** Bigfs ***********************************/
static void
-bigf_print(Lisp_Object obj, Lisp_Object printcharfun, int UNUSED(escapeflag))
+bigf_print(Lisp_Object obj, Lisp_Object printcharfun, int SXE_UNUSED(escapeflag))
{
Bufbyte *fstr = bigf_to_string(XBIGF_DATA(obj), 10);
write_c_string((char*)fstr, printcharfun);
}
static int
-bigf_equal(Lisp_Object obj1, Lisp_Object obj2, int UNUSED(depth))
+bigf_equal(Lisp_Object obj1, Lisp_Object obj2, int SXE_UNUSED(depth))
{
return bigf_eq(XBIGF_DATA(obj1), XBIGF_DATA(obj2));
}
static unsigned long
-bigf_hash(Lisp_Object obj, int UNUSED(depth))
+bigf_hash(Lisp_Object obj, int SXE_UNUSED(depth))
{
return bigf_hashcode(XBIGF_DATA(obj));
}
str[expt] = '\0';
len = expt + 1;
}
-#if 0
- /* never want this here */
- /* Computerized scientific notation */
- /* We need room for a radix point, format identifier, and exponent */
- const int space = (expt < 0)
- ? (int)(log(-expt) / log(base)) + 3
- : (int)(log(expt) / log(base)) + 2;
- xrealloc_array(str, Bufbyte, len + space);
- memmove(&str[neg + 2], &str[neg + 1], len - neg);
- str[len + 1] = 'l';
- sprintf ((char *)&str[len + 2], "%ld", expt);
-}
-#endif
return str;
}
bigz bz;
bigz_init(bz);
-
+
/* MPZ bigz_set_string has no effect
* with initial + sign */
if (*cp == '+') {
- If p has a '+' sign after the '/' (e.g., 300/+400), it sets the
numerator from the string, but *leaves the denominator unchanged*.
- If p has trailing nonnumeric characters, it sets the numerator from
- the string, but leaves the denominator unchanged.
+ the string, but leaves the denominator unchanged.
- If p has more than one '/', (e.g., 1/2/3), then it sets the
- numerator from the string, but leaves the denominator unchanged.
+ numerator from the string, but leaves the denominator unchanged.
Therefore, move p past any leading '+' signs, temporarily drop a null
after the numeric characters we are trying to convert, and then put
\f
static Lisp_Object
-_ent_lift_INT_T_BIGZ_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+_ent_lift_INT_T_BIGZ_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
{
return make_bigz(ent_int(number));
}
static Lisp_Object
-_ent_lift_BIGZ_T_INT_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+_ent_lift_BIGZ_T_INT_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
{
return make_int(bigz_to_long(XBIGZ_DATA(number)));
}
#ifdef HAVE_FPFLOAT
static Lisp_Object
-_ent_lift_FLOAT_T_BIGZ_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+_ent_lift_FLOAT_T_BIGZ_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
{
bigz_set_fpfloat(ent_scratch_bigz, XFLOAT_DATA(number));
return make_bigz_bz(ent_scratch_bigz);
}
static Lisp_Object
-_ent_lift_BIGZ_T_FLOAT_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+_ent_lift_BIGZ_T_FLOAT_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
{
/* can result in an indef object */
return make_float(bigz_to_fpfloat(XBIGZ_DATA(number)));
\f
static inline Lisp_Object
-_ent_lift_INT_T_BIGQ_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+_ent_lift_INT_T_BIGQ_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
{
return make_bigq(ent_int(number), 1UL);
}
static inline Lisp_Object
-_ent_lift_BIGQ_T_INT_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+_ent_lift_BIGQ_T_INT_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
{
bigz_div(ent_scratch_bigz,
XBIGQ_NUMERATOR(number),
}
static inline Lisp_Object
-_ent_lift_BIGZ_T_BIGQ_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+_ent_lift_BIGZ_T_BIGQ_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
{
bigz_set_long(ent_scratch_bigz, 1L);
return make_bigq_bz(XBIGZ_DATA(number), ent_scratch_bigz);
}
static inline Lisp_Object
-_ent_lift_BIGQ_T_BIGZ_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+_ent_lift_BIGQ_T_BIGZ_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
{
bigz_div(ent_scratch_bigz,
XBIGQ_NUMERATOR(number),
#ifdef HAVE_FPFLOAT
static inline Lisp_Object
-_ent_lift_FLOAT_T_BIGQ_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+_ent_lift_FLOAT_T_BIGQ_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
{
bigq_set_fpfloat(ent_scratch_bigq, XFLOAT_DATA(number));
return make_bigq_bq(ent_scratch_bigq);
}
static inline Lisp_Object
-_ent_lift_BIGQ_T_FLOAT_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+_ent_lift_BIGQ_T_FLOAT_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
{
/* can result in an indef object */
return make_float(bigq_to_fpfloat(XBIGQ_DATA(number)));
}
static Lisp_Object
-ent_lift_BIGF_T_INT_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+ent_lift_BIGF_T_INT_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
{
return make_int(bigf_to_long(XBIGF_DATA(number)));
}
}
static Lisp_Object
-ent_lift_BIGF_T_BIGZ_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+ent_lift_BIGF_T_BIGZ_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
{
bigz_set_bigf(ent_scratch_bigz, XBIGF_DATA(number));
return make_bigz_bz(ent_scratch_bigz);
}
static Lisp_Object
-ent_lift_BIGF_T_BIGQ_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+ent_lift_BIGF_T_BIGQ_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
{
bigq_set_bigf(ent_scratch_bigq, XBIGF_DATA(number));
return make_bigq_bq(ent_scratch_bigq);
}
static Lisp_Object
-ent_lift_BIGF_T_FLOAT_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+ent_lift_BIGF_T_FLOAT_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
{
/* can result in an indef object */
return make_float(bigf_to_fpfloat(XBIGF_DATA(number)));