Mercurial > hg > xemacs-beta
comparison src/process-unix.c @ 5581:56144c8593a8
Mechanically change INT to FIXNUM in our sources.
src/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea@parhasard.net>
[...]
Mechanically change INT (where it refers to non-bignum Lisp
integers) to FIXNUM in our sources. Done for the following
functions, enums, and macros: Lisp_Type_Int_Even,
Lisp_Type_Int_Odd, INT_GCBITS, INT_VALBITS, make_int(), INTP(),
XINT(), CHECK_INT(), XREALINT(), INT_PLUS(), INT_MINUS(),
EMACS_INT_MAX (to MOST_POSITIVE_FIXNUM), EMACS_INT_MIN (to
MOST_NEGATIVE_FIXNUM), NUMBER_FITS_IN_AN_EMACS_INT() to
NUMBER_FITS_IN_A_FIXNUM(), XFLOATINT, XCHAR_OR_INT, INT_OR_FLOAT.
The EMACS_INT typedef was not changed, it does not describe
non-bignum Lisp integers.
Script that did the change available in
http://mid.gmane.org/20067.17650.181273.12014@parhasard.net .
modules/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea@parhasard.net>
[...]
Mechanically change INT to FIXNUM, where the usage describes non-bignum
Lisp integers. See the src/ChangeLog entry for more details.
man/ChangeLog addition:
2011-10-09 Aidan Kehoe <kehoea@parhasard.net>
* internals/internals.texi (How Lisp Objects Are Represented in C):
* internals/internals.texi (Integers and Characters):
Mechanically change INT to FIXNUM, where the usage describes non-bignum
Lisp integers.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 09 Oct 2011 09:51:57 +0100 |
parents | 8d29f1c4bb98 |
children | a216b3c2b09e |
comparison
equal
deleted
inserted
replaced
5580:a0e81357194e | 5581:56144c8593a8 |
---|---|
169 /* This function can GC */ | 169 /* This function can GC */ |
170 Lisp_Object proc; | 170 Lisp_Object proc; |
171 EMACS_INT inch; | 171 EMACS_INT inch; |
172 | 172 |
173 CHECK_STRING (name); | 173 CHECK_STRING (name); |
174 CHECK_INT (infd); | 174 CHECK_FIXNUM (infd); |
175 CHECK_INT (outfd); | 175 CHECK_FIXNUM (outfd); |
176 | 176 |
177 inch = XINT (infd); | 177 inch = XFIXNUM (infd); |
178 if (get_process_from_usid (FD_TO_USID (inch))) | 178 if (get_process_from_usid (FD_TO_USID (inch))) |
179 invalid_operation ("There is already a process connected to fd", infd); | 179 invalid_operation ("There is already a process connected to fd", infd); |
180 if (!NILP (buffer)) | 180 if (!NILP (buffer)) |
181 buffer = Fget_buffer_create (buffer); | 181 buffer = Fget_buffer_create (buffer); |
182 proc = make_process_internal (name); | 182 proc = make_process_internal (name); |
183 | 183 |
184 XPROCESS (proc)->pid = Fcons (infd, name); | 184 XPROCESS (proc)->pid = Fcons (infd, name); |
185 XPROCESS (proc)->buffer = buffer; | 185 XPROCESS (proc)->buffer = buffer; |
186 init_process_io_handles (XPROCESS (proc), (void *) inch, | 186 init_process_io_handles (XPROCESS (proc), (void *) inch, |
187 (void *) XINT (outfd), (void *) -1, 0); | 187 (void *) XFIXNUM (outfd), (void *) -1, 0); |
188 UNIX_DATA (XPROCESS (proc))->connected_via_filedesc_p = 1; | 188 UNIX_DATA (XPROCESS (proc))->connected_via_filedesc_p = 1; |
189 | 189 |
190 event_stream_select_process (XPROCESS (proc), 1, 1); | 190 event_stream_select_process (XPROCESS (proc), 1, 1); |
191 | 191 |
192 return proc; | 192 return proc; |
462 speed_up_interrupts (); | 462 speed_up_interrupts (); |
463 #ifdef TRY_AGAIN | 463 #ifdef TRY_AGAIN |
464 if (! (host_info_ptr == 0 && h_errno == TRY_AGAIN)) | 464 if (! (host_info_ptr == 0 && h_errno == TRY_AGAIN)) |
465 #endif | 465 #endif |
466 break; | 466 break; |
467 Fsleep_for (make_int (1)); | 467 Fsleep_for (make_fixnum (1)); |
468 } | 468 } |
469 if (host_info_ptr) | 469 if (host_info_ptr) |
470 { | 470 { |
471 address->sin_family = host_info_ptr->h_addrtype; | 471 address->sin_family = host_info_ptr->h_addrtype; |
472 memcpy (&address->sin_addr, host_info_ptr->h_addr, | 472 memcpy (&address->sin_addr, host_info_ptr->h_addr, |
526 if ((svc_info != 0) && (svc_info->s_port == port)) | 526 if ((svc_info != 0) && (svc_info->s_port == port)) |
527 break; | 527 break; |
528 else | 528 else |
529 continue; | 529 continue; |
530 } | 530 } |
531 else if (INTP (tail_port) && (htons ((unsigned short) XINT (tail_port)) == port)) | 531 else if (FIXNUMP (tail_port) && (htons ((unsigned short) XFIXNUM (tail_port)) == port)) |
532 break; | 532 break; |
533 } | 533 } |
534 | 534 |
535 if (!CONSP (tail)) | 535 if (!CONSP (tail)) |
536 { | 536 { |
925 } | 925 } |
926 } | 926 } |
927 | 927 |
928 /* Set `env' to a vector of the strings in Vprocess_environment. */ | 928 /* Set `env' to a vector of the strings in Vprocess_environment. */ |
929 /* + 2 to include PWD and terminating 0. */ | 929 /* + 2 to include PWD and terminating 0. */ |
930 env = alloca_array (Ibyte *, XINT (Flength (Vprocess_environment)) + 2); | 930 env = alloca_array (Ibyte *, XFIXNUM (Flength (Vprocess_environment)) + 2); |
931 { | 931 { |
932 REGISTER Lisp_Object tail; | 932 REGISTER Lisp_Object tail; |
933 Ibyte **new_env = env; | 933 Ibyte **new_env = env; |
934 | 934 |
935 /* If we have a PWD envvar and we know the real current directory, | 935 /* If we have a PWD envvar and we know the real current directory, |
1346 { | 1346 { |
1347 int w; | 1347 int w; |
1348 #ifdef SIGCHLD | 1348 #ifdef SIGCHLD |
1349 EMACS_BLOCK_SIGNAL (SIGCHLD); | 1349 EMACS_BLOCK_SIGNAL (SIGCHLD); |
1350 #endif | 1350 #endif |
1351 if (waitpid (XINT (p->pid), &w, WNOHANG) == XINT (p->pid)) | 1351 if (waitpid (XFIXNUM (p->pid), &w, WNOHANG) == XFIXNUM (p->pid)) |
1352 { | 1352 { |
1353 p->tick++; | 1353 p->tick++; |
1354 update_status_from_wait_code (p, &w); | 1354 update_status_from_wait_code (p, &w); |
1355 } | 1355 } |
1356 #ifdef SIGCHLD | 1356 #ifdef SIGCHLD |
1394 Lisp_Object tail; | 1394 Lisp_Object tail; |
1395 LIST_LOOP (tail, Vprocess_list) | 1395 LIST_LOOP (tail, Vprocess_list) |
1396 { | 1396 { |
1397 Lisp_Object proc = XCAR (tail); | 1397 Lisp_Object proc = XCAR (tail); |
1398 p = XPROCESS (proc); | 1398 p = XPROCESS (proc); |
1399 if (INTP (p->pid) && XINT (p->pid) == pid) | 1399 if (FIXNUMP (p->pid) && XFIXNUM (p->pid) == pid) |
1400 break; | 1400 break; |
1401 p = 0; | 1401 p = 0; |
1402 } | 1402 } |
1403 } | 1403 } |
1404 | 1404 |
1525 allow the program to finish doing output and read more. | 1525 allow the program to finish doing output and read more. |
1526 Used to be 1s, but that's excruciating. nt_send_process | 1526 Used to be 1s, but that's excruciating. nt_send_process |
1527 uses geometrically increasing timeouts (up to 1s). This | 1527 uses geometrically increasing timeouts (up to 1s). This |
1528 might be a good idea here. | 1528 might be a good idea here. |
1529 N.B. timeout_secs = Qnil is faster than Qzero. */ | 1529 N.B. timeout_secs = Qnil is faster than Qzero. */ |
1530 Faccept_process_output (Qnil, Qnil, make_int (10)); | 1530 Faccept_process_output (Qnil, Qnil, make_fixnum (10)); |
1531 /* It could have *really* finished, deleting the process */ | 1531 /* It could have *really* finished, deleting the process */ |
1532 if (NILP(p->pipe_outstream)) | 1532 if (NILP(p->pipe_outstream)) |
1533 return; | 1533 return; |
1534 old_sigpipe = | 1534 old_sigpipe = |
1535 (SIGTYPE (*) (int)) EMACS_SIGNAL (SIGPIPE, send_process_trap); | 1535 (SIGTYPE (*) (int)) EMACS_SIGNAL (SIGPIPE, send_process_trap); |
1759 sending the signal to the process group of our child process. | 1759 sending the signal to the process group of our child process. |
1760 Since this is often a shell that ignores signals like SIGINT, | 1760 Since this is often a shell that ignores signals like SIGINT, |
1761 the shell's subprocess is killed, which is the desired effect. | 1761 the shell's subprocess is killed, which is the desired effect. |
1762 The process group of p->pid is always p->pid, since it was | 1762 The process group of p->pid is always p->pid, since it was |
1763 created as a process group leader. */ | 1763 created as a process group leader. */ |
1764 pgid = XINT (p->pid); | 1764 pgid = XFIXNUM (p->pid); |
1765 | 1765 |
1766 /* Finally send the signal. */ | 1766 /* Finally send the signal. */ |
1767 if (EMACS_KILLPG (pgid, signo) == -1) | 1767 if (EMACS_KILLPG (pgid, signo) == -1) |
1768 { | 1768 { |
1769 /* It's not an error if our victim is already dead. | 1769 /* It's not an error if our victim is already dead. |
1883 Extbyte portbuf[128]; | 1883 Extbyte portbuf[128]; |
1884 /* | 1884 /* |
1885 * Caution: service can either be a string or int. | 1885 * Caution: service can either be a string or int. |
1886 * Convert to a C string for later use by getaddrinfo. | 1886 * Convert to a C string for later use by getaddrinfo. |
1887 */ | 1887 */ |
1888 if (INTP (service)) | 1888 if (FIXNUMP (service)) |
1889 { | 1889 { |
1890 snprintf (portbuf, sizeof (portbuf), "%ld", (long) XINT (service)); | 1890 snprintf (portbuf, sizeof (portbuf), "%ld", (long) XFIXNUM (service)); |
1891 portstring = portbuf; | 1891 portstring = portbuf; |
1892 port = htons ((unsigned short) XINT (service)); | 1892 port = htons ((unsigned short) XFIXNUM (service)); |
1893 } | 1893 } |
1894 else | 1894 else |
1895 { | 1895 { |
1896 CHECK_STRING (service); | 1896 CHECK_STRING (service); |
1897 portstring = LISP_STRING_TO_EXTERNAL (service, | 1897 portstring = LISP_STRING_TO_EXTERNAL (service, |
1923 #else /* !USE_GETADDRINFO */ | 1923 #else /* !USE_GETADDRINFO */ |
1924 | 1924 |
1925 struct sockaddr_in address; | 1925 struct sockaddr_in address; |
1926 volatile int i; | 1926 volatile int i; |
1927 | 1927 |
1928 if (INTP (service)) | 1928 if (FIXNUMP (service)) |
1929 port = htons ((unsigned short) XINT (service)); | 1929 port = htons ((unsigned short) XFIXNUM (service)); |
1930 else | 1930 else |
1931 { | 1931 { |
1932 struct servent *svc_info; | 1932 struct servent *svc_info; |
1933 Extbyte *servext; | 1933 Extbyte *servext; |
1934 | 1934 |
2117 volatile int retry = 0; | 2117 volatile int retry = 0; |
2118 | 2118 |
2119 CHECK_STRING (dest); | 2119 CHECK_STRING (dest); |
2120 | 2120 |
2121 check_integer_range (port, Qzero, make_integer (USHRT_MAX)); | 2121 check_integer_range (port, Qzero, make_integer (USHRT_MAX)); |
2122 theport = htons ((unsigned short) XINT (port)); | 2122 theport = htons ((unsigned short) XFIXNUM (port)); |
2123 | 2123 |
2124 check_integer_range (ttl, Qzero, make_integer (UCHAR_MAX)); | 2124 check_integer_range (ttl, Qzero, make_integer (UCHAR_MAX)); |
2125 thettl = (unsigned char) XINT (ttl); | 2125 thettl = (unsigned char) XFIXNUM (ttl); |
2126 | 2126 |
2127 if ((udp = getprotobyname ("udp")) == NULL) | 2127 if ((udp = getprotobyname ("udp")) == NULL) |
2128 invalid_operation ("No info available for UDP protocol", Qunbound); | 2128 invalid_operation ("No info available for UDP protocol", Qunbound); |
2129 | 2129 |
2130 /* Init the sockets. Yes, I need 2 sockets. I couldn't duplicate one. */ | 2130 /* Init the sockets. Yes, I need 2 sockets. I couldn't duplicate one. */ |