diff src/profile.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 0af042a0c116
children 3192994c49ca
line wrap: on
line diff
--- a/src/profile.c	Sat Oct 08 12:26:09 2011 +0100
+++ b/src/profile.c	Sun Oct 09 09:51:57 2011 +0100
@@ -203,9 +203,9 @@
 profile_sow_backtrace (struct backtrace *bt)
 {
   bt->current_total_timing_val =
-    XINT (Fgethash (*bt->function, Vtotal_timing_profile_table, Qzero));
+    XFIXNUM (Fgethash (*bt->function, Vtotal_timing_profile_table, Qzero));
   bt->current_total_gc_usage_val =
-    XINT (Fgethash (*bt->function, Vtotal_gc_usage_profile_table, Qzero));
+    XFIXNUM (Fgethash (*bt->function, Vtotal_gc_usage_profile_table, Qzero));
   bt->function_being_called = 1;
   /* Need to think carefully about the exact order of operations here
     so that we don't end up with totals being less than function-only
@@ -255,11 +255,11 @@
   Fputhash (*bt->function,
 	    /* This works even when the total_ticks value has overwrapped.
 	       Same for total_consing below. */
-	    make_int ((EMACS_INT) (ticks - bt->total_ticks_at_start)
+	    make_fixnum ((EMACS_INT) (ticks - bt->total_ticks_at_start)
 		      + bt->current_total_timing_val),
 	    Vtotal_timing_profile_table);
   Fputhash (*bt->function,
-	    make_int ((EMACS_INT)
+	    make_fixnum ((EMACS_INT)
 		      (total_consing - bt->total_consing_at_start)
 		       + bt->current_total_gc_usage_val),
 	    Vtotal_gc_usage_profile_table);
@@ -364,14 +364,14 @@
   else
     {
 #ifdef HAVE_BIGNUM
-      check_integer_range (microsecs, make_int (1000), make_integer (INT_MAX));
+      check_integer_range (microsecs, make_fixnum (1000), make_integer (INT_MAX));
       msecs =
         BIGNUMP (microsecs) ? bignum_to_int (XBIGNUM_DATA (microsecs)) :
-                                             XINT (microsecs);
+                                             XFIXNUM (microsecs);
 #else
-      check_integer_range (microsecs, make_int (1000),
-                           make_integer (EMACS_INT_MAX));
-      msecs = XINT (microsecs);
+      check_integer_range (microsecs, make_fixnum (1000),
+                           make_integer (MOST_POSITIVE_FIXNUM));
+      msecs = XFIXNUM (microsecs);
 #endif
     }
   if (msecs <= 0)
@@ -473,7 +473,7 @@
   key = GET_LISP_FROM_VOID (void_key);
   val = (EMACS_INT) void_val;
 
-  Fputhash (key, make_int (val), closure->timing);
+  Fputhash (key, make_fixnum (val), closure->timing);
   return 0;
 }
 
@@ -534,7 +534,7 @@
       if (!gethash (STORE_LISP_IN_VOID (QSprofile_overhead), big_profile_table,
 		    &overhead))
 	overhead = 0;
-      Fputhash (QSprofile_overhead, make_int ((EMACS_INT) overhead),
+      Fputhash (QSprofile_overhead, make_fixnum ((EMACS_INT) overhead),
 		Vtotal_timing_profile_table);
 
       unbind_to (count);
@@ -560,12 +560,12 @@
 				   void *UNUSED (void_closure))
 {
   /* This function does not GC */
-  if (!INTP (val))
+  if (!FIXNUMP (val))
     invalid_argument_2
       ("Function timing count is not an integer in given entry",
        key, val);
 
-  puthash (STORE_LISP_IN_VOID (key), (void *) XINT (val), big_profile_table);
+  puthash (STORE_LISP_IN_VOID (key), (void *) XFIXNUM (val), big_profile_table);
 
   return 0;
 }