aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorAndreas Schwab2013-03-24 13:59:45 +0100
committerAndreas Schwab2013-03-24 13:59:45 +0100
commit908589fd28437a9b0995b103e22ce5e4d421eb8a (patch)
treece3a4207b04f84fdc97ee1ca2dfbc369fcf07c2a /src/process.c
parent7b0e2f853fcd88c58715fd159923d50dfdeb9cba (diff)
downloademacs-908589fd28437a9b0995b103e22ce5e4d421eb8a.tar.gz
emacs-908589fd28437a9b0995b103e22ce5e4d421eb8a.zip
Reorder conditions that are written backwards
* alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are written backwards. * blockinput.h (input_blocked_p): Likewise. * bytecode.c (exec_byte_code): Likewise. * callproc.c (call_process_kill, call_process_cleanup) (Fcall_process): Likewise. * ccl.c (ccl_driver, resolve_symbol_ccl_program) (Fccl_execute_on_string): Likewise. * character.c (string_escape_byte8): Likewise. * charset.c (read_hex): Likewise. * cm.c (calccost): Likewise. * data.c (cons_to_unsigned): Likewise. * dired.c (directory_files_internal, file_name_completion): Likewise. * dispnew.c (scrolling_window, update_frame_1, Fsleep_for) (sit_for): Likewise. * doc.c (Fsubstitute_command_keys): Likewise. * doprnt.c (doprnt): Likewise. * editfns.c (hi_time, decode_time_components, Fformat): Likewise. * emacsgtkfixed.c: Likewise. * fileio.c (file_offset, Fwrite_region): Likewise. * floatfns.c (Fexpt, fmod_float): Likewise. * fns.c (larger_vector, make_hash_table, Fmake_hash_table): Likewise. * font.c (font_intern_prop): Likewise. * frame.c (x_set_alpha): Likewise. * gtkutil.c (get_utf8_string): Likewise. * indent.c (check_display_width): Likewise. * intervals.c (create_root_interval, rotate_right, rotate_left) (split_interval_right, split_interval_left) (adjust_intervals_for_insertion, delete_node) (interval_deletion_adjustment, adjust_intervals_for_deletion) (merge_interval_right, merge_interval_left, copy_intervals) (set_intervals_multibyte_1): Likewise. * keyboard.c (gobble_input, append_tool_bar_item): Likewise. * keymap.c (Fkey_description): Likewise. * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise. * lread.c (openp, read_integer, read1, string_to_number): Likewise. * menu.c (ensure_menu_items): Likewise. * minibuf.c (read_minibuf_noninteractive): Likewise. * print.c (printchar, strout): Likewise. * process.c (create_process, Faccept_process_output) (wait_reading_process_output, read_process_output, send_process) (wait_reading_process_output): Likewise. * profiler.c (make_log, handle_profiler_signal): Likewise. * regex.c (re_exec): Likewise. * regex.h: Likewise. * search.c (looking_at_1, Freplace_match): Likewise. * sysdep.c (get_child_status, procfs_ttyname) (procfs_get_total_memory): Likewise. * systime.h (EMACS_TIME_VALID_P): Likewise. * term.c (dissociate_if_controlling_tty): Likewise. * window.c (get_phys_cursor_glyph): Likewise. * xdisp.c (init_iterator, redisplay_internal, redisplay_window) (try_window_reusing_current_matrix, try_window_id, pint2hrstr): Likewise. * xfns.c (Fx_window_property): Likewise. * xmenu.c (set_frame_menubar): Likewise. * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise. * xsmfns.c (smc_save_yourself_CB): Likewise. * xterm.c (x_scroll_bar_set_handle): Likewise.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/process.c b/src/process.c
index ed71ff76e6a..6a14a536707 100644
--- a/src/process.c
+++ b/src/process.c
@@ -136,7 +136,7 @@ extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *,
136/* Work around GCC 4.7.0 bug with strict overflow checking; see 136/* Work around GCC 4.7.0 bug with strict overflow checking; see
137 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904>. 137 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904>.
138 These lines can be removed once the GCC bug is fixed. */ 138 These lines can be removed once the GCC bug is fixed. */
139#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ 139#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
140# pragma GCC diagnostic ignored "-Wstrict-overflow" 140# pragma GCC diagnostic ignored "-Wstrict-overflow"
141#endif 141#endif
142 142
@@ -1804,7 +1804,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1804 /* Back in the parent process. */ 1804 /* Back in the parent process. */
1805 1805
1806 XPROCESS (process)->pid = pid; 1806 XPROCESS (process)->pid = pid;
1807 if (0 <= pid) 1807 if (pid >= 0)
1808 XPROCESS (process)->alive = 1; 1808 XPROCESS (process)->alive = 1;
1809 1809
1810 /* Stop blocking signals in the parent. */ 1810 /* Stop blocking signals in the parent. */
@@ -3901,7 +3901,7 @@ Return non-nil if we received any output before the timeout expired. */)
3901 { 3901 {
3902 if (INTEGERP (seconds)) 3902 if (INTEGERP (seconds))
3903 { 3903 {
3904 if (0 < XINT (seconds)) 3904 if (XINT (seconds) > 0)
3905 { 3905 {
3906 secs = XINT (seconds); 3906 secs = XINT (seconds);
3907 nsecs = 0; 3907 nsecs = 0;
@@ -3909,7 +3909,7 @@ Return non-nil if we received any output before the timeout expired. */)
3909 } 3909 }
3910 else if (FLOATP (seconds)) 3910 else if (FLOATP (seconds))
3911 { 3911 {
3912 if (0 < XFLOAT_DATA (seconds)) 3912 if (XFLOAT_DATA (seconds) > 0)
3913 { 3913 {
3914 EMACS_TIME t = EMACS_TIME_FROM_DOUBLE (XFLOAT_DATA (seconds)); 3914 EMACS_TIME t = EMACS_TIME_FROM_DOUBLE (XFLOAT_DATA (seconds));
3915 secs = min (EMACS_SECS (t), WAIT_READING_MAX); 3915 secs = min (EMACS_SECS (t), WAIT_READING_MAX);
@@ -4236,12 +4236,12 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4236 time_limit = 0; 4236 time_limit = 0;
4237 nsecs = -1; 4237 nsecs = -1;
4238 } 4238 }
4239 else if (TYPE_MAXIMUM (time_t) < time_limit) 4239 else if (time_limit > TYPE_MAXIMUM (time_t))
4240 time_limit = TYPE_MAXIMUM (time_t); 4240 time_limit = TYPE_MAXIMUM (time_t);
4241 4241
4242 /* Since we may need to wait several times, 4242 /* Since we may need to wait several times,
4243 compute the absolute time to return at. */ 4243 compute the absolute time to return at. */
4244 if (time_limit || 0 < nsecs) 4244 if (time_limit || nsecs > 0)
4245 { 4245 {
4246 timeout = make_emacs_time (time_limit, nsecs); 4246 timeout = make_emacs_time (time_limit, nsecs);
4247 end_time = add_emacs_time (current_emacs_time (), timeout); 4247 end_time = add_emacs_time (current_emacs_time (), timeout);
@@ -4273,7 +4273,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4273 4273
4274 timeout = make_emacs_time (0, 0); 4274 timeout = make_emacs_time (0, 0);
4275 } 4275 }
4276 else if (time_limit || 0 < nsecs) 4276 else if (time_limit || nsecs > 0)
4277 { 4277 {
4278 EMACS_TIME now = current_emacs_time (); 4278 EMACS_TIME now = current_emacs_time ();
4279 if (EMACS_TIME_LE (end_time, now)) 4279 if (EMACS_TIME_LE (end_time, now))
@@ -4325,7 +4325,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4325 break; 4325 break;
4326 4326
4327 /* A negative timeout means do not wait at all. */ 4327 /* A negative timeout means do not wait at all. */
4328 if (0 <= nsecs) 4328 if (nsecs >= 0)
4329 { 4329 {
4330 if (EMACS_TIME_VALID_P (timer_delay)) 4330 if (EMACS_TIME_VALID_P (timer_delay))
4331 { 4331 {
@@ -4407,7 +4407,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4407 if (nread == 0) 4407 if (nread == 0)
4408 break; 4408 break;
4409 4409
4410 if (0 < nread) 4410 if (nread > 0)
4411 { 4411 {
4412 total_nread += nread; 4412 total_nread += nread;
4413 got_some_input = 1; 4413 got_some_input = 1;
@@ -4948,7 +4948,7 @@ read_process_output (Lisp_Object proc, register int channel)
4948 else 4948 else
4949#endif 4949#endif
4950 { 4950 {
4951 bool buffered = 0 <= proc_buffered_char[channel]; 4951 bool buffered = proc_buffered_char[channel] >= 0;
4952 if (buffered) 4952 if (buffered)
4953 { 4953 {
4954 chars[carryover] = proc_buffered_char[channel]; 4954 chars[carryover] = proc_buffered_char[channel];
@@ -5455,7 +5455,7 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len,
5455 rv = sendto (outfd, cur_buf, cur_len, 5455 rv = sendto (outfd, cur_buf, cur_len,
5456 0, datagram_address[outfd].sa, 5456 0, datagram_address[outfd].sa,
5457 datagram_address[outfd].len); 5457 datagram_address[outfd].len);
5458 if (0 <= rv) 5458 if (rv >= 0)
5459 written = rv; 5459 written = rv;
5460 else if (errno == EMSGSIZE) 5460 else if (errno == EMSGSIZE)
5461 report_file_error ("sending datagram", Fcons (proc, Qnil)); 5461 report_file_error ("sending datagram", Fcons (proc, Qnil));
@@ -6578,7 +6578,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
6578 time_limit = TYPE_MAXIMUM (time_t); 6578 time_limit = TYPE_MAXIMUM (time_t);
6579 6579
6580 /* What does time_limit really mean? */ 6580 /* What does time_limit really mean? */
6581 if (time_limit || 0 < nsecs) 6581 if (time_limit || nsecs > 0)
6582 { 6582 {
6583 timeout = make_emacs_time (time_limit, nsecs); 6583 timeout = make_emacs_time (time_limit, nsecs);
6584 end_time = add_emacs_time (current_emacs_time (), timeout); 6584 end_time = add_emacs_time (current_emacs_time (), timeout);
@@ -6616,7 +6616,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
6616 6616
6617 timeout = make_emacs_time (0, 0); 6617 timeout = make_emacs_time (0, 0);
6618 } 6618 }
6619 else if (time_limit || 0 < nsecs) 6619 else if (time_limit || nsecs > 0)
6620 { 6620 {
6621 EMACS_TIME now = current_emacs_time (); 6621 EMACS_TIME now = current_emacs_time ();
6622 if (EMACS_TIME_LE (end_time, now)) 6622 if (EMACS_TIME_LE (end_time, now))
@@ -6654,7 +6654,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
6654 && requeued_events_pending_p ()) 6654 && requeued_events_pending_p ())
6655 break; 6655 break;
6656 6656
6657 if (EMACS_TIME_VALID_P (timer_delay) && 0 <= nsecs) 6657 if (EMACS_TIME_VALID_P (timer_delay) && nsecs >= 0)
6658 { 6658 {
6659 if (EMACS_TIME_LT (timer_delay, timeout)) 6659 if (EMACS_TIME_LT (timer_delay, timeout))
6660 { 6660 {