diff src/number.c @ 5581:56144c8593a8

Mechanically change INT to FIXNUM in our sources. src/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT (where it refers to non-bignum Lisp integers) to FIXNUM in our sources. Done for the following functions, enums, and macros: Lisp_Type_Int_Even, Lisp_Type_Int_Odd, INT_GCBITS, INT_VALBITS, make_int(), INTP(), XINT(), CHECK_INT(), XREALINT(), INT_PLUS(), INT_MINUS(), EMACS_INT_MAX (to MOST_POSITIVE_FIXNUM), EMACS_INT_MIN (to MOST_NEGATIVE_FIXNUM), NUMBER_FITS_IN_AN_EMACS_INT() to NUMBER_FITS_IN_A_FIXNUM(), XFLOATINT, XCHAR_OR_INT, INT_OR_FLOAT. The EMACS_INT typedef was not changed, it does not describe non-bignum Lisp integers. Script that did the change available in http://mid.gmane.org/20067.17650.181273.12014@parhasard.net . modules/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers. See the src/ChangeLog entry for more details. man/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> * internals/internals.texi (How Lisp Objects Are Represented in C): * internals/internals.texi (Integers and Characters): Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 09 Oct 2011 09:51:57 +0100
parents 2aa9cd456ae7
children c9e5612f5424
line wrap: on
line diff
--- a/src/number.c	Sat Oct 08 12:26:09 2011 +0100
+++ b/src/number.c	Sun Oct 09 09:51:57 2011 +0100
@@ -250,7 +250,7 @@
 				   (XRATIO_DENOMINATOR (rational)));
     }
 #endif
-  return make_int (1);
+  return make_fixnum (1);
 }
 
 
@@ -332,7 +332,7 @@
   bignum_set_ulong (scratch_bignum, XBIGFLOAT_GET_PREC (f));
   return Fcanonicalize_number (make_bignum_bg (scratch_bignum));
 #else
-  return make_int ((int) XBIGFLOAT_GET_PREC (f));
+  return make_fixnum ((int) XBIGFLOAT_GET_PREC (f));
 #endif
 }
 
@@ -347,9 +347,9 @@
   unsigned long prec;
 
   CHECK_BIGFLOAT (f);
-  if (INTP (precision))
+  if (FIXNUMP (precision))
     {
-      prec = (XINT (precision) <= 0) ? 1UL : (unsigned long) XINT (precision);
+      prec = (XFIXNUM (precision) <= 0) ? 1UL : (unsigned long) XFIXNUM (precision);
     }
 #ifdef HAVE_BIGNUM
   else if (BIGNUMP (precision))
@@ -378,8 +378,8 @@
 
   CONCHECK_INTEGER (*val);
 #ifdef HAVE_BIGFLOAT
