Mercurial > emacs
comparison src/term.c @ 110562:ea50a897140e
Fix int/EMACS_INT use in process.c and term.c.
term.c (fast_find_position, term_mouse_highlight): Use EMACS_INT
for buffer positions.
process.c (read_process_output, send_process)
(Fprocess_send_region, status_notify): Use EMACS_INT for buffer
and string positions and size.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 25 Sep 2010 08:31:15 -0400 |
parents | 41bf9b6f3b91 |
children | 0995e4af573f |
comparison
equal
deleted
inserted
replaced
110561:93141d34a175 | 110562:ea50a897140e |
---|---|
2616 *HPOS and *VPOS are set to the positions found. W's current glyphs | 2616 *HPOS and *VPOS are set to the positions found. W's current glyphs |
2617 must be up to date. If POS is above window start return (0, 0). | 2617 must be up to date. If POS is above window start return (0, 0). |
2618 If POS is after end of W, return end of last line in W. | 2618 If POS is after end of W, return end of last line in W. |
2619 - taken from msdos.c */ | 2619 - taken from msdos.c */ |
2620 static int | 2620 static int |
2621 fast_find_position (struct window *w, int pos, int *hpos, int *vpos) | 2621 fast_find_position (struct window *w, EMACS_INT pos, int *hpos, int *vpos) |
2622 { | 2622 { |
2623 int i, lastcol, line_start_position, maybe_next_line_p = 0; | 2623 int i, lastcol, maybe_next_line_p = 0; |
2624 EMACS_INT line_start_position; | |
2624 int yb = window_text_bottom_y (w); | 2625 int yb = window_text_bottom_y (w); |
2625 struct glyph_row *row = MATRIX_ROW (w->current_matrix, 0), *best_row = row; | 2626 struct glyph_row *row = MATRIX_ROW (w->current_matrix, 0), *best_row = row; |
2626 | 2627 |
2627 while (row->y < yb) | 2628 while (row->y < yb) |
2628 { | 2629 { |
2656 lastcol = 0; | 2657 lastcol = 0; |
2657 row = best_row; | 2658 row = best_row; |
2658 for (i = 0; i < row->used[TEXT_AREA]; i++) | 2659 for (i = 0; i < row->used[TEXT_AREA]; i++) |
2659 { | 2660 { |
2660 struct glyph *glyph = row->glyphs[TEXT_AREA] + i; | 2661 struct glyph *glyph = row->glyphs[TEXT_AREA] + i; |
2661 int charpos; | 2662 EMACS_INT charpos; |
2662 | 2663 |
2663 charpos = glyph->charpos; | 2664 charpos = glyph->charpos; |
2664 if (charpos == pos) | 2665 if (charpos == pos) |
2665 { | 2666 { |
2666 *hpos = i; | 2667 *hpos = i; |
2717 if (part == ON_TEXT | 2718 if (part == ON_TEXT |
2718 && EQ (w->window_end_valid, w->buffer) | 2719 && EQ (w->window_end_valid, w->buffer) |
2719 && XFASTINT (w->last_modified) == BUF_MODIFF (b) | 2720 && XFASTINT (w->last_modified) == BUF_MODIFF (b) |
2720 && XFASTINT (w->last_overlay_modified) == BUF_OVERLAY_MODIFF (b)) | 2721 && XFASTINT (w->last_overlay_modified) == BUF_OVERLAY_MODIFF (b)) |
2721 { | 2722 { |
2722 int pos, i, nrows = w->current_matrix->nrows; | 2723 int i, nrows = w->current_matrix->nrows; |
2724 EMACS_INT pos; | |
2723 struct glyph_row *row; | 2725 struct glyph_row *row; |
2724 struct glyph *glyph; | 2726 struct glyph *glyph; |
2725 | 2727 |
2726 /* Find the glyph under X/Y. */ | 2728 /* Find the glyph under X/Y. */ |
2727 glyph = NULL; | 2729 glyph = NULL; |
2761 pos = glyph->charpos; | 2763 pos = glyph->charpos; |
2762 | 2764 |
2763 /* Check for mouse-face. */ | 2765 /* Check for mouse-face. */ |
2764 { | 2766 { |
2765 Lisp_Object mouse_face, overlay, position, *overlay_vec; | 2767 Lisp_Object mouse_face, overlay, position, *overlay_vec; |
2766 int noverlays, obegv, ozv; | 2768 int noverlays; |
2769 EMACS_INT obegv, ozv; | |
2767 struct buffer *obuf; | 2770 struct buffer *obuf; |
2768 | 2771 |
2769 /* If we get an out-of-range value, return now; avoid an error. */ | 2772 /* If we get an out-of-range value, return now; avoid an error. */ |
2770 if (pos > BUF_Z (b)) | 2773 if (pos > BUF_Z (b)) |
2771 return; | 2774 return; |