comparison src/chartab.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 309e5631e4c8
children 3192994c49ca
comparison
equal deleted inserted replaced
5580:a0e81357194e 5581:56144c8593a8
157 nsubst_structures_descend)); 157 nsubst_structures_descend));
158 break; 158 break;
159 } 159 }
160 case CHARTAB_RANGE_ROW: 160 case CHARTAB_RANGE_ROW:
161 { 161 {
162 if (EQ (old, make_int (range->row)) == test_not_unboundp) 162 if (EQ (old, make_fixnum (range->row)) == test_not_unboundp)
163 { 163 {
164 CHECK_INT (new_); 164 CHECK_FIXNUM (new_);
165 changed.row = XINT (new_); 165 changed.row = XFIXNUM (new_);
166 166
167 put_char_table (table, range, Qunbound); 167 put_char_table (table, range, Qunbound);
168 put_char_table (table, &changed, value); 168 put_char_table (table, &changed, value);
169 } 169 }
170 break; 170 break;
362 if (vector_length (vec) != 2) 362 if (vector_length (vec) != 2)
363 sferror ("Length of charset row vector must be 2", 363 sferror ("Length of charset row vector must be 2",
364 range); 364 range);
365 outrange->type = CHARTAB_RANGE_ROW; 365 outrange->type = CHARTAB_RANGE_ROW;
366 outrange->charset = Fget_charset (elts[0]); 366 outrange->charset = Fget_charset (elts[0]);
367 CHECK_INT (elts[1]); 367 CHECK_FIXNUM (elts[1]);
368 outrange->row = XINT (elts[1]); 368 outrange->row = XFIXNUM (elts[1]);
369 switch (XCHARSET_TYPE (outrange->charset)) 369 switch (XCHARSET_TYPE (outrange->charset))
370 { 370 {
371 case CHARSET_TYPE_94: 371 case CHARSET_TYPE_94:
372 case CHARSET_TYPE_96: 372 case CHARSET_TYPE_96:
373 sferror ("Charset in row vector must be multi-byte", 373 sferror ("Charset in row vector must be multi-byte",
374 outrange->charset); 374 outrange->charset);
375 case CHARSET_TYPE_94X94: 375 case CHARSET_TYPE_94X94:
376 check_integer_range (make_int (outrange->row), make_int (33), 376 check_integer_range (make_fixnum (outrange->row), make_fixnum (33),
377 make_int (126)); 377 make_fixnum (126));
378 break; 378 break;
379 case CHARSET_TYPE_96X96: 379 case CHARSET_TYPE_96X96:
380 check_integer_range (make_int (outrange->row), make_int (32), 380 check_integer_range (make_fixnum (outrange->row), make_fixnum (32),
381 make_int (127)); 381 make_fixnum (127));
382 break; 382 break;
383 default: 383 default:
384 ABORT (); 384 ABORT ();
385 } 385 }
386 } 386 }
407 case CHARTAB_RANGE_CHARSET: 407 case CHARTAB_RANGE_CHARSET:
408 return XCHARSET_NAME (Fget_charset (range->charset)); 408 return XCHARSET_NAME (Fget_charset (range->charset));
409 409
410 case CHARTAB_RANGE_ROW: 410 case CHARTAB_RANGE_ROW:
411 return vector2 (XCHARSET_NAME (Fget_charset (range->charset)), 411 return vector2 (XCHARSET_NAME (Fget_charset (range->charset)),
412 make_int (range->row)); 412 make_fixnum (range->row));
413 #endif 413 #endif
414 case CHARTAB_RANGE_CHAR: 414 case CHARTAB_RANGE_CHAR:
415 return make_char (range->ch); 415 return make_char (range->ch);
416 default: 416 default:
417 ABORT (); 417 ABORT ();
729 if (ty == CHAR_TABLE_TYPE_SYNTAX) 729 if (ty == CHAR_TABLE_TYPE_SYNTAX)
730 { 730 {
731 /* Qgeneric not Qsyntax because a syntax table has a mirror table 731 /* Qgeneric not Qsyntax because a syntax table has a mirror table
732 and we don't want infinite recursion */ 732 and we don't want infinite recursion */
733 ct->mirror_table = Fmake_char_table (Qgeneric); 733 ct->mirror_table = Fmake_char_table (Qgeneric);
734 set_char_table_default (ct->mirror_table, make_int (Sword)); 734 set_char_table_default (ct->mirror_table, make_fixnum (Sword));
735 XCHAR_TABLE (ct->mirror_table)->mirror_table_p = 1; 735 XCHAR_TABLE (ct->mirror_table)->mirror_table_p = 1;
736 XCHAR_TABLE (ct->mirror_table)->mirror_table = obj; 736 XCHAR_TABLE (ct->mirror_table)->mirror_table = obj;
737 } 737 }
738 else 738 else
739 ct->mirror_table = Qnil; 739 ct->mirror_table = Qnil;
830 #endif /* MULE */ 830 #endif /* MULE */
831 831
832 if (!EQ (ct->mirror_table, Qnil)) 832 if (!EQ (ct->mirror_table, Qnil))
833 { 833 {
834 ctnew->mirror_table = Fmake_char_table (Qgeneric); 834 ctnew->mirror_table = Fmake_char_table (Qgeneric);
835 set_char_table_default (ctnew->mirror_table, make_int (Sword)); 835 set_char_table_default (ctnew->mirror_table, make_fixnum (Sword));
836 XCHAR_TABLE (ctnew->mirror_table)->mirror_table = obj; 836 XCHAR_TABLE (ctnew->mirror_table)->mirror_table = obj;
837 XCHAR_TABLE (ctnew->mirror_table)->mirror_table_p = 1; 837 XCHAR_TABLE (ctnew->mirror_table)->mirror_table_p = 1;
838 XCHAR_TABLE (ctnew->mirror_table)->dirty = 1; 838 XCHAR_TABLE (ctnew->mirror_table)->dirty = 1;
839 } 839 }
840 else 840 else
1074 { 1074 {
1075 switch (type) 1075 switch (type)
1076 { 1076 {
1077 case CHAR_TABLE_TYPE_SYNTAX: 1077 case CHAR_TABLE_TYPE_SYNTAX:
1078 if (!ERRB_EQ (errb, ERROR_ME)) 1078 if (!ERRB_EQ (errb, ERROR_ME))
1079 return INTP (value) || (CONSP (value) && INTP (XCAR (value)) 1079 return FIXNUMP (value) || (CONSP (value) && FIXNUMP (XCAR (value))
1080 && CHAR_OR_CHAR_INTP (XCDR (value))); 1080 && CHAR_OR_CHAR_INTP (XCDR (value)));
1081 if (CONSP (value)) 1081 if (CONSP (value))
1082 { 1082 {
1083 Lisp_Object cdr = XCDR (value); 1083 Lisp_Object cdr = XCDR (value);
1084 CHECK_INT (XCAR (value)); 1084 CHECK_FIXNUM (XCAR (value));
1085 CHECK_CHAR_COERCE_INT (cdr); 1085 CHECK_CHAR_COERCE_INT (cdr);
1086 } 1086 }
1087 else 1087 else
1088 CHECK_INT (value); 1088 CHECK_FIXNUM (value);
1089 break; 1089 break;
1090 1090
1091 #ifdef MULE 1091 #ifdef MULE
1092 case CHAR_TABLE_TYPE_CATEGORY: 1092 case CHAR_TABLE_TYPE_CATEGORY:
1093 if (!ERRB_EQ (errb, ERROR_ME)) 1093 if (!ERRB_EQ (errb, ERROR_ME))
1851 Lisp_Object ctbl; 1851 Lisp_Object ctbl;
1852 Ichar ch; 1852 Ichar ch;
1853 int des; 1853 int des;
1854 struct buffer *buf = decode_buffer (buffer, 0); 1854 struct buffer *buf = decode_buffer (buffer, 0);
1855 1855
1856 CHECK_INT (position); 1856 CHECK_FIXNUM (position);
1857 CHECK_CATEGORY_DESIGNATOR (designator); 1857 CHECK_CATEGORY_DESIGNATOR (designator);
1858 des = XCHAR (designator); 1858 des = XCHAR (designator);
1859 ctbl = check_category_table (category_table, buf->category_table); 1859 ctbl = check_category_table (category_table, buf->category_table);
1860 ch = BUF_FETCH_CHAR (buf, XINT (position)); 1860 ch = BUF_FETCH_CHAR (buf, XFIXNUM (position));
1861 return check_category_char (ch, ctbl, des, 0) ? Qt : Qnil; 1861 return check_category_char (ch, ctbl, des, 0) ? Qt : Qnil;
1862 } 1862 }
1863 1863
1864 DEFUN ("char-in-category-p", Fchar_in_category_p, 2, 3, 0, /* 1864 DEFUN ("char-in-category-p", Fchar_in_category_p, 2, 3, 0, /*
1865 Return non-nil if category of CHARACTER includes DESIGNATOR. 1865 Return non-nil if category of CHARACTER includes DESIGNATOR.
1920 { 1920 {
1921 struct buffer *buf = decode_buffer (buffer, 0); 1921 struct buffer *buf = decode_buffer (buffer, 0);
1922 category_table = check_category_table (category_table, Qnil); 1922 category_table = check_category_table (category_table, Qnil);
1923 buf->category_table = category_table; 1923 buf->category_table = category_table;
1924 /* Indicate that this buffer now has a specified category table. */ 1924 /* Indicate that this buffer now has a specified category table. */
1925 buf->local_var_flags |= XINT (buffer_local_flags.category_table); 1925 buf->local_var_flags |= XFIXNUM (buffer_local_flags.category_table);
1926 return category_table; 1926 return category_table;
1927 } 1927 }
1928 1928
1929 DEFUN ("category-designator-p", Fcategory_designator_p, 1, 1, 0, /* 1929 DEFUN ("category-designator-p", Fcategory_designator_p, 1, 1, 0, /*
1930 Return t if OBJECT is a category designator (a char in the range ' ' to '~'). 1930 Return t if OBJECT is a category designator (a char in the range ' ' to '~').