Fix MPFR Flog implementation
[sxemacs] / src / ent / ent-mpfr.c
index 08ae459..dbca26a 100644 (file)
@@ -26,19 +26,23 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 #include "lisp.h"
 #include "sysproc.h"    /* For qxe_getpid */
 
+#include "ent.h"
+#include "ent-optable.h"
+#include "ent-lift.h"
+#include "ent-indef.h"
 #include "ent-mpfr.h"
 
 \f
 Lisp_Object Veuler;
 Lisp_Object Veuler_mascheroni;
-Lisp_Object Vpi;
+Lisp_Object Vbigfr_pi;
 
 bigfr ent_scratch_bigfr;
 static ase_nullary_operation_f Qent_mpfr_zero, Qent_mpfr_one;
 
 \f
 static void
-bigfr_print(Lisp_Object obj, Lisp_Object printcharfun, int UNUSED(unused))
+bigfr_print(Lisp_Object obj, Lisp_Object printcharfun, int SXE_UNUSED(unused))
 {
        Bufbyte *fstr = bigfr_to_string(XBIGFR_DATA(obj), 10);
        write_c_string((char*)fstr, printcharfun);
@@ -66,14 +70,11 @@ bigfr_mark (Lisp_Object unused)
 }
 
 static void
-bigfr_finalise (void *header, int for_disksave)
+bigfr_finalise (void *SXE_UNUSED(header), int for_disksave)
 {
        if (for_disksave)
                signal_simple_error
                        ("Can't dump an emacs containing MPFR objects", Qt);
-
-       /* less warnings */
-       if (header);
 }
 
 static const struct lrecord_description bigfr_description[] = {
@@ -136,7 +137,7 @@ Bufbyte *bigfr_to_string(mpfr_t f, int base)
 {
        mp_exp_t expt;
        Bufbyte *str;
-        int len;
+       int len;
        const int sign = mpfr_sgn(f);
        const int neg = (sign < 0) ? 1 : 0;
 
@@ -230,7 +231,7 @@ Lisp_Object read_bigc_string(char *cp)
                /* jump over a leading minus */
                cp++;
        }
-               
+
        while ((*cp >= '0' && *cp <= '9') ||
               (*cp == '.'))
                cp++;
@@ -1116,7 +1117,7 @@ _ent_lift_INT_T_BIGFR_T(Lisp_Object number, ent_lift_args_t la)
 }
 
 static inline Lisp_Object
-_ent_lift_BIGFR_T_INT_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+_ent_lift_BIGFR_T_INT_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
 {
        return make_int(bigfr_to_long(XBIGFR_DATA(number)));
 }
@@ -1133,7 +1134,7 @@ _ent_lift_BIGZ_T_BIGFR_T(Lisp_Object number, ent_lift_args_t la)
 }
 
 static inline Lisp_Object
-_ent_lift_BIGFR_T_BIGZ_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+_ent_lift_BIGFR_T_BIGZ_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
 {
        bigz_set_bigfr(ent_scratch_bigz, XBIGFR_DATA(number));
        return make_bigz_bz(ent_scratch_bigz);
@@ -1186,7 +1187,7 @@ _ent_lift_FLOAT_T_BIGFR_T(Lisp_Object number, ent_lift_args_t la)
 }
 
 static inline Lisp_Object
-_ent_lift_BIGFR_T_FLOAT_T(Lisp_Object number, ent_lift_args_t UNUSED(la))
+_ent_lift_BIGFR_T_FLOAT_T(Lisp_Object number, ent_lift_args_t SXE_UNUSED(la))
 {
        return make_float(bigfr_to_fpfloat(XBIGFR_DATA(number)));
 }
@@ -1598,8 +1599,8 @@ void init_ent_mpfr(void)
        Veuler_mascheroni = make_bigfr(0.0, 2048UL);
        mpfr_const_euler(XBIGFR_DATA(Veuler_mascheroni), GMP_RNDN);
 
-       Vpi = make_bigfr(0.0, 2048UL);
-       mpfr_const_pi(XBIGFR_DATA(Vpi), GMP_RNDN);
+       Vbigfr_pi = make_bigfr(0.0, 2048UL);
+       mpfr_const_pi(XBIGFR_DATA(Vbigfr_pi), GMP_RNDN);
 }
 
 void syms_of_ent_mpfr(void)
@@ -1619,7 +1620,7 @@ void vars_of_ent_mpfr(void)
        /* just some dummy values atm, to make the dumper smile */
        Veuler = make_int(1L);
        Veuler_mascheroni = make_int(1L);
-       Vpi = make_int(1L);
+       Vbigfr_pi = make_int(1L);
 
        DEFVAR_CONST_LISP("euler", &Veuler /*
 The value of Euler's constant e (2.7182818...).
@@ -1627,10 +1628,9 @@ The value of Euler's constant e (2.7182818...).
        DEFVAR_CONST_LISP("euler-mascheroni", &Veuler_mascheroni /*
 The value of the Euler-Mascheroni constant (0.5772156...).
                                                                 */);
-       DEFVAR_CONST_LISP("pi", &Vpi /*
+       DEFVAR_CONST_LISP("bigfr-pi", &Vbigfr_pi /*
 The value of pi (3.1415926...).
                                     */);
 
        Fprovide(intern("bigfr"));
 }
-