aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
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 7014bdb9740..5a67c3b6f2f 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3112,22 +3112,22 @@ XTflash (struct frame *f)
3112 x_flush (f); 3112 x_flush (f);
3113 3113
3114 { 3114 {
3115 EMACS_TIME delay = make_emacs_time (0, 150 * 1000 * 1000); 3115 struct timespec delay = make_timespec (0, 150 * 1000 * 1000);
3116 EMACS_TIME wakeup = add_emacs_time (current_emacs_time (), delay); 3116 struct timespec wakeup = timespec_add (current_timespec (), delay);
3117 3117
3118 /* Keep waiting until past the time wakeup or any input gets 3118 /* Keep waiting until past the time wakeup or any input gets
3119 available. */ 3119 available. */
3120 while (! detect_input_pending ()) 3120 while (! detect_input_pending ())
3121 { 3121 {
3122 EMACS_TIME current = current_emacs_time (); 3122 struct timespec current = current_timespec ();
3123 EMACS_TIME timeout; 3123 struct timespec timeout;
3124 3124
3125 /* Break if result would not be positive. */ 3125 /* Break if result would not be positive. */
3126 if (EMACS_TIME_LE (wakeup, current)) 3126 if (timespec_cmp (wakeup, current) <= 0)
3127 break; 3127 break;
3128 3128
3129 /* How long `select' should wait. */ 3129 /* How long `select' should wait. */
3130 timeout = make_emacs_time (0, 10 * 1000 * 1000); 3130 timeout = make_timespec (0, 10 * 1000 * 1000);
3131 3131
3132 /* Try to wait that long--but we might wake up sooner. */ 3132 /* Try to wait that long--but we might wake up sooner. */
3133 pselect (0, NULL, NULL, NULL, &timeout, NULL); 3133 pselect (0, NULL, NULL, NULL, &timeout, NULL);
@@ -8677,7 +8677,7 @@ x_wait_for_event (struct frame *f, int eventtype)
8677 int level = interrupt_input_blocked; 8677 int level = interrupt_input_blocked;
8678 8678
8679 SELECT_TYPE fds; 8679 SELECT_TYPE fds;
8680 EMACS_TIME tmo, tmo_at, time_now; 8680 struct timespec tmo, tmo_at, time_now;
8681 int fd = ConnectionNumber (FRAME_X_DISPLAY (f)); 8681 int fd = ConnectionNumber (FRAME_X_DISPLAY (f));
8682 8682
8683 pending_event_wait.f = f; 8683 pending_event_wait.f = f;
@@ -8685,8 +8685,8 @@ x_wait_for_event (struct frame *f, int eventtype)
8685 8685
8686 /* Set timeout to 0.1 second. Hopefully not noticeable. 8686 /* Set timeout to 0.1 second. Hopefully not noticeable.
8687 Maybe it should be configurable. */ 8687 Maybe it should be configurable. */
8688 tmo = make_emacs_time (0, 100 * 1000 * 1000); 8688 tmo = make_timespec (0, 100 * 1000 * 1000);
8689 tmo_at = add_emacs_time (current_emacs_time (), tmo); 8689 tmo_at = timespec_add (current_timespec (), tmo);
8690 8690
8691 while (pending_event_wait.eventtype) 8691 while (pending_event_wait.eventtype)
8692 { 8692 {
@@ -8699,11 +8699,11 @@ x_wait_for_event (struct frame *f, int eventtype)
8699 FD_ZERO (&fds); 8699 FD_ZERO (&fds);
8700 FD_SET (fd, &fds); 8700 FD_SET (fd, &fds);
8701 8701
8702 time_now = current_emacs_time (); 8702 time_now = current_timespec ();
8703 if (EMACS_TIME_LT (tmo_at, time_now)) 8703 if (timespec_cmp (tmo_at, time_now) < 0)
8704 break; 8704 break;
8705 8705
8706 tmo = sub_emacs_time (tmo_at, time_now); 8706 tmo = timespec_sub (tmo_at, time_now);
8707 if (pselect (fd + 1, &fds, NULL, NULL, &tmo, NULL) == 0) 8707 if (pselect (fd + 1, &fds, NULL, NULL, &tmo, NULL) == 0)
8708 break; /* Timeout */ 8708 break; /* Timeout */
8709 } 8709 }
@@ -10425,7 +10425,7 @@ x_activate_timeout_atimer (void)
10425 block_input (); 10425 block_input ();
10426 if (!x_timeout_atimer_activated_flag) 10426 if (!x_timeout_atimer_activated_flag)
10427 { 10427 {
10428 EMACS_TIME interval = make_emacs_time (0, 100 * 1000 * 1000); 10428 struct timespec interval = make_timespec (0, 100 * 1000 * 1000);
10429 start_atimer (ATIMER_RELATIVE, interval, x_process_timeouts, 0); 10429 start_atimer (ATIMER_RELATIVE, interval, x_process_timeouts, 0);
10430 x_timeout_atimer_activated_flag = 1; 10430 x_timeout_atimer_activated_flag = 1;
10431 } 10431 }