aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorJoakim Verona2013-09-10 23:26:38 +0200
committerJoakim Verona2013-09-10 23:26:38 +0200
commit92aeabcc8a007f521a664e3aee092eb80ad0f49a (patch)
tree58fde2f218fa45ee1b2c67184b50137a8fb6e140 /src/xterm.c
parentebc2ba4f6049d17fd41d2f1fc8d65efe309f6bf4 (diff)
parent43aac990c339c0fc3304aa476ebc8ea8467f107e (diff)
downloademacs-92aeabcc8a007f521a664e3aee092eb80ad0f49a.tar.gz
emacs-92aeabcc8a007f521a664e3aee092eb80ad0f49a.zip
merge from trunk
Conflicts: src/dispnew.c
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/xterm.c b/src/xterm.c
index ce29f355589..548975c635a 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3121,22 +3121,22 @@ XTflash (struct frame *f)
3121 x_flush (f); 3121 x_flush (f);
3122 3122
3123 { 3123 {
3124 EMACS_TIME delay = make_emacs_time (0, 150 * 1000 * 1000); 3124 struct timespec delay = make_timespec (0, 150 * 1000 * 1000);
3125 EMACS_TIME wakeup = add_emacs_time (current_emacs_time (), delay); 3125 struct timespec wakeup = timespec_add (current_timespec (), delay);
3126 3126
3127 /* Keep waiting until past the time wakeup or any input gets 3127 /* Keep waiting until past the time wakeup or any input gets
3128 available. */ 3128 available. */
3129 while (! detect_input_pending ()) 3129 while (! detect_input_pending ())
3130 { 3130 {
3131 EMACS_TIME current = current_emacs_time (); 3131 struct timespec current = current_timespec ();
3132 EMACS_TIME timeout; 3132 struct timespec timeout;
3133 3133
3134 /* Break if result would not be positive. */ 3134 /* Break if result would not be positive. */
3135 if (EMACS_TIME_LE (wakeup, current)) 3135 if (timespec_cmp (wakeup, current) <= 0)
3136 break; 3136 break;
3137 3137
3138 /* How long `select' should wait. */ 3138 /* How long `select' should wait. */
3139 timeout = make_emacs_time (0, 10 * 1000 * 1000); 3139 timeout = make_timespec (0, 10 * 1000 * 1000);
3140 3140
3141 /* Try to wait that long--but we might wake up sooner. */ 3141 /* Try to wait that long--but we might wake up sooner. */
3142 pselect (0, NULL, NULL, NULL, &timeout, NULL); 3142 pselect (0, NULL, NULL, NULL, &timeout, NULL);
@@ -8691,7 +8691,7 @@ x_wait_for_event (struct frame *f, int eventtype)
8691 int level = interrupt_input_blocked; 8691 int level = interrupt_input_blocked;
8692 8692
8693 SELECT_TYPE fds; 8693 SELECT_TYPE fds;
8694 EMACS_TIME tmo, tmo_at, time_now; 8694 struct timespec tmo, tmo_at, time_now;
8695 int fd = ConnectionNumber (FRAME_X_DISPLAY (f)); 8695 int fd = ConnectionNumber (FRAME_X_DISPLAY (f));
8696 8696
8697 pending_event_wait.f = f; 8697 pending_event_wait.f = f;
@@ -8699,8 +8699,8 @@ x_wait_for_event (struct frame *f, int eventtype)
8699 8699
8700 /* Set timeout to 0.1 second. Hopefully not noticeable. 8700 /* Set timeout to 0.1 second. Hopefully not noticeable.
8701 Maybe it should be configurable. */ 8701 Maybe it should be configurable. */
8702 tmo = make_emacs_time (0, 100 * 1000 * 1000); 8702 tmo = make_timespec (0, 100 * 1000 * 1000);
8703 tmo_at = add_emacs_time (current_emacs_time (), tmo); 8703 tmo_at = timespec_add (current_timespec (), tmo);
8704 8704
8705 while (pending_event_wait.eventtype) 8705 while (pending_event_wait.eventtype)
8706 { 8706 {
@@ -8713,11 +8713,11 @@ x_wait_for_event (struct frame *f, int eventtype)
8713 FD_ZERO (&fds); 8713 FD_ZERO (&fds);
8714 FD_SET (fd, &fds); 8714 FD_SET (fd, &fds);
8715 8715
8716 time_now = current_emacs_time (); 8716 time_now = current_timespec ();
8717 if (EMACS_TIME_LT (tmo_at, time_now)) 8717 if (timespec_cmp (tmo_at, time_now) < 0)
8718 break; 8718 break;
8719 8719
8720 tmo = sub_emacs_time (tmo_at, time_now); 8720 tmo = timespec_sub (tmo_at, time_now);
8721 if (pselect (fd + 1, &fds, NULL, NULL, &tmo, NULL) == 0) 8721 if (pselect (fd + 1, &fds, NULL, NULL, &tmo, NULL) == 0)
8722 break; /* Timeout */ 8722 break; /* Timeout */
8723 } 8723 }
@@ -10443,7 +10443,7 @@ x_activate_timeout_atimer (void)
10443 block_input (); 10443 block_input ();
10444 if (!x_timeout_atimer_activated_flag) 10444 if (!x_timeout_atimer_activated_flag)
10445 { 10445 {
10446 EMACS_TIME interval = make_emacs_time (0, 100 * 1000 * 1000); 10446 struct timespec interval = make_timespec (0, 100 * 1000 * 1000);
10447 start_atimer (ATIMER_RELATIVE, interval, x_process_timeouts, 0); 10447 start_atimer (ATIMER_RELATIVE, interval, x_process_timeouts, 0);
10448 x_timeout_atimer_activated_flag = 1; 10448 x_timeout_atimer_activated_flag = 1;
10449 } 10449 }