diff src/number.c @ 5118:e0db3c197671 ben-lisp-object

merge up to latest default branch, doesn't compile yet
author Ben Wing <ben@xemacs.org>
date Sat, 26 Dec 2009 21:18:49 -0600
parents 3742ea8250b5 b5e1d4f6b66f
children 623d57b7fbe8
line wrap: on
line diff
--- a/src/number.c	Sat Dec 26 00:20:27 2009 -0600
+++ b/src/number.c	Sat Dec 26 21:18:49 2009 -0600
@@ -41,7 +41,7 @@
 bignum scratch_bignum, scratch_bignum2;
 #endif
 #ifdef HAVE_RATIO
-ratio scratch_ratio;
+ratio scratch_ratio, scratch_ratio2;
 #endif
 #ifdef HAVE_BIGFLOAT
 bigfloat scratch_bigfloat, scratch_bigfloat2;
@@ -106,7 +106,7 @@
   { XD_END }
 };
 
-DEFINE_BASIC_LISP_OBJECT ("bignum", bignum, 0, bignum_print,
+DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT ("bignum", bignum, 0, bignum_print,
 				     0, bignum_equal, bignum_hash,
 				     bignum_description, Lisp_Bignum);
 
@@ -183,9 +183,9 @@
   { XD_END }
 };
 
-DEFINE_NONDUMPABLE_BASIC_LISP_OBJECT ("ratio", ratio, 0, ratio_print,
-						 0, ratio_equal, ratio_hash,
-						 ratio_description, Lisp_Ratio);
+DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT ("ratio", ratio, 0, ratio_print,
+				      0, ratio_equal, ratio_hash,
+				      ratio_description, Lisp_Ratio);
 
 #endif /* HAVE_RATIO */
 
@@ -270,7 +270,7 @@
   { XD_END }
 };
 
-DEFINE_BASIC_LISP_OBJECT ("bigfloat", bigfloat, 0,
+DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT ("bigfloat", bigfloat, 0,
 				     bigfloat_print, 0,
 				     bigfloat_equal, bigfloat_hash,
 				     bigfloat_description, Lisp_Bigfloat);
@@ -408,9 +408,9 @@
     number = make_bignum_bg (XRATIO_NUMERATOR (number));
 #endif
 #ifdef HAVE_BIGNUM
-  if (BIGNUMP (number) && bignum_fits_int_p (XBIGNUM_DATA (number)))
+  if (BIGNUMP (number) && bignum_fits_emacs_int_p (XBIGNUM_DATA (number)))
     {
-      int n = bignum_to_int (XBIGNUM_DATA (number));
+      EMACS_INT n = bignum_to_emacs_int (XBIGNUM_DATA (number));
       if (NUMBER_FITS_IN_AN_EMACS_INT (n))
 	number = make_int (n);
     }
@@ -561,7 +561,7 @@
       switch (type)
 	{
 	case FIXNUM_T:
-	  return Ftruncate (number);
+	  return Ftruncate (number, Qnil);
 	case BIGNUM_T:
 #ifdef HAVE_BIGNUM
 	  bignum_set_double (scratch_bignum, XFLOAT_DATA (number));
@@ -853,6 +853,7 @@
 
 #ifdef HAVE_RATIO
       ratio_init (scratch_ratio);
+      ratio_init (scratch_ratio2);
 #endif
 
 #ifdef HAVE_BIGFLOAT