diff options
| author | Stefan Monnier | 2007-09-27 18:49:57 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-09-27 18:49:57 +0000 |
| commit | 83155776d1ebb1e0560864638b8281dca9cfd203 (patch) | |
| tree | 1438f02a7defdeeede390d1413a5dc5b4dc0aae7 /src | |
| parent | bdf5f8ef91c0d481134603d0840c07debc32db01 (diff) | |
| download | emacs-83155776d1ebb1e0560864638b8281dca9cfd203.tar.gz emacs-83155776d1ebb1e0560864638b8281dca9cfd203.zip | |
* indent.h:
* indent.c: Use EMACS_INT for ints coming from Elisp data.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/indent.c | 101 | ||||
| -rw-r--r-- | src/indent.h | 32 | ||||
| -rw-r--r-- | src/xdisp.c | 3 |
4 files changed, 75 insertions, 64 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6d591b6d1a3..20bc0a38762 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2007-09-27 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2007-09-27 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * indent.h: | ||
| 4 | * indent.c: Use EMACS_INT for ints coming from Elisp data. | ||
| 5 | |||
| 3 | * indent.c (Fmove_to_column): Use EMACS_INT for buffer positions. | 6 | * indent.c (Fmove_to_column): Use EMACS_INT for buffer positions. |
| 4 | 7 | ||
| 5 | 2007-09-25 Jason Rumney <jasonr@gnu.org> | 8 | 2007-09-25 Jason Rumney <jasonr@gnu.org> |
diff --git a/src/indent.c b/src/indent.c index c07073347e2..fb7ff5ab550 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -53,7 +53,7 @@ double last_known_column; | |||
| 53 | 53 | ||
| 54 | /* Value of point when current_column was called. */ | 54 | /* Value of point when current_column was called. */ |
| 55 | 55 | ||
| 56 | int last_known_column_point; | 56 | EMACS_INT last_known_column_point; |
| 57 | 57 | ||
| 58 | /* Value of MODIFF when current_column was called. */ | 58 | /* Value of MODIFF when current_column was called. */ |
| 59 | 59 | ||
| @@ -65,7 +65,7 @@ static double position_indentation P_ ((int)); | |||
| 65 | /* Cache of beginning of line found by the last call of | 65 | /* Cache of beginning of line found by the last call of |
| 66 | current_column. */ | 66 | current_column. */ |
| 67 | 67 | ||
| 68 | int current_column_bol_cache; | 68 | static EMACS_INT current_column_bol_cache; |
| 69 | 69 | ||
| 70 | /* Get the display table to use for the current buffer. */ | 70 | /* Get the display table to use for the current buffer. */ |
| 71 | 71 | ||
| @@ -214,16 +214,17 @@ width_run_cache_on_off () | |||
| 214 | characters immediately following, then *NEXT_BOUNDARY_P | 214 | characters immediately following, then *NEXT_BOUNDARY_P |
| 215 | will equal the return value. */ | 215 | will equal the return value. */ |
| 216 | 216 | ||
| 217 | int | 217 | EMACS_INT |
| 218 | skip_invisible (pos, next_boundary_p, to, window) | 218 | skip_invisible (pos, next_boundary_p, to, window) |
| 219 | int pos; | 219 | EMACS_INT pos; |
| 220 | int *next_boundary_p; | 220 | EMACS_INT *next_boundary_p; |
| 221 | int to; | 221 | EMACS_INT to; |
| 222 | Lisp_Object window; | 222 | Lisp_Object window; |
| 223 | { | 223 | { |
| 224 | Lisp_Object prop, position, overlay_limit, proplimit; | 224 | Lisp_Object prop, position, overlay_limit, proplimit; |
| 225 | Lisp_Object buffer, tmp; | 225 | Lisp_Object buffer, tmp; |
| 226 | int end, inv_p; | 226 | EMACS_INT end; |
| 227 | int inv_p; | ||
| 227 | 228 | ||
| 228 | XSETFASTINT (position, pos); | 229 | XSETFASTINT (position, pos); |
| 229 | XSETBUFFER (buffer, current_buffer); | 230 | XSETBUFFER (buffer, current_buffer); |
| @@ -510,16 +511,16 @@ current_column () | |||
| 510 | static double | 511 | static double |
| 511 | current_column_1 () | 512 | current_column_1 () |
| 512 | { | 513 | { |
| 513 | register int tab_width = XINT (current_buffer->tab_width); | 514 | register EMACS_INT tab_width = XINT (current_buffer->tab_width); |
| 514 | register int ctl_arrow = !NILP (current_buffer->ctl_arrow); | 515 | register int ctl_arrow = !NILP (current_buffer->ctl_arrow); |
| 515 | register struct Lisp_Char_Table *dp = buffer_display_table (); | 516 | register struct Lisp_Char_Table *dp = buffer_display_table (); |
| 516 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); | 517 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); |
| 517 | 518 | ||
| 518 | /* Start the scan at the beginning of this line with column number 0. */ | 519 | /* Start the scan at the beginning of this line with column number 0. */ |
| 519 | register int col = 0; | 520 | register EMACS_INT col = 0; |
| 520 | int scan, scan_byte; | 521 | EMACS_INT scan, scan_byte; |
| 521 | int next_boundary; | 522 | EMACS_INT next_boundary; |
| 522 | int opoint = PT, opoint_byte = PT_BYTE; | 523 | EMACS_INT opoint = PT, opoint_byte = PT_BYTE; |
| 523 | 524 | ||
| 524 | scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -1, 1); | 525 | scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -1, 1); |
| 525 | current_column_bol_cache = PT; | 526 | current_column_bol_cache = PT; |
| @@ -808,13 +809,13 @@ static double | |||
| 808 | position_indentation (pos_byte) | 809 | position_indentation (pos_byte) |
| 809 | register int pos_byte; | 810 | register int pos_byte; |
| 810 | { | 811 | { |
| 811 | register int column = 0; | 812 | register EMACS_INT column = 0; |
| 812 | register int tab_width = XINT (current_buffer->tab_width); | 813 | register EMACS_INT tab_width = XINT (current_buffer->tab_width); |
| 813 | register unsigned char *p; | 814 | register unsigned char *p; |
| 814 | register unsigned char *stop; | 815 | register unsigned char *stop; |
| 815 | unsigned char *start; | 816 | unsigned char *start; |
| 816 | int next_boundary_byte = pos_byte; | 817 | EMACS_INT next_boundary_byte = pos_byte; |
| 817 | int ceiling = next_boundary_byte; | 818 | EMACS_INT ceiling = next_boundary_byte; |
| 818 | 819 | ||
| 819 | if (tab_width <= 0 || tab_width > 1000) tab_width = 8; | 820 | if (tab_width <= 0 || tab_width > 1000) tab_width = 8; |
| 820 | 821 | ||
| @@ -829,7 +830,7 @@ position_indentation (pos_byte) | |||
| 829 | { | 830 | { |
| 830 | while (p == stop) | 831 | while (p == stop) |
| 831 | { | 832 | { |
| 832 | int stop_pos_byte; | 833 | EMACS_INT stop_pos_byte; |
| 833 | 834 | ||
| 834 | /* If we have updated P, set POS_BYTE to match. | 835 | /* If we have updated P, set POS_BYTE to match. |
| 835 | The first time we enter the loop, POS_BYTE is already right. */ | 836 | The first time we enter the loop, POS_BYTE is already right. */ |
| @@ -840,8 +841,8 @@ position_indentation (pos_byte) | |||
| 840 | return column; | 841 | return column; |
| 841 | if (pos_byte == next_boundary_byte) | 842 | if (pos_byte == next_boundary_byte) |
| 842 | { | 843 | { |
| 843 | int next_boundary; | 844 | EMACS_INT next_boundary; |
| 844 | int pos = BYTE_TO_CHAR (pos_byte); | 845 | EMACS_INT pos = BYTE_TO_CHAR (pos_byte); |
| 845 | pos = skip_invisible (pos, &next_boundary, ZV, Qnil); | 846 | pos = skip_invisible (pos, &next_boundary, ZV, Qnil); |
| 846 | pos_byte = CHAR_TO_BYTE (pos); | 847 | pos_byte = CHAR_TO_BYTE (pos); |
| 847 | next_boundary_byte = CHAR_TO_BYTE (next_boundary); | 848 | next_boundary_byte = CHAR_TO_BYTE (next_boundary); |
| @@ -1190,19 +1191,19 @@ struct position val_compute_motion; | |||
| 1190 | 1191 | ||
| 1191 | struct position * | 1192 | struct position * |
| 1192 | compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, hscroll, tab_offset, win) | 1193 | compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, hscroll, tab_offset, win) |
| 1193 | int from, fromvpos, fromhpos, to, tovpos, tohpos; | 1194 | EMACS_INT from, fromvpos, fromhpos, to, tovpos, tohpos; |
| 1194 | int did_motion; | 1195 | EMACS_INT did_motion; |
| 1195 | register int width; | 1196 | EMACS_INT width; |
| 1196 | int hscroll, tab_offset; | 1197 | EMACS_INT hscroll, tab_offset; |
| 1197 | struct window *win; | 1198 | struct window *win; |
| 1198 | { | 1199 | { |
| 1199 | register int hpos = fromhpos; | 1200 | register EMACS_INT hpos = fromhpos; |
| 1200 | register int vpos = fromvpos; | 1201 | register EMACS_INT vpos = fromvpos; |
| 1201 | 1202 | ||
| 1202 | register int pos; | 1203 | register EMACS_INT pos; |
| 1203 | int pos_byte; | 1204 | EMACS_INT pos_byte; |
| 1204 | register int c = 0; | 1205 | register int c = 0; |
| 1205 | register int tab_width = XFASTINT (current_buffer->tab_width); | 1206 | register EMACS_INT tab_width = XFASTINT (current_buffer->tab_width); |
| 1206 | register int ctl_arrow = !NILP (current_buffer->ctl_arrow); | 1207 | register int ctl_arrow = !NILP (current_buffer->ctl_arrow); |
| 1207 | register struct Lisp_Char_Table *dp = window_display_table (win); | 1208 | register struct Lisp_Char_Table *dp = window_display_table (win); |
| 1208 | int selective | 1209 | int selective |
| @@ -1214,33 +1215,33 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, | |||
| 1214 | ? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0); | 1215 | ? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0); |
| 1215 | /* The next location where the `invisible' property changes, or an | 1216 | /* The next location where the `invisible' property changes, or an |
| 1216 | overlay starts or ends. */ | 1217 | overlay starts or ends. */ |
| 1217 | int next_boundary = from; | 1218 | EMACS_INT next_boundary = from; |
| 1218 | 1219 | ||
| 1219 | /* For computing runs of characters with similar widths. | 1220 | /* For computing runs of characters with similar widths. |
| 1220 | Invariant: width_run_width is zero, or all the characters | 1221 | Invariant: width_run_width is zero, or all the characters |
| 1221 | from width_run_start to width_run_end have a fixed width of | 1222 | from width_run_start to width_run_end have a fixed width of |
| 1222 | width_run_width. */ | 1223 | width_run_width. */ |
| 1223 | int width_run_start = from; | 1224 | EMACS_INT width_run_start = from; |
| 1224 | int width_run_end = from; | 1225 | EMACS_INT width_run_end = from; |
| 1225 | int width_run_width = 0; | 1226 | EMACS_INT width_run_width = 0; |
| 1226 | Lisp_Object *width_table; | 1227 | Lisp_Object *width_table; |
| 1227 | Lisp_Object buffer; | 1228 | Lisp_Object buffer; |
| 1228 | 1229 | ||
| 1229 | /* The next buffer pos where we should consult the width run cache. */ | 1230 | /* The next buffer pos where we should consult the width run cache. */ |
| 1230 | int next_width_run = from; | 1231 | EMACS_INT next_width_run = from; |
| 1231 | Lisp_Object window; | 1232 | Lisp_Object window; |
| 1232 | 1233 | ||
| 1233 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); | 1234 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); |
| 1234 | /* If previous char scanned was a wide character, | 1235 | /* If previous char scanned was a wide character, |
| 1235 | this is the column where it ended. Otherwise, this is 0. */ | 1236 | this is the column where it ended. Otherwise, this is 0. */ |
| 1236 | int wide_column_end_hpos = 0; | 1237 | EMACS_INT wide_column_end_hpos = 0; |
| 1237 | int prev_pos; /* Previous buffer position. */ | 1238 | EMACS_INT prev_pos; /* Previous buffer position. */ |
| 1238 | int prev_pos_byte; /* Previous buffer position. */ | 1239 | EMACS_INT prev_pos_byte; /* Previous buffer position. */ |
| 1239 | int prev_hpos = 0; | 1240 | EMACS_INT prev_hpos = 0; |
| 1240 | int prev_vpos = 0; | 1241 | EMACS_INT prev_vpos = 0; |
| 1241 | int contin_hpos; /* HPOS of last column of continued line. */ | 1242 | EMACS_INT contin_hpos; /* HPOS of last column of continued line. */ |
| 1242 | int prev_tab_offset; /* Previous tab offset. */ | 1243 | EMACS_INT prev_tab_offset; /* Previous tab offset. */ |
| 1243 | int continuation_glyph_width; | 1244 | EMACS_INT continuation_glyph_width; |
| 1244 | 1245 | ||
| 1245 | XSETBUFFER (buffer, current_buffer); | 1246 | XSETBUFFER (buffer, current_buffer); |
| 1246 | XSETWINDOW (window, win); | 1247 | XSETWINDOW (window, win); |
| @@ -1286,8 +1287,8 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, | |||
| 1286 | { | 1287 | { |
| 1287 | while (pos == next_boundary) | 1288 | while (pos == next_boundary) |
| 1288 | { | 1289 | { |
| 1289 | int pos_here = pos; | 1290 | EMACS_INT pos_here = pos; |
| 1290 | int newpos; | 1291 | EMACS_INT newpos; |
| 1291 | 1292 | ||
| 1292 | /* Don't skip invisible if we are already at the margin. */ | 1293 | /* Don't skip invisible if we are already at the margin. */ |
| 1293 | if (vpos > tovpos || (vpos == tovpos && hpos >= tohpos)) | 1294 | if (vpos > tovpos || (vpos == tovpos && hpos >= tohpos)) |
| @@ -1885,23 +1886,23 @@ struct position val_vmotion; | |||
| 1885 | 1886 | ||
| 1886 | struct position * | 1887 | struct position * |
| 1887 | vmotion (from, vtarget, w) | 1888 | vmotion (from, vtarget, w) |
| 1888 | register int from, vtarget; | 1889 | register EMACS_INT from, vtarget; |
| 1889 | struct window *w; | 1890 | struct window *w; |
| 1890 | { | 1891 | { |
| 1891 | int hscroll = XINT (w->hscroll); | 1892 | EMACS_INT hscroll = XINT (w->hscroll); |
| 1892 | struct position pos; | 1893 | struct position pos; |
| 1893 | /* vpos is cumulative vertical position, changed as from is changed */ | 1894 | /* vpos is cumulative vertical position, changed as from is changed */ |
| 1894 | register int vpos = 0; | 1895 | register int vpos = 0; |
| 1895 | int prevline; | 1896 | EMACS_INT prevline; |
| 1896 | register int first; | 1897 | register EMACS_INT first; |
| 1897 | int from_byte; | 1898 | EMACS_INT from_byte; |
| 1898 | int lmargin = hscroll > 0 ? 1 - hscroll : 0; | 1899 | EMACS_INT lmargin = hscroll > 0 ? 1 - hscroll : 0; |
| 1899 | int selective | 1900 | int selective |
| 1900 | = (INTEGERP (current_buffer->selective_display) | 1901 | = (INTEGERP (current_buffer->selective_display) |
| 1901 | ? XINT (current_buffer->selective_display) | 1902 | ? XINT (current_buffer->selective_display) |
| 1902 | : !NILP (current_buffer->selective_display) ? -1 : 0); | 1903 | : !NILP (current_buffer->selective_display) ? -1 : 0); |
| 1903 | Lisp_Object window; | 1904 | Lisp_Object window; |
| 1904 | int start_hpos = 0; | 1905 | EMACS_INT start_hpos = 0; |
| 1905 | int did_motion; | 1906 | int did_motion; |
| 1906 | /* This is the object we use for fetching character properties. */ | 1907 | /* This is the object we use for fetching character properties. */ |
| 1907 | Lisp_Object text_prop_object; | 1908 | Lisp_Object text_prop_object; |
diff --git a/src/indent.h b/src/indent.h index 2e873769603..95cf23aaef1 100644 --- a/src/indent.h +++ b/src/indent.h | |||
| @@ -39,25 +39,31 @@ Boston, MA 02110-1301, USA. */ | |||
| 39 | 39 | ||
| 40 | struct position | 40 | struct position |
| 41 | { | 41 | { |
| 42 | int bufpos; | 42 | EMACS_INT bufpos; |
| 43 | int bytepos; | 43 | EMACS_INT bytepos; |
| 44 | int hpos; | 44 | EMACS_INT hpos; |
| 45 | int vpos; | 45 | EMACS_INT vpos; |
| 46 | int prevhpos; | 46 | EMACS_INT prevhpos; |
| 47 | int contin; | 47 | EMACS_INT contin; |
| 48 | /* Number of characters we have already handled | 48 | /* Number of characters we have already handled |
| 49 | from the before and after strings at this position. */ | 49 | from the before and after strings at this position. */ |
| 50 | int ovstring_chars_done; | 50 | EMACS_INT ovstring_chars_done; |
| 51 | int tab_offset; | 51 | EMACS_INT tab_offset; |
| 52 | }; | 52 | }; |
| 53 | 53 | ||
| 54 | struct position *compute_motion P_ ((int, int, int, int, int, int, int, | 54 | struct position *compute_motion P_ ((EMACS_INT from, EMACS_INT fromvpos, |
| 55 | int, int, int, struct window *)); | 55 | EMACS_INT fromhpos, int did_motion, |
| 56 | struct position *vmotion P_ ((int, int, struct window *)); | 56 | EMACS_INT to, EMACS_INT tovpos, |
| 57 | int skip_invisible P_ ((int, int *, int, Lisp_Object)); | 57 | EMACS_INT tohpos, |
| 58 | EMACS_INT width, EMACS_INT hscroll, | ||
| 59 | EMACS_INT tab_offset, struct window *)); | ||
| 60 | struct position *vmotion P_ ((EMACS_INT from, EMACS_INT vtarget, | ||
| 61 | struct window *)); | ||
| 62 | EMACS_INT skip_invisible P_ ((EMACS_INT pos, EMACS_INT *next_boundary_p, | ||
| 63 | EMACS_INT to, Lisp_Object window)); | ||
| 58 | 64 | ||
| 59 | /* Value of point when current_column was called */ | 65 | /* Value of point when current_column was called */ |
| 60 | extern int last_known_column_point; | 66 | extern EMACS_INT last_known_column_point; |
| 61 | 67 | ||
| 62 | /* Functions for dealing with the column cache. */ | 68 | /* Functions for dealing with the column cache. */ |
| 63 | 69 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 618a53836a1..a592bfa05b7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3609,7 +3609,8 @@ handle_invisible_prop (it) | |||
| 3609 | } | 3609 | } |
| 3610 | else | 3610 | else |
| 3611 | { | 3611 | { |
| 3612 | int invis_p, newpos, next_stop, start_charpos; | 3612 | int invis_p; |
| 3613 | EMACS_INT newpos, next_stop, start_charpos; | ||
| 3613 | Lisp_Object pos, prop, overlay; | 3614 | Lisp_Object pos, prop, overlay; |
| 3614 | 3615 | ||
| 3615 | /* First of all, is there invisible text at this position? */ | 3616 | /* First of all, is there invisible text at this position? */ |