comparison src/unicode.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 3192994c49ca
comparison
equal deleted inserted replaced
5580:a0e81357194e 5581:56144c8593a8
1137 { 1137 {
1138 if (NILP (Vcurrent_jit_charset) || 1138 if (NILP (Vcurrent_jit_charset) ||
1139 (-1 == (i = get_free_codepoint(Vcurrent_jit_charset)))) 1139 (-1 == (i = get_free_codepoint(Vcurrent_jit_charset))))
1140 { 1140 {
1141 Ibyte setname[32]; 1141 Ibyte setname[32];
1142 int number_of_jit_charsets = XINT (Vnumber_of_jit_charsets); 1142 int number_of_jit_charsets = XFIXNUM (Vnumber_of_jit_charsets);
1143 Ascbyte last_jit_charset_final = XCHAR (Vlast_jit_charset_final); 1143 Ascbyte last_jit_charset_final = XCHAR (Vlast_jit_charset_final);
1144 1144
1145 /* This final byte shit is, umm, not that cool. */ 1145 /* This final byte shit is, umm, not that cool. */
1146 assert (last_jit_charset_final >= 0x30); 1146 assert (last_jit_charset_final >= 0x30);
1147 1147
1157 /* Set encode-as-utf-8 to t, to have this character set written 1157 /* Set encode-as-utf-8 to t, to have this character set written
1158 using UTF-8 escapes in escape-quoted and ctext. This 1158 using UTF-8 escapes in escape-quoted and ctext. This
1159 sidesteps the fact that our internal character -> Unicode 1159 sidesteps the fact that our internal character -> Unicode
1160 mapping is not stable from one invocation to the next. */ 1160 mapping is not stable from one invocation to the next. */
1161 nconc2 (list2(Qencode_as_utf_8, Qt), 1161 nconc2 (list2(Qencode_as_utf_8, Qt),
1162 nconc2 (list6(Qcolumns, make_int(1), Qchars, make_int(96), 1162 nconc2 (list6(Qcolumns, make_fixnum(1), Qchars, make_fixnum(96),
1163 Qdimension, make_int(2)), 1163 Qdimension, make_fixnum(2)),
1164 list6(Qregistries, Qunicode_registries, 1164 list6(Qregistries, Qunicode_registries,
1165 Qfinal, make_char(last_jit_charset_final), 1165 Qfinal, make_char(last_jit_charset_final),
1166 /* This CCL program is initialised in 1166 /* This CCL program is initialised in
1167 unicode.el. */ 1167 unicode.el. */
1168 Qccl_program, Qccl_encode_to_ucs_2)))); 1168 Qccl_program, Qccl_encode_to_ucs_2))));
1169 1169
1170 /* Record for the Unicode infrastructure that we've created 1170 /* Record for the Unicode infrastructure that we've created
1171 this character set. */ 1171 this character set. */
1172 Vnumber_of_jit_charsets = make_int (number_of_jit_charsets + 1); 1172 Vnumber_of_jit_charsets = make_fixnum (number_of_jit_charsets + 1);
1173 Vlast_jit_charset_final = make_char (last_jit_charset_final + 1); 1173 Vlast_jit_charset_final = make_char (last_jit_charset_final + 1);
1174 1174
1175 i = get_free_codepoint(Vcurrent_jit_charset); 1175 i = get_free_codepoint(Vcurrent_jit_charset);
1176 } 1176 }
1177 1177
1368 Lisp_Object charset; 1368 Lisp_Object charset;
1369 int ichar, unicode; 1369 int ichar, unicode;
1370 1370
1371 CHECK_CHAR (character); 1371 CHECK_CHAR (character);
1372 1372
1373 check_integer_range (code, Qzero, make_integer (EMACS_INT_MAX)); 1373 check_integer_range (code, Qzero, make_integer (MOST_POSITIVE_FIXNUM));
1374 1374
1375 unicode = XINT (code); 1375 unicode = XFIXNUM (code);
1376 ichar = XCHAR (character); 1376 ichar = XCHAR (character);
1377 charset = ichar_charset (ichar); 1377 charset = ichar_charset (ichar);
1378 1378
1379 /* The translations of ASCII, Control-1, and Latin-1 code points are 1379 /* The translations of ASCII, Control-1, and Latin-1 code points are
1380 hard-coded in ichar_to_unicode and unicode_to_ichar. 1380 hard-coded in ichar_to_unicode and unicode_to_ichar.
1406 */ 1406 */
1407 (character)) 1407 (character))
1408 { 1408 {
1409 CHECK_CHAR (character); 1409 CHECK_CHAR (character);
1410 #ifdef MULE 1410 #ifdef MULE
1411 return make_int (ichar_to_unicode (XCHAR (character))); 1411 return make_fixnum (ichar_to_unicode (XCHAR (character)));
1412 #else 1412 #else
1413 return Fchar_to_int (character); 1413 return Fchar_to_int (character);
1414 #endif /* MULE */ 1414 #endif /* MULE */
1415 } 1415 }
1416 1416
1444 #ifdef MULE 1444 #ifdef MULE
1445 Lisp_Object_dynarr *dyn; 1445 Lisp_Object_dynarr *dyn;
1446 int lbs[NUM_LEADING_BYTES]; 1446 int lbs[NUM_LEADING_BYTES];
1447 int c; 1447 int c;
1448 1448
1449 check_integer_range (code, Qzero, make_integer (EMACS_INT_MAX)); 1449 check_integer_range (code, Qzero, make_integer (MOST_POSITIVE_FIXNUM));
1450 c = XINT (code); 1450 c = XFIXNUM (code);
1451 { 1451 {
1452 EXTERNAL_LIST_LOOP_2 (elt, charsets) 1452 EXTERNAL_LIST_LOOP_2 (elt, charsets)
1453 Fget_charset (elt); 1453 Fget_charset (elt);
1454 } 1454 }
1455 1455
1470 if (ret == -1) 1470 if (ret == -1)
1471 return Qnil; 1471 return Qnil;
1472 return make_char (ret); 1472 return make_char (ret);
1473 } 1473 }
1474 #else 1474 #else
1475 check_integer_range (code, Qzero, make_integer (EMACS_INT_MAX)); 1475 check_integer_range (code, Qzero, make_integer (MOST_POSITIVE_FIXNUM));
1476 return Fint_to_char (code); 1476 return Fint_to_char (code);
1477 #endif /* MULE */ 1477 #endif /* MULE */
1478 } 1478 }
1479 1479
1480 #ifdef MULE 1480 #ifdef MULE
1529 1529
1530 CHECK_STRING (filename); 1530 CHECK_STRING (filename);
1531 charset = Fget_charset (charset); 1531 charset = Fget_charset (charset);
1532 if (!NILP (start)) 1532 if (!NILP (start))
1533 { 1533 {
1534 CHECK_INT (start); 1534 CHECK_FIXNUM (start);
1535 st = XINT (start); 1535 st = XFIXNUM (start);
1536 } 1536 }
1537 if (!NILP (end)) 1537 if (!NILP (end))
1538 { 1538 {
1539 CHECK_INT (end); 1539 CHECK_FIXNUM (end);
1540 en = XINT (end); 1540 en = XFIXNUM (end);
1541 } 1541 }
1542 if (!NILP (offset)) 1542 if (!NILP (offset))
1543 { 1543 {
1544 CHECK_INT (offset); 1544 CHECK_FIXNUM (offset);
1545 of = XINT (offset); 1545 of = XFIXNUM (offset);
1546 } 1546 }
1547 1547
1548 if (!LISTP (flags)) 1548 if (!LISTP (flags))
1549 flags = list1 (flags); 1549 flags = list1 (flags);
1550 1550
2890 /* Skip over the dash. */ 2890 /* Skip over the dash. */
2891 p++; 2891 p++;
2892 if (p == pend) break; 2892 if (p == pend) break;
2893 cend = itext_ichar (p); 2893 cend = itext_ichar (p);
2894 2894
2895 Fput_range_table (make_int (c), make_int (cend), value, 2895 Fput_range_table (make_fixnum (c), make_fixnum (cend), value,
2896 rtab); 2896 rtab);
2897 2897
2898 INC_IBYTEPTR (p); 2898 INC_IBYTEPTR (p);
2899 } 2899 }
2900 else 2900 else
2901 { 2901 {
2902 Fput_range_table (make_int (c), make_int (c), value, rtab); 2902 Fput_range_table (make_fixnum (c), make_fixnum (c), value, rtab);
2903 } 2903 }
2904 } 2904 }
2905 } 2905 }
2906 2906
2907 /* This function wouldn't be necessary if initialised range tables were 2907 /* This function wouldn't be necessary if initialised range tables were
2955 !(UNBOUNDP (XSYMBOL (Qquery_coding_clear_highlights)->function))) 2955 !(UNBOUNDP (XSYMBOL (Qquery_coding_clear_highlights)->function)))
2956 { 2956 {
2957 /* It's okay to call Lisp here, the only non-stack object we may have 2957 /* It's okay to call Lisp here, the only non-stack object we may have
2958 allocated up to this point is skip_chars_range_table, and that's 2958 allocated up to this point is skip_chars_range_table, and that's
2959 reachable from its entry in Vfixed_width_query_ranges_cache. */ 2959 reachable from its entry in Vfixed_width_query_ranges_cache. */
2960 call3 (Qquery_coding_clear_highlights, make_int (pos), make_int (end), 2960 call3 (Qquery_coding_clear_highlights, make_fixnum (pos), make_fixnum (end),
2961 wrap_buffer (buf)); 2961 wrap_buffer (buf));
2962 } 2962 }
2963 2963
2964 if (NILP (Vunicode_query_skip_chars)) 2964 if (NILP (Vunicode_query_skip_chars))
2965 { 2965 {
3006 3006
3007 while (pos < end) 3007 while (pos < end)
3008 { 3008 {
3009 Ichar ch = BYTE_BUF_FETCH_CHAR (buf, pos_byte); 3009 Ichar ch = BYTE_BUF_FETCH_CHAR (buf, pos_byte);
3010 if ((ch < 0x100 ? 1 : 3010 if ((ch < 0x100 ? 1 :
3011 (!EQ (Qnil, Fget_range_table (make_int (ch), skip_chars_range_table, 3011 (!EQ (Qnil, Fget_range_table (make_fixnum (ch), skip_chars_range_table,
3012 Qnil))))) 3012 Qnil)))))
3013 { 3013 {
3014 pos++; 3014 pos++;
3015 INC_BYTEBPOS (buf, pos_byte); 3015 INC_BYTEBPOS (buf, pos_byte);
3016 } 3016 }
3060 result = Fmake_range_table (Qstart_closed_end_open); 3060 result = Fmake_range_table (Qstart_closed_end_open);
3061 } 3061 }
3062 3062
3063 fail_range_end = pos; 3063 fail_range_end = pos;
3064 3064
3065 Fput_range_table (make_int (fail_range_start), 3065 Fput_range_table (make_fixnum (fail_range_start),
3066 make_int (fail_range_end), 3066 make_fixnum (fail_range_end),
3067 (previous_failed_reason 3067 (previous_failed_reason
3068 == query_coding_unencodable ? 3068 == query_coding_unencodable ?
3069 Qunencodable : Qinvalid_sequence), 3069 Qunencodable : Qinvalid_sequence),
3070 result); 3070 result);
3071 previous_failed_reason = query_coding_succeeded; 3071 previous_failed_reason = query_coding_succeeded;
3072 3072
3073 if (flags & QUERY_METHOD_HIGHLIGHT) 3073 if (flags & QUERY_METHOD_HIGHLIGHT)
3074 { 3074 {
3075 Lisp_Object extent 3075 Lisp_Object extent
3076 = Fmake_extent (make_int (fail_range_start), 3076 = Fmake_extent (make_fixnum (fail_range_start),
3077 make_int (fail_range_end), 3077 make_fixnum (fail_range_end),
3078 wrap_buffer (buf)); 3078 wrap_buffer (buf));
3079 3079
3080 Fset_extent_priority 3080 Fset_extent_priority
3081 (extent, make_int (2 + mouse_highlight_priority)); 3081 (extent, make_fixnum (2 + mouse_highlight_priority));
3082 Fset_extent_face (extent, Qquery_coding_warning_face); 3082 Fset_extent_face (extent, Qquery_coding_warning_face);
3083 } 3083 }
3084 } 3084 }
3085 } 3085 }
3086 } 3086 }
3205 { 3205 {
3206 Fprovide (intern ("unicode")); 3206 Fprovide (intern ("unicode"));
3207 3207
3208 #ifdef MULE 3208 #ifdef MULE
3209 staticpro (&Vnumber_of_jit_charsets); 3209 staticpro (&Vnumber_of_jit_charsets);
3210 Vnumber_of_jit_charsets = make_int (0); 3210 Vnumber_of_jit_charsets = make_fixnum (0);
3211 staticpro (&Vlast_jit_charset_final); 3211 staticpro (&Vlast_jit_charset_final);
3212 Vlast_jit_charset_final = make_char (0x30); 3212 Vlast_jit_charset_final = make_char (0x30);
3213 staticpro (&Vcharset_descr); 3213 staticpro (&Vcharset_descr);
3214 Vcharset_descr 3214 Vcharset_descr
3215 = build_defer_string ("Mule charset for otherwise unknown Unicode code points."); 3215 = build_defer_string ("Mule charset for otherwise unknown Unicode code points.");