Mercurial > hg > xemacs-beta
comparison src/process.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 | 2dbefd79b3d3 |
comparison
equal
deleted
inserted
replaced
5580:a0e81357194e | 5581:56144c8593a8 |
---|---|
628 p->exit_code = 0; | 628 p->exit_code = 0; |
629 | 629 |
630 pid = PROCMETH (create_process, (p, argv, nargv, program, cur_dir, | 630 pid = PROCMETH (create_process, (p, argv, nargv, program, cur_dir, |
631 separate_err)); | 631 separate_err)); |
632 | 632 |
633 p->pid = make_int (pid); | 633 p->pid = make_fixnum (pid); |
634 if (PROCESS_READABLE_P (p)) | 634 if (PROCESS_READABLE_P (p)) |
635 event_stream_select_process (p, 1, 1); | 635 event_stream_select_process (p, 1, 1); |
636 } | 636 } |
637 | 637 |
638 /* This function is the unwind_protect form for Fstart_process_internal. If | 638 /* This function is the unwind_protect form for Fstart_process_internal. If |
795 XPROCESS (process)->command = Flist (nargs - 2, args + 2); | 795 XPROCESS (process)->command = Flist (nargs - 2, args + 2); |
796 | 796 |
797 /* Make the process marker point into the process buffer (if any). */ | 797 /* Make the process marker point into the process buffer (if any). */ |
798 if (!NILP (buffer)) | 798 if (!NILP (buffer)) |
799 Fset_marker (XPROCESS (process)->mark, | 799 Fset_marker (XPROCESS (process)->mark, |
800 make_int (BUF_ZV (XBUFFER (buffer))), buffer); | 800 make_fixnum (BUF_ZV (XBUFFER (buffer))), buffer); |
801 if (!NILP (stderr_buffer)) | 801 if (!NILP (stderr_buffer)) |
802 Fset_marker (XPROCESS (process)->stderr_mark, | 802 Fset_marker (XPROCESS (process)->stderr_mark, |
803 make_int (BUF_ZV (XBUFFER (stderr_buffer))), stderr_buffer); | 803 make_fixnum (BUF_ZV (XBUFFER (stderr_buffer))), stderr_buffer); |
804 | 804 |
805 /* If an error occurs and we can't start the process, we want to | 805 /* If an error occurs and we can't start the process, we want to |
806 remove it from the process list. This means that each error | 806 remove it from the process list. This means that each error |
807 check in create_process doesn't need to call remove_process | 807 check in create_process doesn't need to call remove_process |
808 itself; it's all taken care of here. */ | 808 itself; it's all taken care of here. */ |
973 Tell PROCESS that it has logical window size HEIGHT and WIDTH. | 973 Tell PROCESS that it has logical window size HEIGHT and WIDTH. |
974 */ | 974 */ |
975 (process, height, width)) | 975 (process, height, width)) |
976 { | 976 { |
977 CHECK_PROCESS (process); | 977 CHECK_PROCESS (process); |
978 check_integer_range (height, Qzero, make_integer (EMACS_INT_MAX)); | 978 check_integer_range (height, Qzero, make_integer (MOST_POSITIVE_FIXNUM)); |
979 check_integer_range (width, Qzero, make_integer (EMACS_INT_MAX)); | 979 check_integer_range (width, Qzero, make_integer (MOST_POSITIVE_FIXNUM)); |
980 return | 980 return |
981 MAYBE_INT_PROCMETH (set_window_size, | 981 MAYBE_INT_PROCMETH (set_window_size, |
982 (XPROCESS (process), XINT (height), XINT (width))) <= 0 | 982 (XPROCESS (process), XFIXNUM (height), XFIXNUM (width))) <= 0 |
983 ? Qnil : Qt; | 983 ? Qnil : Qt; |
984 } | 984 } |
985 | 985 |
986 | 986 |
987 /************************************************************************/ | 987 /************************************************************************/ |
1079 Some FSF junk with running_asynch_code, to preserve the match | 1079 Some FSF junk with running_asynch_code, to preserve the match |
1080 data. Not necessary because we don't call process filters | 1080 data. Not necessary because we don't call process filters |
1081 asynchronously (i.e. from within QUIT). */ | 1081 asynchronously (i.e. from within QUIT). */ |
1082 /* Don't catch errors here; we're not in any critical code. */ | 1082 /* Don't catch errors here; we're not in any critical code. */ |
1083 filter_result = call2 (filter, process, Qnil); | 1083 filter_result = call2 (filter, process, Qnil); |
1084 CHECK_INT (filter_result); | 1084 CHECK_FIXNUM (filter_result); |
1085 return XINT (filter_result); | 1085 return XFIXNUM (filter_result); |
1086 } | 1086 } |
1087 | 1087 |
1088 nbytes = Lstream_read (read_stderr ? XLSTREAM (DATA_ERRSTREAM (p)) : | 1088 nbytes = Lstream_read (read_stderr ? XLSTREAM (DATA_ERRSTREAM (p)) : |
1089 XLSTREAM (DATA_INSTREAM (p)), chars, | 1089 XLSTREAM (DATA_INSTREAM (p)), chars, |
1090 sizeof (chars) - 1); | 1090 sizeof (chars) - 1); |
1128 nbytes, INSDEL_BEFORE_MARKERS); | 1128 nbytes, INSDEL_BEFORE_MARKERS); |
1129 #else | 1129 #else |
1130 buffer_insert_raw_string (buf, chars, nbytes); | 1130 buffer_insert_raw_string (buf, chars, nbytes); |
1131 #endif | 1131 #endif |
1132 | 1132 |
1133 Fset_marker (mark, make_int (BUF_PT (buf)), buffer); | 1133 Fset_marker (mark, make_fixnum (BUF_PT (buf)), buffer); |
1134 | 1134 |
1135 MARK_MODELINE_CHANGED; | 1135 MARK_MODELINE_CHANGED; |
1136 unbind_to (spec); | 1136 unbind_to (spec); |
1137 UNGCPRO; | 1137 UNGCPRO; |
1138 } | 1138 } |
1610 } | 1610 } |
1611 else if (EQ (symbol, Qexit)) | 1611 else if (EQ (symbol, Qexit)) |
1612 { | 1612 { |
1613 if (code == 0) | 1613 if (code == 0) |
1614 return build_msg_string ("finished\n"); | 1614 return build_msg_string ("finished\n"); |
1615 string = Fnumber_to_string (make_int (code)); | 1615 string = Fnumber_to_string (make_fixnum (code)); |
1616 if (coredump) | 1616 if (coredump) |
1617 string2 = build_msg_string (" (core dumped)\n"); | 1617 string2 = build_msg_string (" (core dumped)\n"); |
1618 else | 1618 else |
1619 string2 = build_ascstring ("\n"); | 1619 string2 = build_ascstring ("\n"); |
1620 return concat2 (build_msg_string ("exited abnormally with code "), | 1620 return concat2 (build_msg_string ("exited abnormally with code "), |
1678 int this_process_tick; | 1678 int this_process_tick; |
1679 | 1679 |
1680 /* #### extra check for terminated processes, in case a SIGCHLD | 1680 /* #### extra check for terminated processes, in case a SIGCHLD |
1681 got missed (this seems to happen sometimes, I'm not sure why). | 1681 got missed (this seems to happen sometimes, I'm not sure why). |
1682 */ | 1682 */ |
1683 if (INTP (p->pid)) | 1683 if (FIXNUMP (p->pid)) |
1684 MAYBE_PROCMETH (update_status_if_terminated, (p)); | 1684 MAYBE_PROCMETH (update_status_if_terminated, (p)); |
1685 | 1685 |
1686 this_process_tick = p->tick; | 1686 this_process_tick = p->tick; |
1687 if (this_process_tick != p->update_tick) | 1687 if (this_process_tick != p->update_tick) |
1688 { | 1688 { |
1727 NGCPRO1 (process); | 1727 NGCPRO1 (process); |
1728 buffer_insert_ascstring (current_buffer, "\nProcess "); | 1728 buffer_insert_ascstring (current_buffer, "\nProcess "); |
1729 Finsert (1, &p->name); | 1729 Finsert (1, &p->name); |
1730 buffer_insert_ascstring (current_buffer, " "); | 1730 buffer_insert_ascstring (current_buffer, " "); |
1731 Finsert (1, &msg); | 1731 Finsert (1, &msg); |
1732 Fset_marker (p->mark, make_int (BUF_PT (current_buffer)), | 1732 Fset_marker (p->mark, make_fixnum (BUF_PT (current_buffer)), |
1733 p->buffer); | 1733 p->buffer); |
1734 | 1734 |
1735 unbind_to (spec); | 1735 unbind_to (spec); |
1736 NUNGCPRO; | 1736 NUNGCPRO; |
1737 } | 1737 } |
1790 If PROCESS has not yet exited or died, return 0. | 1790 If PROCESS has not yet exited or died, return 0. |
1791 */ | 1791 */ |
1792 (process)) | 1792 (process)) |
1793 { | 1793 { |
1794 CHECK_PROCESS (process); | 1794 CHECK_PROCESS (process); |
1795 return make_int (XPROCESS (process)->exit_code); | 1795 return make_fixnum (XPROCESS (process)->exit_code); |
1796 } | 1796 } |
1797 | 1797 |
1798 | 1798 |
1799 | 1799 |
1800 static int | 1800 static int |
1801 decode_signal (Lisp_Object signal_) | 1801 decode_signal (Lisp_Object signal_) |
1802 { | 1802 { |
1803 if (INTP (signal_)) | 1803 if (FIXNUMP (signal_)) |
1804 return XINT (signal_); | 1804 return XFIXNUM (signal_); |
1805 else | 1805 else |
1806 { | 1806 { |
1807 Ibyte *name; | 1807 Ibyte *name; |
1808 | 1808 |
1809 CHECK_SYMBOL (signal_); | 1809 CHECK_SYMBOL (signal_); |
2086 PID must be an integer. The process need not be a child of this Emacs. | 2086 PID must be an integer. The process need not be a child of this Emacs. |
2087 SIGNAL may be an integer, or a symbol naming a signal, like `SIGSEGV'. | 2087 SIGNAL may be an integer, or a symbol naming a signal, like `SIGSEGV'. |
2088 */ | 2088 */ |
2089 (pid, signal_)) | 2089 (pid, signal_)) |
2090 { | 2090 { |
2091 CHECK_INT (pid); | 2091 CHECK_FIXNUM (pid); |
2092 | 2092 |
2093 return make_int (PROCMETH_OR_GIVEN (kill_process_by_pid, | 2093 return make_fixnum (PROCMETH_OR_GIVEN (kill_process_by_pid, |
2094 (XINT (pid), decode_signal (signal_)), | 2094 (XFIXNUM (pid), decode_signal (signal_)), |
2095 -1)); | 2095 -1)); |
2096 } | 2096 } |
2097 | 2097 |
2098 DEFUN ("process-send-eof", Fprocess_send_eof, 0, 1, 0, /* | 2098 DEFUN ("process-send-eof", Fprocess_send_eof, 0, 1, 0, /* |
2099 Make PROCESS see end-of-file in its input. | 2099 Make PROCESS see end-of-file in its input. |