X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/e061a11b5a59f02fac66184e991f01a433f6dc8d..727e958ef0548f3d8ce02a4a971247f52cc548ce:/src/process.c diff --git a/src/process.c b/src/process.c index 4253286196..51deb1c933 100644 --- a/src/process.c +++ b/src/process.c @@ -28,13 +28,12 @@ along with GNU Emacs. If not, see . */ #include #include #include -#ifdef HAVE_INTTYPES_H -#include -#endif #include #include +#include "lisp.h" + /* Only MS-DOS does not define `subprocesses'. */ #ifdef subprocesses @@ -79,7 +78,6 @@ along with GNU Emacs. If not, see . */ #endif /* subprocesses */ -#include "lisp.h" #include "systime.h" #include "systty.h" @@ -1188,25 +1186,26 @@ Returns nil if format of ADDRESS is invalid. */) if (VECTORP (address)) /* AF_INET or AF_INET6 */ { register struct Lisp_Vector *p = XVECTOR (address); + EMACS_UINT size = p->header.size; Lisp_Object args[10]; int nargs, i; - if (p->size == 4 || (p->size == 5 && !NILP (omit_port))) + if (size == 4 || (size == 5 && !NILP (omit_port))) { args[0] = build_string ("%d.%d.%d.%d"); nargs = 4; } - else if (p->size == 5) + else if (size == 5) { args[0] = build_string ("%d.%d.%d.%d:%d"); nargs = 5; } - else if (p->size == 8 || (p->size == 9 && !NILP (omit_port))) + else if (size == 8 || (size == 9 && !NILP (omit_port))) { args[0] = build_string ("%x:%x:%x:%x:%x:%x:%x:%x"); nargs = 8; } - else if (p->size == 9) + else if (size == 9) { args[0] = build_string ("[%x:%x:%x:%x:%x:%x:%x:%x]:%d"); nargs = 9; @@ -1386,7 +1385,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) { if (EQ (coding_systems, Qt)) { - args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof args2); + args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); args2[0] = Qstart_process; for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; GCPRO2 (proc, current_dir); @@ -2064,13 +2063,13 @@ get_lisp_to_sockaddr_size (Lisp_Object address, int *familyp) if (VECTORP (address)) { p = XVECTOR (address); - if (p->size == 5) + if (p->header.size == 5) { *familyp = AF_INET; return sizeof (struct sockaddr_in); } #ifdef AF_INET6 - else if (p->size == 9) + else if (p->header.size == 9) { *familyp = AF_INET6; return sizeof (struct sockaddr_in6); @@ -2089,7 +2088,7 @@ get_lisp_to_sockaddr_size (Lisp_Object address, int *familyp) struct sockaddr *sa; *familyp = XINT (XCAR (address)); p = XVECTOR (XCDR (address)); - return p->size + sizeof (sa->sa_family); + return p->header.size + sizeof (sa->sa_family); } return 0; } @@ -3041,7 +3040,7 @@ usage: (make-network-process &rest ARGS) */) portstring = "0"; else if (INTEGERP (service)) { - sprintf (portbuf, "%ld", (long) XINT (service)); + sprintf (portbuf, "%"pI"d", XINT (service)); portstring = portbuf; } else @@ -3723,9 +3722,9 @@ FLAGS is the current flags of the interface. */) flags -= fp->flag_bit; } } - for (fnum = 0; flags && fnum < 32; fnum++) + for (fnum = 0; flags && fnum < 32; flags >>= 1, fnum++) { - if (flags & (1 << fnum)) + if (flags & 1) { elt = Fcons (make_number (fnum), elt); } @@ -4163,7 +4162,7 @@ wait_reading_process_output_1 (void) impossible to step through wait_reading_process_output. */ #ifndef select -static INLINE int +static inline int select_wrapper (int n, fd_set *rfd, fd_set *wfd, fd_set *xfd, struct timeval *tmo) { return select (n, rfd, wfd, xfd, tmo); @@ -4538,10 +4537,10 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd, some data in the TCP buffers so that select works, but with custom pull/push functions we need to check if some data is available in the buffers manually. */ - if (nfds == 0 && + if (nfds == 0 && wait_proc && wait_proc->gnutls_p /* Check for valid process. */ /* Do we have pending data? */ - && gnutls_record_check_pending (wait_proc->gnutls_state) > 0) + && emacs_gnutls_record_check_pending (wait_proc->gnutls_state) > 0) { nfds = 1; /* Set to Available. */ @@ -4952,7 +4951,7 @@ read_process_output (Lisp_Object proc, register int channel) } #ifdef HAVE_GNUTLS if (XPROCESS (proc)->gnutls_p) - nbytes = emacs_gnutls_read (channel, XPROCESS (proc), + nbytes = emacs_gnutls_read (XPROCESS (proc), chars + carryover + buffered, readmax - buffered); else @@ -5415,9 +5414,8 @@ send_process (volatile Lisp_Object proc, const char *volatile buf, { #ifdef HAVE_GNUTLS if (XPROCESS (proc)->gnutls_p) - written = emacs_gnutls_write (outfd, - XPROCESS (proc), - buf, this); + written = emacs_gnutls_write (XPROCESS (proc), + buf, this); else #endif written = emacs_write (outfd, buf, this);