-  if (INTP (*val))
-    prec = XINT (*val);
+  if (FIXNUMP (*val))
+    prec = XFIXNUM (*val);
   else
     {
       if (!bignum_fits_ulong_p (XBIGNUM_DATA (*val)))
@@ -446,8 +446,8 @@
   if (BIGNUMP (number) && bignum_fits_emacs_int_p (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);
+      if (NUMBER_FITS_IN_A_FIXNUM (n))
+	number = make_fixnum (n);
     }
 #endif
   return number;
@@ -456,7 +456,7 @@
 enum number_type
 get_number_type (Lisp_Object arg)
 {
-  if (INTP (arg))
+  if (FIXNUMP (arg))
     return FIXNUM_T;
 #ifdef HAVE_BIGNUM
   if (BIGNUMP (arg))
@@ -492,9 +492,9 @@
   enum number_type current_type;
 
   if (CHARP (number))
-    number = make_int (XCHAR (number));
+    number = make_fixnum (XCHAR (number));
   else if (MARKERP (number))
-    number = make_int (marker_position (number));
+    number = make_fixnum (marker_position (number));
 
   /* Note that CHECK_NUMBER ensures that NUMBER is a supported type.  Hence,
      we ABORT() in the #else sections below, because it shouldn't be possible
@@ -510,21 +510,21 @@
 	  return number;
 	case BIGNUM_T:
 #ifdef HAVE_BIGNUM
-	  return make_bignum (XREALINT (number));
+	  return make_bignum (XREALFIXNUM (number));
 #else
 	  ABORT ();
 #endif /* HAVE_BIGNUM */
 	case RATIO_T:
 #ifdef HAVE_RATIO
-	  return make_ratio (XREALINT (number), 1UL);
+	  return make_ratio (XREALFIXNUM (number), 1UL);
 #else
 	  ABORT ();
 #endif /* HAVE_RATIO */
 	case FLOAT_T:
-	  return make_float (XREALINT (number));
+	  return make_float (XREALFIXNUM (number));
 	case BIGFLOAT_T:
 #ifdef HAVE_BIGFLOAT
-	  return make_bigfloat (XREALINT (number), precision);
+	  return make_bigfloat (XREALFIXNUM (number), precision);
 #else
 	  ABORT ();
 #endif /* HAVE_BIGFLOAT */
@@ -534,7 +534,7 @@
       switch (type)
 	{
 	case FIXNUM_T:
-	  return make_int (bignum_to_long (XBIGNUM_DATA (number)));
+	  return make_fixnum (bignum_to_long (XBIGNUM_DATA (number)));
 	case BIGNUM_T:
 	  return number;
 	case RATIO_T:
@@ -568,7 +568,7 @@
 	case FIXNUM_T:
 	  bignum_div (scratch_bignum, XRATIO_NUMERATOR (number),
 		      XRATIO_DENOMINATOR (number));
-	  return make_int (bignum_to_long (scratch_bignum));
+	  return make_fixnum (bignum_to_long (scratch_bignum));
 	case BIGNUM_T:
 	  bignum_div (scratch_bignum, XRATIO_NUMERATOR (number),
 		      XRATIO_DENOMINATOR (number));
@@ -627,7 +627,7 @@
       switch (type)
 	{
 	case FIXNUM_T:
-	  return make_int (bigfloat_to_long (XBIGFLOAT_DATA (number)));
+	  return make_fixnum (bigfloat_to_long (XBIGFLOAT_DATA (number)));
 	case BIGNUM_T:
 #ifdef HAVE_BIGNUM
 	  bignum_set_bigfloat (scratch_bignum, XBIGFLOAT_DATA (number));
@@ -666,13 +666,13 @@
   enum number_type type1, type2;
 
   if (CHARP (*arg1))
-    *arg1 = make_int (XCHAR (*arg1));
+    *arg1 = make_fixnum (XCHAR (*arg1));
   else if (MARKERP (*arg1))
-    *arg1 = make_int (marker_position (*arg1));
+    *arg1 = make_fixnum (marker_position (*arg1));
   if (CHARP (*arg2))
-    *arg2 = make_int (XCHAR (*arg2));
+    *arg2 = make_fixnum (XCHAR (*arg2));
   else if (MARKERP (*arg2))
-    *arg2 = make_int (marker_position (*arg2));
+    *arg2 = make_fixnum (marker_position (*arg2));
 
   CHECK_NUMBER (*arg1);
   CHECK_NUMBER (*arg2);
@@ -752,9 +752,9 @@
 	{
 	  CHECK_INTEGER (precision);
 #ifdef HAVE_BIGNUM
-	  if (INTP (precision))
+	  if (FIXNUMP (precision))
 #endif /* HAVE_BIGNUM */
-	    prec = (unsigned long) XREALINT (precision);
+	    prec = (unsigned long) XREALFIXNUM (precision);
 #ifdef HAVE_BIGNUM
 	  else
 	    {
@@ -824,7 +824,7 @@
 than `bigfloat-maximum-precision' to create Lisp bigfloat types with the
 indicated precision.
 */ default_float_precision_changed);
-  Vdefault_float_precision = make_int (0);
+  Vdefault_float_precision = make_fixnum (0);
 
   DEFVAR_CONST_LISP ("bigfloat-maximum-precision", &Vbigfloat_max_prec /*
 The maximum number of bits of precision a bigfloat can have.
@@ -834,9 +834,9 @@
 #ifdef HAVE_BIGFLOAT
   /* Don't create a bignum here.  Otherwise, we lose with NEW_GC + pdump.
      See reinit_vars_of_number(). */
-  Vbigfloat_max_prec = make_int (EMACS_INT_MAX);
+  Vbigfloat_max_prec = make_fixnum (MOST_POSITIVE_FIXNUM);
 #else
-  Vbigfloat_max_prec = make_int (0);
+  Vbigfloat_max_prec = make_fixnum (0);
 #endif /* HAVE_BIGFLOAT */
 
   Fprovide (intern ("number-types"));