Mercurial > hg > xemacs-beta
diff src/syntax.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 | 85210c453a97 |
children |
line wrap: on
line diff
--- a/src/syntax.c Sat Oct 08 12:26:09 2011 +0100 +++ b/src/syntax.c Sun Oct 09 09:51:57 2011 +0100 @@ -194,8 +194,8 @@ { struct buffer *buf = decode_buffer (buffer, 0); struct syntax_cache *cache = buf->syntax_cache; - return list4 (cache->start, cache->end, make_int (cache->prev_change), - make_int (cache->next_change)); + return list4 (cache->start, cache->end, make_fixnum (cache->prev_change), + make_fixnum (cache->next_change)); } #endif /* DEBUG_XEMACS */ @@ -233,7 +233,7 @@ buf->mirror_syntax_table = XCHAR_TABLE (syntax_table)->mirror_table; syntax_cache_table_was_changed (buf); /* Indicate that this buffer now has a specified syntax table. */ - buf->local_var_flags |= XINT (buffer_local_flags.syntax_table); + buf->local_var_flags |= XFIXNUM (buffer_local_flags.syntax_table); return syntax_table; } @@ -292,8 +292,8 @@ if (BUFFERP (cache->object)) { /* make known region zero-length and reset insertion behavior */ - Fset_marker (cache->start, make_int (1), cache->object); - Fset_marker (cache->end, make_int (1), cache->object); + Fset_marker (cache->start, make_fixnum (1), cache->object); + Fset_marker (cache->end, make_fixnum (1), cache->object); Fset_marker_insertion_type (cache->start, Qnil); Fset_marker_insertion_type (cache->end, Qt); } @@ -301,8 +301,8 @@ If so, also reset tables. */ if (valid_everywhere) { - cache->prev_change = EMACS_INT_MIN; - cache->next_change = EMACS_INT_MAX; + cache->prev_change = MOST_NEGATIVE_FIXNUM; + cache->next_change = MOST_POSITIVE_FIXNUM; } else /* valid nowhere */ { @@ -490,13 +490,13 @@ then we can safely make the end closed, so it will take in newly inserted text. (If such an extent is inserted, we will be informed through signal_syntax_cache_extent_changed().) */ - Fset_marker (cache->start, make_int (cache->prev_change), cache->object); + Fset_marker (cache->start, make_fixnum (cache->prev_change), cache->object); Fset_marker_insertion_type (cache->start, at_begin && NILP (extent_at (prev, cache->object, Qsyntax_table, NULL, EXTENT_AT_AT, 0)) ? Qnil : Qt); - Fset_marker (cache->end, make_int (cache->next_change), cache->object); + Fset_marker (cache->end, make_fixnum (cache->next_change), cache->object); Fset_marker_insertion_type (cache->end, at_end && NILP (extent_at (next, cache->object, Qsyntax_table, @@ -513,10 +513,10 @@ update_mirror_syntax_if_dirty (cache->mirror_table); #endif /* NOT_WORTH_THE_EFFORT */ } - else if (CONSP (tmp_table) && INTP (XCAR (tmp_table))) + else if (CONSP (tmp_table) && FIXNUMP (XCAR (tmp_table))) { cache->source = syntax_source_property_code; - cache->syntax_code = XINT (XCAR (tmp_table)); + cache->syntax_code = XFIXNUM (XCAR (tmp_table)); } else { @@ -703,7 +703,7 @@ if (CONSP (code)) code2 = XCAR (code); - if (SYNTAX_FROM_CODE (XINT (code2)) == Sinherit) + if (SYNTAX_FROM_CODE (XFIXNUM (code2)) == Sinherit) code = get_char_table (ch, Vstandard_syntax_table); return CONSP (code) ? XCDR (code) : Qnil; @@ -867,8 +867,8 @@ n = 1; else { - CHECK_INT (count); - n = XINT (count); + CHECK_FIXNUM (count); + n = XFIXNUM (count); } val = scan_words (buf, BUF_PT (buf), n); @@ -1183,8 +1183,8 @@ n = 1; else { - CHECK_INT (count); - n = XINT (count); + CHECK_FIXNUM (count); + n = XFIXNUM (count); } from = BUF_PT (buf); @@ -1504,7 +1504,7 @@ return Qnil; signal_error_2 (Qscan_error, "Containing expression ends prematurely", - make_int (last_good), make_int (from)); + make_fixnum (last_good), make_fixnum (from)); } break; @@ -1678,7 +1678,7 @@ return Qnil; signal_error_2 (Qscan_error, "Containing expression ends prematurely", - make_int (last_good), make_int (from)); + make_fixnum (last_good), make_fixnum (from)); } break; @@ -1744,12 +1744,12 @@ } - return (make_int (from)); + return (make_fixnum (from)); lose: if (!noerror) signal_error_2 (Qscan_error, "Unbalanced parentheses", - make_int (last_good), make_int (from)); + make_fixnum (last_good), make_fixnum (from)); return Qnil; } @@ -1800,12 +1800,12 @@ { struct buffer *buf; - CHECK_INT (from); - CHECK_INT (count); - CHECK_INT (depth); + CHECK_FIXNUM (from); + CHECK_FIXNUM (count); + CHECK_FIXNUM (depth); buf = decode_buffer (buffer, 0); - return scan_lists (buf, XINT (from), XINT (count), XINT (depth), 0, + return scan_lists (buf, XFIXNUM (from), XFIXNUM (count), XFIXNUM (depth), 0, !NILP (noerror)); } @@ -1828,10 +1828,10 @@ (from, count, buffer, noerror)) { struct buffer *buf = decode_buffer (buffer, 0); - CHECK_INT (from); - CHECK_INT (count); + CHECK_FIXNUM (from); + CHECK_FIXNUM (count); - return scan_lists (buf, XINT (from), XINT (count), 0, 1, !NILP (noerror)); + return scan_lists (buf, XFIXNUM (from), XFIXNUM (count), 0, 1, !NILP (noerror)); } DEFUN ("backward-prefix-chars", Fbackward_prefix_chars, 0, 1, 0, /* @@ -1901,7 +1901,7 @@ { tem = Fcar (oldstate); /* elt 0, depth */ if (!NILP (tem)) - depth = XINT (tem); + depth = XFIXNUM (tem); else depth = 0; @@ -1910,7 +1910,7 @@ oldstate = Fcdr (oldstate); tem = Fcar (oldstate); /* elt 3, instring */ state.instring = ( !NILP (tem) - ? ( INTP (tem) ? XINT (tem) : ST_STRING_STYLE) + ? ( FIXNUMP (tem) ? XFIXNUM (tem) : ST_STRING_STYLE) : -1); oldstate = Fcdr (oldstate); @@ -1932,7 +1932,7 @@ oldstate = Fcdr (oldstate); /* elt 8, start of last comment/string */ tem = Fcar (oldstate); - state.comstr_start = NILP (tem) ? -1 : XINT (tem); + state.comstr_start = NILP (tem) ? -1 : XFIXNUM (tem); /* elt 9, char numbers of starts-of-expression of levels (starting from outermost). */ @@ -1942,10 +1942,10 @@ to change). */ while (!NILP (tem)) /* >= second enclosing sexps. */ { - curlevel->last = XINT (Fcar (tem)); + curlevel->last = XFIXNUM (Fcar (tem)); if (++curlevel == endlevel) stack_overflow ("Nesting too deep for parser", - make_int (curlevel - levelstart)); + make_fixnum (curlevel - levelstart)); curlevel->prev = -1; curlevel->last = -1; tem = Fcdr (tem); @@ -2088,7 +2088,7 @@ curlevel->last = from - 1; if (++curlevel == endlevel) stack_overflow ("Nesting too deep for parser", - make_int (curlevel - levelstart)); + make_fixnum (curlevel - levelstart)); curlevel->prev = -1; curlevel->last = -1; if (targetdepth == depth) goto done; @@ -2198,7 +2198,7 @@ state.location = from; state.levelstarts = Qnil; while (--curlevel >= levelstart) - state.levelstarts = Fcons (make_int (curlevel->last), + state.levelstarts = Fcons (make_fixnum (curlevel->last), state.levelstarts); *stateptr = state; @@ -2248,8 +2248,8 @@ if (!NILP (targetdepth)) { - CHECK_INT (targetdepth); - target = XINT (targetdepth); + CHECK_FIXNUM (targetdepth); + target = XFIXNUM (targetdepth); } else target = -100000; /* We won't reach this depth */ @@ -2265,21 +2265,21 @@ val = Qnil; val = Fcons (state.levelstarts, val); val = Fcons ((state.incomment || (state.instring >= 0)) - ? make_int (state.comstr_start) : Qnil, val); + ? make_fixnum (state.comstr_start) : Qnil, val); val = Fcons (state.comstyle ? (state.comstyle == ST_COMMENT_STYLE ? Qsyntax_table : Qt) : Qnil, val); - val = Fcons (make_int (state.mindepth), val); + val = Fcons (make_fixnum (state.mindepth), val); val = Fcons (state.quoted ? Qt : Qnil, val); val = Fcons (state.incomment ? Qt : Qnil, val); val = Fcons (state.instring < 0 ? Qnil : (state.instring == ST_STRING_STYLE - ? Qt : make_int (state.instring)), val); + ? Qt : make_fixnum (state.instring)), val); val = Fcons (state.thislevelstart < 0 ? Qnil : - make_int (state.thislevelstart), val); + make_fixnum (state.thislevelstart), val); val = Fcons (state.prevlevelstart < 0 ? Qnil : - make_int (state.prevlevelstart), val); - val = Fcons (make_int (state.depth), val); + make_fixnum (state.prevlevelstart), val); + val = Fcons (make_fixnum (state.depth), val); return val; } @@ -2310,7 +2310,7 @@ if (CONSP (val)) val = XCAR (val); - if (SYNTAX_FROM_CODE (XINT (val)) != Sinherit) + if (SYNTAX_FROM_CODE (XFIXNUM (val)) != Sinherit) put_char_table (mirrortab, range, val); return 0; } @@ -2323,7 +2323,7 @@ Lisp_Object mirrortab = GET_LISP_FROM_VOID (arg); if (CONSP (val)) val = XCAR (val); - if (SYNTAX_FROM_CODE (XINT (val)) != Sinherit) + if (SYNTAX_FROM_CODE (XFIXNUM (val)) != Sinherit) { Lisp_Object existing = updating_mirror_get_range_char_table (range, mirrortab, @@ -2372,7 +2372,7 @@ map_char_table (Vstandard_syntax_table, &range, copy_if_not_already_present, STORE_LISP_IN_VOID (mirrortab)); /* The resetting made the default be Qnil. Put it back to Sword. */ - set_char_table_default (mirrortab, make_int (Sword)); + set_char_table_default (mirrortab, make_fixnum (Sword)); XCHAR_TABLE (mirrortab)->dirty = 0; } @@ -2473,7 +2473,7 @@ define_standard_syntax (const UExtbyte *p, enum syntaxcode syn) { for (; *p; p++) - Fput_char_table (make_char (*p), make_int (syn), Vstandard_syntax_table); + Fput_char_table (make_char (*p), make_fixnum (syn), Vstandard_syntax_table); } void @@ -2485,7 +2485,7 @@ #define SET_RANGE_SYNTAX(start, end, syntax) \ do { \ for (i = start; i <= end; i++) \ - Fput_char_table(make_char(i), make_int(syntax), \ + Fput_char_table(make_char(i), make_fixnum(syntax), \ Vstandard_syntax_table); \ } while (0) @@ -2505,7 +2505,7 @@ staticpro (&Vsyntax_designator_chars_string); /* Default character syntax is word. */ - set_char_table_default (Vstandard_syntax_table, make_int (Sword)); + set_char_table_default (Vstandard_syntax_table, make_fixnum (Sword)); /* Control 0; treat as punctuation */ SET_RANGE_SYNTAX(0, 32, Spunct); @@ -2526,10 +2526,10 @@ for (p = (const UExtbyte *)"()[]{}"; *p; p+=2) { Fput_char_table (make_char (p[0]), - Fcons (make_int (Sopen), make_char (p[1])), + Fcons (make_fixnum (Sopen), make_char (p[1])), Vstandard_syntax_table); Fput_char_table (make_char (p[1]), - Fcons (make_int (Sclose), make_char (p[0])), + Fcons (make_fixnum (Sclose), make_char (p[0])), Vstandard_syntax_table); }