aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2010-09-25 08:31:15 -0400
committerEli Zaretskii2010-09-25 08:31:15 -0400
commitf877c546db4d53d4076715323bd151ab6c3347a5 (patch)
treeeeadbbe340b082d517dacc33290e93f756069d7c /src
parent40b1a3a937512ff35884df2e8e19c3feed9f2688 (diff)
downloademacs-f877c546db4d53d4076715323bd151ab6c3347a5.tar.gz
emacs-f877c546db4d53d4076715323bd151ab6c3347a5.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/process.c26
-rw-r--r--src/term.c13
3 files changed, 28 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index cbdc3706076..08e0adb7999 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
12010-09-25 Eli Zaretskii <eliz@gnu.org> 12010-09-25 Eli Zaretskii <eliz@gnu.org>
2 2
3 * term.c (fast_find_position, term_mouse_highlight): Use EMACS_INT
4 for buffer positions.
5
6 * process.c (read_process_output, send_process)
7 (Fprocess_send_region, status_notify): Use EMACS_INT for buffer
8 and string positions and size.
9
3 * print.c (print_object, print_string, strout): Use EMACS_INT for 10 * print.c (print_object, print_string, strout): Use EMACS_INT for
4 string indices. 11 string indices.
5 12
diff --git a/src/process.c b/src/process.c
index ac82f12debb..048e2858e9f 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5075,7 +5075,7 @@ read_process_output (Lisp_Object proc, register int channel)
5075 char *chars; 5075 char *chars;
5076 register Lisp_Object outstream; 5076 register Lisp_Object outstream;
5077 register struct Lisp_Process *p = XPROCESS (proc); 5077 register struct Lisp_Process *p = XPROCESS (proc);
5078 register int opoint; 5078 register EMACS_INT opoint;
5079 struct coding_system *coding = proc_decode_coding_system[channel]; 5079 struct coding_system *coding = proc_decode_coding_system[channel];
5080 int carryover = p->decoding_carryover; 5080 int carryover = p->decoding_carryover;
5081 int readmax = 4096; 5081 int readmax = 4096;
@@ -5265,10 +5265,10 @@ read_process_output (Lisp_Object proc, register int channel)
5265 else if (!NILP (p->buffer) && !NILP (XBUFFER (p->buffer)->name)) 5265 else if (!NILP (p->buffer) && !NILP (XBUFFER (p->buffer)->name))
5266 { 5266 {
5267 Lisp_Object old_read_only; 5267 Lisp_Object old_read_only;
5268 int old_begv, old_zv; 5268 EMACS_INT old_begv, old_zv;
5269 int old_begv_byte, old_zv_byte; 5269 EMACS_INT old_begv_byte, old_zv_byte;
5270 int before, before_byte; 5270 EMACS_INT before, before_byte;
5271 int opoint_byte; 5271 EMACS_INT opoint_byte;
5272 Lisp_Object text; 5272 Lisp_Object text;
5273 struct buffer *b; 5273 struct buffer *b;
5274 5274
@@ -5405,11 +5405,11 @@ send_process_trap (int ignore)
5405 5405
5406static void 5406static void
5407send_process (volatile Lisp_Object proc, const unsigned char *volatile buf, 5407send_process (volatile Lisp_Object proc, const unsigned char *volatile buf,
5408 volatile int len, volatile Lisp_Object object) 5408 volatile EMACS_INT len, volatile Lisp_Object object)
5409{ 5409{
5410 /* Use volatile to protect variables from being clobbered by longjmp. */ 5410 /* Use volatile to protect variables from being clobbered by longjmp. */
5411 struct Lisp_Process *p = XPROCESS (proc); 5411 struct Lisp_Process *p = XPROCESS (proc);
5412 int rv; 5412 EMACS_INT rv;
5413 struct coding_system *coding; 5413 struct coding_system *coding;
5414 struct gcpro gcpro1; 5414 struct gcpro gcpro1;
5415 SIGTYPE (*volatile old_sigpipe) (int); 5415 SIGTYPE (*volatile old_sigpipe) (int);
@@ -5466,8 +5466,8 @@ send_process (volatile Lisp_Object proc, const unsigned char *volatile buf,
5466 coding->dst_object = Qt; 5466 coding->dst_object = Qt;
5467 if (BUFFERP (object)) 5467 if (BUFFERP (object))
5468 { 5468 {
5469 int from_byte, from, to; 5469 EMACS_INT from_byte, from, to;
5470 int save_pt, save_pt_byte; 5470 EMACS_INT save_pt, save_pt_byte;
5471 struct buffer *cur = current_buffer; 5471 struct buffer *cur = current_buffer;
5472 5472
5473 set_buffer_internal (XBUFFER (object)); 5473 set_buffer_internal (XBUFFER (object));
@@ -5519,7 +5519,7 @@ send_process (volatile Lisp_Object proc, const unsigned char *volatile buf,
5519 process_sent_to = proc; 5519 process_sent_to = proc;
5520 while (len > 0) 5520 while (len > 0)
5521 { 5521 {
5522 int this = len; 5522 EMACS_INT this = len;
5523 5523
5524 /* Send this batch, using one or more write calls. */ 5524 /* Send this batch, using one or more write calls. */
5525 while (this > 0) 5525 while (this > 0)
@@ -5653,7 +5653,7 @@ Output from processes can arrive in between bunches. */)
5653 (Lisp_Object process, Lisp_Object start, Lisp_Object end) 5653 (Lisp_Object process, Lisp_Object start, Lisp_Object end)
5654{ 5654{
5655 Lisp_Object proc; 5655 Lisp_Object proc;
5656 int start1, end1; 5656 EMACS_INT start1, end1;
5657 5657
5658 proc = get_process (process); 5658 proc = get_process (process);
5659 validate_region (&start, &end); 5659 validate_region (&start, &end);
@@ -6594,8 +6594,8 @@ status_notify (struct Lisp_Process *deleting_process)
6594 { 6594 {
6595 Lisp_Object tem; 6595 Lisp_Object tem;
6596 struct buffer *old = current_buffer; 6596 struct buffer *old = current_buffer;
6597 int opoint, opoint_byte; 6597 EMACS_INT opoint, opoint_byte;
6598 int before, before_byte; 6598 EMACS_INT before, before_byte;
6599 6599
6600 /* Avoid error if buffer is deleted 6600 /* Avoid error if buffer is deleted
6601 (probably that's why the process is dead, too) */ 6601 (probably that's why the process is dead, too) */
diff --git a/src/term.c b/src/term.c
index 2deca1014e8..1b4484470e0 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2618,9 +2618,10 @@ term_clear_mouse_face (void)
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 */
2620static int 2620static int
2621fast_find_position (struct window *w, int pos, int *hpos, int *vpos) 2621fast_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
@@ -2658,7 +2659,7 @@ fast_find_position (struct window *w, int pos, int *hpos, int *vpos)
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)
@@ -2719,7 +2720,8 @@ term_mouse_highlight (struct frame *f, int x, int y)
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
@@ -2763,7 +2765,8 @@ term_mouse_highlight (struct frame *f, int x, int y)
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. */