comparison src/process.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 310fef3bdbbb
children 9d94d76ce611
comparison
equal deleted inserted replaced
110561:93141d34a175 110562:ea50a897140e
5073 { 5073 {
5074 register int nbytes; 5074 register int nbytes;
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;
5082 int count = SPECPDL_INDEX (); 5082 int count = SPECPDL_INDEX ();
5083 Lisp_Object odeactivate; 5083 Lisp_Object odeactivate;
5263 5263
5264 /* If no filter, write into buffer if it isn't dead. */ 5264 /* If no filter, write into buffer if it isn't dead. */
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
5275 Fset_buffer (p->buffer); 5275 Fset_buffer (p->buffer);
5276 opoint = PT; 5276 opoint = PT;
5403 5403
5404 This function can evaluate Lisp code and can garbage collect. */ 5404 This function can evaluate Lisp code and can garbage collect. */
5405 5405
5406 static void 5406 static void
5407 send_process (volatile Lisp_Object proc, const unsigned char *volatile buf, 5407 send_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);
5416 5416
5417 GCPRO1 (object); 5417 GCPRO1 (object);
5464 if (CODING_REQUIRE_ENCODING (coding)) 5464 if (CODING_REQUIRE_ENCODING (coding))
5465 { 5465 {
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));
5474 save_pt = PT, save_pt_byte = PT_BYTE; 5474 save_pt = PT, save_pt_byte = PT_BYTE;
5475 5475
5517 if (!setjmp (send_process_frame)) 5517 if (!setjmp (send_process_frame))
5518 { 5518 {
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)
5526 { 5526 {
5527 int outfd = p->outfd; 5527 int outfd = p->outfd;
5651 it is sent in several bunches. This may happen even for shorter regions. 5651 it is sent in several bunches. This may happen even for shorter regions.
5652 Output from processes can arrive in between bunches. */) 5652 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);
5660 5660
5661 if (XINT (start) < GPT && XINT (end) > GPT) 5661 if (XINT (start) < GPT && XINT (end) > GPT)
6592 when a process becomes runnable. */ 6592 when a process becomes runnable. */
6593 else if (!EQ (symbol, Qrun) && !NILP (buffer)) 6593 else if (!EQ (symbol, Qrun) && !NILP (buffer))
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) */
6602 if (NILP (XBUFFER (buffer)->name)) 6602 if (NILP (XBUFFER (buffer)->name))
6603 continue; 6603 continue;