Mercurial > hg > xemacs-beta
diff src/event-stream.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 | 4dee0387b9de |
children | 7371081ce8f7 |
line wrap: on
line diff
--- a/src/event-stream.c Sat Oct 08 12:26:09 2011 +0100 +++ b/src/event-stream.c Sun Oct 09 09:51:57 2011 +0100 @@ -715,7 +715,7 @@ if (echo_area_active (f) && !EQ (Qcommand, echo_area_status (f))) goto done; - if (INTP (Vecho_keystrokes) || FLOATP (Vecho_keystrokes)) + if (FIXNUMP (Vecho_keystrokes) || FLOATP (Vecho_keystrokes)) echo_keystrokes = extract_float (Vecho_keystrokes); else echo_keystrokes = 0; @@ -1236,10 +1236,10 @@ static unsigned long lisp_number_to_milliseconds (Lisp_Object secs, int allow_0) { - Lisp_Object args[] = { allow_0 ? Qzero : make_int (1), + Lisp_Object args[] = { allow_0 ? Qzero : make_fixnum (1), secs, /* (((unsigned int) 0xFFFFFFFF) / 1000) - 1 */ - make_int (4294967 - 1) }; + make_fixnum (4294967 - 1) }; if (!allow_0 && FLOATP (secs) && XFLOAT_DATA (secs) > 0) { @@ -1251,12 +1251,12 @@ args_out_of_range_3 (secs, args[0], args[2]); } - args[0] = make_int (1000); + args[0] = make_fixnum (1000); args[0] = Ftimes (2, args); - if (INTP (args[0])) + if (FIXNUMP (args[0])) { - return XINT (args[0]); + return XFIXNUM (args[0]); } return (unsigned long) extract_float (args[0]); @@ -1304,8 +1304,8 @@ int id; Lisp_Object lid; id = event_stream_generate_wakeup (msecs, msecs2, function, object, 0); - lid = make_int (id); - assert (id == XINT (lid)); + lid = make_fixnum (id); + assert (id == XFIXNUM (lid)); return lid; } @@ -1320,8 +1320,8 @@ */ (id)) { - CHECK_INT (id); - event_stream_disable_wakeup (XINT (id), 0); + CHECK_FIXNUM (id); + event_stream_disable_wakeup (XFIXNUM (id), 0); return Qnil; } @@ -1383,8 +1383,8 @@ int id; Lisp_Object lid; id = event_stream_generate_wakeup (msecs, msecs2, function, object, 1); - lid = make_int (id); - assert (id == XINT (lid)); + lid = make_fixnum (id); + assert (id == XFIXNUM (lid)); return lid; } @@ -1399,8 +1399,8 @@ */ (id)) { - CHECK_INT (id); - event_stream_disable_wakeup (XINT (id), 1); + CHECK_FIXNUM (id); + event_stream_disable_wakeup (XFIXNUM (id), 1); return Qnil; } @@ -1798,7 +1798,7 @@ if (!NILP (Vunread_command_event)) how_many--; - how_many -= XINT (Fsafe_length (Vunread_command_events)); + how_many -= XFIXNUM (Fsafe_length (Vunread_command_events)); if (how_many <= 0) return 1; @@ -2348,16 +2348,16 @@ EMACS_GET_TIME (t); if (!CONSP (Vlast_input_time)) Vlast_input_time = Fcons (Qnil, Qnil); - XCAR (Vlast_input_time) = make_int ((EMACS_SECS (t) >> 16) & 0xffff); - XCDR (Vlast_input_time) = make_int ((EMACS_SECS (t) >> 0) & 0xffff); + XCAR (Vlast_input_time) = make_fixnum ((EMACS_SECS (t) >> 16) & 0xffff); + XCDR (Vlast_input_time) = make_fixnum ((EMACS_SECS (t) >> 0) & 0xffff); if (!CONSP (Vlast_command_event_time)) Vlast_command_event_time = list3 (Qnil, Qnil, Qnil); XCAR (Vlast_command_event_time) = - make_int ((EMACS_SECS (t) >> 16) & 0xffff); + make_fixnum ((EMACS_SECS (t) >> 16) & 0xffff); XCAR (XCDR (Vlast_command_event_time)) = - make_int ((EMACS_SECS (t) >> 0) & 0xffff); + make_fixnum ((EMACS_SECS (t) >> 0) & 0xffff); XCAR (XCDR (XCDR (Vlast_command_event_time))) - = make_int (EMACS_USECS (t)); + = make_fixnum (EMACS_USECS (t)); } /* If this key came from the keyboard or from a keyboard macro, then it goes into the recent-keys and this-command-keys vectors. @@ -2626,8 +2626,8 @@ if (!NILP (timeout_msecs)) { check_integer_range (timeout_msecs, Qzero, - make_integer (EMACS_INT_MAX)); - msecs += XINT (timeout_msecs); + make_integer (MOST_POSITIVE_FIXNUM)); + msecs += XFIXNUM (timeout_msecs); } if (msecs) { @@ -2640,7 +2640,7 @@ count = specpdl_depth (); record_unwind_protect (sit_for_unwind, - timeout_enabled ? make_int (timeout_id) : Qnil); + timeout_enabled ? make_fixnum (timeout_id) : Qnil); recursive_sit_for = 1; while (!done && @@ -2704,7 +2704,7 @@ } } - unbind_to_1 (count, timeout_enabled ? make_int (timeout_id) : Qnil); + unbind_to_1 (count, timeout_enabled ? make_fixnum (timeout_id) : Qnil); Fdeallocate_event (event); @@ -2737,7 +2737,7 @@ event = Fmake_event (Qnil, Qnil); count = specpdl_depth (); - record_unwind_protect (sit_for_unwind, make_int (id)); + record_unwind_protect (sit_for_unwind, make_fixnum (id)); recursive_sit_for = 1; while (1) @@ -2771,7 +2771,7 @@ } } DONE_LABEL: - unbind_to_1 (count, make_int (id)); + unbind_to_1 (count, make_fixnum (id)); Fdeallocate_event (event); UNGCPRO; return Qnil; @@ -2843,7 +2843,7 @@ id = event_stream_generate_wakeup (msecs, 0, Qnil, Qnil, 0); count = specpdl_depth (); - record_unwind_protect (sit_for_unwind, make_int (id)); + record_unwind_protect (sit_for_unwind, make_fixnum (id)); recursive_sit_for = 1; while (1) @@ -2892,7 +2892,7 @@ } DONE_LABEL: - unbind_to_1 (count, make_int (id)); + unbind_to_1 (count, make_fixnum (id)); /* Put back the event (if any) that made Fsit_for() exit before the timeout. Note that it is being added to the back of the queue, which @@ -3717,7 +3717,7 @@ { check_integer_range (number, Qzero, make_integer (ARRAY_DIMENSION_LIMIT)); - nwanted = XINT (number); + nwanted = XFIXNUM (number); } /* Create the keys ring vector, if none present. */ @@ -3771,7 +3771,7 @@ */ ()) { - return make_int (recent_keys_ring_size); + return make_fixnum (recent_keys_ring_size); } DEFUN ("set-recent-keys-ring-size", Fset_recent_keys_ring_size, 1, 1, 0, /* @@ -3783,14 +3783,14 @@ int i, j, nkeys, start, min; struct gcpro gcpro1; - CHECK_INT (size); - if (XINT (size) <= 0) + CHECK_FIXNUM (size); + if (XFIXNUM (size) <= 0) invalid_argument ("Recent keys ring size must be positive", size); - if (XINT (size) == recent_keys_ring_size) + if (XFIXNUM (size) == recent_keys_ring_size) return size; GCPRO1 (new_vector); - new_vector = make_vector (XINT (size), Qnil); + new_vector = make_vector (XFIXNUM (size), Qnil); if (NILP (Vrecent_keys_ring)) { @@ -3810,10 +3810,10 @@ start = ((recent_keys_ring_index == nkeys) ? 0 : recent_keys_ring_index); } - if (XINT (size) > nkeys) + if (XFIXNUM (size) > nkeys) min = nkeys; else - min = XINT (size); + min = XFIXNUM (size); for (i = 0, j = start; i < min; i++) { @@ -3821,7 +3821,7 @@ if (++j >= recent_keys_ring_size) j = 0; } - recent_keys_ring_size = XINT (size); + recent_keys_ring_size = XFIXNUM (size); recent_keys_ring_index = (i < recent_keys_ring_size) ? i : 0; Vrecent_keys_ring = new_vector; @@ -4570,9 +4570,9 @@ if (NATNUMP (prop)) { magic_undo = 1; - if (INTP (prop)) + if (FIXNUMP (prop)) { - magic_undo_count = XINT (prop); + magic_undo_count = XFIXNUM (prop); } #ifdef HAVE_BIGNUM else if (BIGNUMP (prop) @@ -4873,7 +4873,7 @@ /* This junk is so that timestamps don't get to be negative, but contain as many bits as this particular emacs will allow. */ - return make_int (EMACS_INT_MAX & tiempo); + return make_fixnum (MOST_POSITIVE_FIXNUM & tiempo); } @@ -4989,7 +4989,7 @@ DEFVAR_LISP ("echo-keystrokes", &Vecho_keystrokes /* *Nonzero means echo unfinished commands after this many seconds of pause. */ ); - Vecho_keystrokes = make_int (1); + Vecho_keystrokes = make_fixnum (1); DEFVAR_INT ("auto-save-interval", &auto_save_interval /* *Number of keyboard input characters between auto-saves. @@ -5223,7 +5223,7 @@ This variable has no effect when `modifier-keys-are-sticky' is nil. Currently only implemented under X Window System. */ ); - Vmodifier_keys_sticky_time = make_int (500); + Vmodifier_keys_sticky_time = make_fixnum (500); Vcontrolling_terminal = Qnil; staticpro (&Vcontrolling_terminal);