comparison src/rangetab.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 58b38d5b32d0
children
comparison
equal deleted inserted replaced
5580:a0e81357194e 5581:56144c8593a8
472 Lisp_Range_Table *rt; 472 Lisp_Range_Table *rt;
473 473
474 CHECK_RANGE_TABLE (range_table); 474 CHECK_RANGE_TABLE (range_table);
475 rt = XRANGE_TABLE (range_table); 475 rt = XRANGE_TABLE (range_table);
476 476
477 CHECK_INT_COERCE_CHAR (pos); 477 CHECK_FIXNUM_COERCE_CHAR (pos);
478 478
479 return get_range_table (XINT (pos), gap_array_length (rt->entries), 479 return get_range_table (XFIXNUM (pos), gap_array_length (rt->entries),
480 gap_array_begin (rt->entries, 480 gap_array_begin (rt->entries,
481 struct range_table_entry), 481 struct range_table_entry),
482 gap_array_gappos (rt->entries), 482 gap_array_gappos (rt->entries),
483 gap_array_gapsize (rt->entries), 483 gap_array_gapsize (rt->entries),
484 default_); 484 default_);
710 (start, end, value, range_table)) 710 (start, end, value, range_table))
711 { 711 {
712 EMACS_INT first, last; 712 EMACS_INT first, last;
713 713
714 CHECK_RANGE_TABLE (range_table); 714 CHECK_RANGE_TABLE (range_table);
715 CHECK_INT_COERCE_CHAR (start); 715 CHECK_FIXNUM_COERCE_CHAR (start);
716 first = XINT (start); 716 first = XFIXNUM (start);
717 CHECK_INT_COERCE_CHAR (end); 717 CHECK_FIXNUM_COERCE_CHAR (end);
718 last = XINT (end); 718 last = XFIXNUM (end);
719 if (first > last) 719 if (first > last)
720 invalid_argument_2 ("start must be <= end", start, end); 720 invalid_argument_2 ("start must be <= end", start, end);
721 721
722 put_range_table (range_table, first, last, value); 722 put_range_table (range_table, first, last, value);
723 verify_range_table (XRANGE_TABLE (range_table)); 723 verify_range_table (XRANGE_TABLE (range_table));
780 /* Fix up the numbers in accordance with the open/closedness of the 780 /* Fix up the numbers in accordance with the open/closedness of the
781 table. */ 781 table. */
782 { 782 {
783 EMACS_INT premier = first, dernier = last; 783 EMACS_INT premier = first, dernier = last;
784 internal_to_external_adjust_ends (rt->type, &premier, &dernier); 784 internal_to_external_adjust_ends (rt->type, &premier, &dernier);
785 args[1] = make_int (premier); 785 args[1] = make_fixnum (premier);
786 args[2] = make_int (dernier); 786 args[2] = make_fixnum (dernier);
787 } 787 }
788 args[3] = entry.val; 788 args[3] = entry.val;
789 Ffuncall (countof (args), args); 789 Ffuncall (countof (args), args);
790 /* Has FUNCTION removed the entry? */ 790 /* Has FUNCTION removed the entry? */
791 if (oldlen > gap_array_length (rt->entries) 791 if (oldlen > gap_array_length (rt->entries)
816 Error_Behavior UNUSED (errb)) 816 Error_Behavior UNUSED (errb))
817 { 817 {
818 /* #### should deal with ERRB */ 818 /* #### should deal with ERRB */
819 EXTERNAL_PROPERTY_LIST_LOOP_3 (range, data, value) 819 EXTERNAL_PROPERTY_LIST_LOOP_3 (range, data, value)
820 { 820 {
821 if (!INTP (range) && !CHARP (range) 821 if (!FIXNUMP (range) && !CHARP (range)
822 && !(CONSP (range) && CONSP (XCDR (range)) 822 && !(CONSP (range) && CONSP (XCDR (range))
823 && NILP (XCDR (XCDR (range))) 823 && NILP (XCDR (XCDR (range)))
824 && (INTP (XCAR (range)) || CHARP (XCAR (range))) 824 && (FIXNUMP (XCAR (range)) || CHARP (XCAR (range)))
825 && (INTP (XCAR (XCDR (range))) || CHARP (XCAR (XCDR (range)))))) 825 && (FIXNUMP (XCAR (XCDR (range))) || CHARP (XCAR (XCDR (range))))))
826 sferror ("Invalid range format", range); 826 sferror ("Invalid range format", range);
827 } 827 }
828 828
829 return 1; 829 return 1;
830 } 830 }