aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-02-06 21:02:02 -0800
committerPaul Eggert2011-02-06 21:02:02 -0800
commit400a67ffac91b4bbbfa58b32ec847c277ce53b24 (patch)
treeb14bfd497e65392dee16bcf40d3899efcd2ff007 /src
parent4a25e32a7328908c9f49936f538cad568663ca86 (diff)
downloademacs-400a67ffac91b4bbbfa58b32ec847c277ce53b24.tar.gz
emacs-400a67ffac91b4bbbfa58b32ec847c277ce53b24.zip
* process.c: conform to C89 pointer rules
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog2
-rw-r--r--src/process.c30
2 files changed, 18 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e4a3c63cb0b..c061fc53b94 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -21,6 +21,8 @@
21 (Fbase64_encode_region, base64_encode_1, Fbase64_decode_region, Fmd5): 21 (Fbase64_encode_region, base64_encode_1, Fbase64_decode_region, Fmd5):
22 Likewise. 22 Likewise.
23 * lread.c (read1, hash_string): Likewise. 23 * lread.c (read1, hash_string): Likewise.
24 * process.c (read_process_output, send_process, Fprocess_send_region):
25 Likewise.
24 26
252011-02-06 Paul Eggert <eggert@cs.ucla.edu> 272011-02-06 Paul Eggert <eggert@cs.ucla.edu>
26 28
diff --git a/src/process.c b/src/process.c
index da97e3de18a..80e70e49f8e 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5287,7 +5287,7 @@ read_process_output (Lisp_Object proc, register int channel)
5287 save the match data in a special nonrecursive fashion. */ 5287 save the match data in a special nonrecursive fashion. */
5288 running_asynch_code = 1; 5288 running_asynch_code = 1;
5289 5289
5290 decode_coding_c_string (coding, chars, nbytes, Qt); 5290 decode_coding_c_string (coding, (unsigned char *) chars, nbytes, Qt);
5291 text = coding->dst_object; 5291 text = coding->dst_object;
5292 Vlast_coding_system_used = CODING_ID_NAME (coding->id); 5292 Vlast_coding_system_used = CODING_ID_NAME (coding->id);
5293 /* A new coding system might be found. */ 5293 /* A new coding system might be found. */
@@ -5391,7 +5391,7 @@ read_process_output (Lisp_Object proc, register int channel)
5391 if (! (BEGV <= PT && PT <= ZV)) 5391 if (! (BEGV <= PT && PT <= ZV))
5392 Fwiden (); 5392 Fwiden ();
5393 5393
5394 decode_coding_c_string (coding, chars, nbytes, Qt); 5394 decode_coding_c_string (coding, (unsigned char *) chars, nbytes, Qt);
5395 text = coding->dst_object; 5395 text = coding->dst_object;
5396 Vlast_coding_system_used = CODING_ID_NAME (coding->id); 5396 Vlast_coding_system_used = CODING_ID_NAME (coding->id);
5397 /* A new coding system might be found. See the comment in the 5397 /* A new coding system might be found. See the comment in the
@@ -5495,7 +5495,7 @@ send_process_trap (int ignore)
5495 This function can evaluate Lisp code and can garbage collect. */ 5495 This function can evaluate Lisp code and can garbage collect. */
5496 5496
5497static void 5497static void
5498send_process (volatile Lisp_Object proc, const unsigned char *volatile buf, 5498send_process (volatile Lisp_Object proc, const char *volatile buf,
5499 volatile EMACS_INT len, volatile Lisp_Object object) 5499 volatile EMACS_INT len, volatile Lisp_Object object)
5500{ 5500{
5501 /* Use volatile to protect variables from being clobbered by longjmp. */ 5501 /* Use volatile to protect variables from being clobbered by longjmp. */
@@ -5573,7 +5573,7 @@ send_process (volatile Lisp_Object proc, const unsigned char *volatile buf,
5573 set_buffer_internal (XBUFFER (object)); 5573 set_buffer_internal (XBUFFER (object));
5574 save_pt = PT, save_pt_byte = PT_BYTE; 5574 save_pt = PT, save_pt_byte = PT_BYTE;
5575 5575
5576 from_byte = PTR_BYTE_POS (buf); 5576 from_byte = PTR_BYTE_POS ((unsigned char *) buf);
5577 from = BYTE_TO_CHAR (from_byte); 5577 from = BYTE_TO_CHAR (from_byte);
5578 to = BYTE_TO_CHAR (from_byte + len); 5578 to = BYTE_TO_CHAR (from_byte + len);
5579 TEMP_SET_PT_BOTH (from, from_byte); 5579 TEMP_SET_PT_BOTH (from, from_byte);
@@ -5595,7 +5595,7 @@ send_process (volatile Lisp_Object proc, const unsigned char *volatile buf,
5595 5595
5596 len = coding->produced; 5596 len = coding->produced;
5597 object = coding->dst_object; 5597 object = coding->dst_object;
5598 buf = SDATA (object); 5598 buf = SSDATA (object);
5599 } 5599 }
5600 5600
5601 if (pty_max_bytes == 0) 5601 if (pty_max_bytes == 0)
@@ -5629,7 +5629,7 @@ send_process (volatile Lisp_Object proc, const unsigned char *volatile buf,
5629#ifdef DATAGRAM_SOCKETS 5629#ifdef DATAGRAM_SOCKETS
5630 if (DATAGRAM_CHAN_P (outfd)) 5630 if (DATAGRAM_CHAN_P (outfd))
5631 { 5631 {
5632 rv = sendto (outfd, (char *) buf, this, 5632 rv = sendto (outfd, buf, this,
5633 0, datagram_address[outfd].sa, 5633 0, datagram_address[outfd].sa,
5634 datagram_address[outfd].len); 5634 datagram_address[outfd].len);
5635 if (rv < 0 && errno == EMSGSIZE) 5635 if (rv < 0 && errno == EMSGSIZE)
@@ -5646,10 +5646,10 @@ send_process (volatile Lisp_Object proc, const unsigned char *volatile buf,
5646 if (XPROCESS (proc)->gnutls_p) 5646 if (XPROCESS (proc)->gnutls_p)
5647 rv = emacs_gnutls_write (outfd, 5647 rv = emacs_gnutls_write (outfd,
5648 XPROCESS (proc), 5648 XPROCESS (proc),
5649 (char *) buf, this); 5649 buf, this);
5650 else 5650 else
5651#endif 5651#endif
5652 rv = emacs_write (outfd, (char *) buf, this); 5652 rv = emacs_write (outfd, buf, this);
5653#ifdef ADAPTIVE_READ_BUFFERING 5653#ifdef ADAPTIVE_READ_BUFFERING
5654 if (p->read_output_delay > 0 5654 if (p->read_output_delay > 0
5655 && p->adaptive_read_buffering == 1) 5655 && p->adaptive_read_buffering == 1)
@@ -5706,9 +5706,10 @@ send_process (volatile Lisp_Object proc, const unsigned char *volatile buf,
5706 /* Running filters might relocate buffers or strings. 5706 /* Running filters might relocate buffers or strings.
5707 Arrange to relocate BUF. */ 5707 Arrange to relocate BUF. */
5708 if (BUFFERP (object)) 5708 if (BUFFERP (object))
5709 offset = BUF_PTR_BYTE_POS (XBUFFER (object), buf); 5709 offset = BUF_PTR_BYTE_POS (XBUFFER (object),
5710 (unsigned char *) buf);
5710 else if (STRINGP (object)) 5711 else if (STRINGP (object))
5711 offset = buf - SDATA (object); 5712 offset = buf - SSDATA (object);
5712 5713
5713#ifdef EMACS_HAS_USECS 5714#ifdef EMACS_HAS_USECS
5714 wait_reading_process_output (0, 20000, 0, 0, Qnil, NULL, 0); 5715 wait_reading_process_output (0, 20000, 0, 0, Qnil, NULL, 0);
@@ -5717,9 +5718,10 @@ send_process (volatile Lisp_Object proc, const unsigned char *volatile buf,
5717#endif 5718#endif
5718 5719
5719 if (BUFFERP (object)) 5720 if (BUFFERP (object))
5720 buf = BUF_BYTE_ADDRESS (XBUFFER (object), offset); 5721 buf = (char *) BUF_BYTE_ADDRESS (XBUFFER (object),
5722 offset);
5721 else if (STRINGP (object)) 5723 else if (STRINGP (object))
5722 buf = offset + SDATA (object); 5724 buf = offset + SSDATA (object);
5723 5725
5724 rv = 0; 5726 rv = 0;
5725 } 5727 }
@@ -5770,7 +5772,7 @@ Output from processes can arrive in between bunches. */)
5770 5772
5771 start1 = CHAR_TO_BYTE (XINT (start)); 5773 start1 = CHAR_TO_BYTE (XINT (start));
5772 end1 = CHAR_TO_BYTE (XINT (end)); 5774 end1 = CHAR_TO_BYTE (XINT (end));
5773 send_process (proc, BYTE_POS_ADDR (start1), end1 - start1, 5775 send_process (proc, (char *) BYTE_POS_ADDR (start1), end1 - start1,
5774 Fcurrent_buffer ()); 5776 Fcurrent_buffer ());
5775 5777
5776 return Qnil; 5778 return Qnil;
@@ -5789,7 +5791,7 @@ Output from processes can arrive in between bunches. */)
5789 Lisp_Object proc; 5791 Lisp_Object proc;
5790 CHECK_STRING (string); 5792 CHECK_STRING (string);
5791 proc = get_process (process); 5793 proc = get_process (process);
5792 send_process (proc, SDATA (string), 5794 send_process (proc, SSDATA (string),
5793 SBYTES (string), string); 5795 SBYTES (string), string);
5794 return Qnil; 5796 return Qnil;
5795} 5797}