[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 31517e81d0d 03/13: Pacify 32-bit GCC 14.1.1 in timer_check_2
From: |
Paul Eggert |
Subject: |
master 31517e81d0d 03/13: Pacify 32-bit GCC 14.1.1 in timer_check_2 |
Date: |
Tue, 16 Jul 2024 18:37:44 -0400 (EDT) |
branch: master
commit 31517e81d0d8562e222d4b0de399915df956099f
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>
Pacify 32-bit GCC 14.1.1 in timer_check_2
* src/keyboard.c (timer_check_2): Refactor to make flow control
more obvious, to pacify -Wanalyzer-use-of-uninitialized-value with
gcc 14.1.1 20240607 (Red Hat 14.1.1-5) on i686.
---
src/keyboard.c | 35 +++++++++++++----------------------
1 file changed, 13 insertions(+), 22 deletions(-)
diff --git a/src/keyboard.c b/src/keyboard.c
index 6c33d08c265..b312d529e59 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4679,15 +4679,6 @@ decode_timer (Lisp_Object timer)
static struct timespec
timer_check_2 (Lisp_Object timers, Lisp_Object idle_timers)
{
- struct timespec nexttime;
- struct timespec now;
- struct timespec idleness_now;
- Lisp_Object chosen_timer;
-
- nexttime = invalid_timespec ();
-
- chosen_timer = Qnil;
-
/* First run the code that was delayed. */
while (CONSP (pending_funcalls))
{
@@ -4696,17 +4687,18 @@ timer_check_2 (Lisp_Object timers, Lisp_Object
idle_timers)
safe_calln (Qapply, XCAR (funcall), XCDR (funcall));
}
- if (CONSP (timers) || CONSP (idle_timers))
- {
- now = current_timespec ();
- idleness_now = (timespec_valid_p (timer_idleness_start_time)
- ? timespec_sub (now, timer_idleness_start_time)
- : make_timespec (0, 0));
- }
+ if (! (CONSP (timers) || CONSP (idle_timers)))
+ return invalid_timespec ();
+
+ struct timespec
+ now = current_timespec (),
+ idleness_now = (timespec_valid_p (timer_idleness_start_time)
+ ? timespec_sub (now, timer_idleness_start_time)
+ : make_timespec (0, 0));
- while (CONSP (timers) || CONSP (idle_timers))
+ do
{
- Lisp_Object timer = Qnil, idle_timer = Qnil;
+ Lisp_Object chosen_timer, timer = Qnil, idle_timer = Qnil;
struct timespec difference;
struct timespec timer_difference = invalid_timespec ();
struct timespec idle_timer_difference = invalid_timespec ();
@@ -4810,8 +4802,7 @@ timer_check_2 (Lisp_Object timers, Lisp_Object
idle_timers)
return 0 to indicate that. */
}
- nexttime = make_timespec (0, 0);
- break;
+ return make_timespec (0, 0);
}
else
/* When we encounter a timer that is still waiting,
@@ -4820,10 +4811,10 @@ timer_check_2 (Lisp_Object timers, Lisp_Object
idle_timers)
return difference;
}
}
+ while (CONSP (timers) || CONSP (idle_timers));
/* No timers are pending in the future. */
- /* Return 0 if we generated an event, and -1 if not. */
- return nexttime;
+ return invalid_timespec ();
}
- master updated (fd8bdedde96 -> 7cda30602fc), Paul Eggert, 2024/07/16
- master b4050ab75e8 05/13: Fix get_conversion_field --with-wide-wint overflow, Paul Eggert, 2024/07/16
- master f5dbdedcc53 01/13: Update from Gnulib by running admin/merge-gnulib, Paul Eggert, 2024/07/16
- master a53fd69fe21 07/13: Fix buffer size problem in print_bool_vector, Paul Eggert, 2024/07/16
- master 2067c255e67 02/13: Use Gnulib workaround for Android strnlen bug, Paul Eggert, 2024/07/16
- master 7cda30602fc 13/13: Check for more ‘find’ failures and port ‘find’, Paul Eggert, 2024/07/16
- master e1089cc9b6d 10/13: Simplify time form analysis, Paul Eggert, 2024/07/16
- master 51d096ec07d 08/13: Make ztrillion static, Paul Eggert, 2024/07/16
- master a4bafce01e6 04/13: Pacify -Wmissing-variable-declarations for lisp_malloc_user, Paul Eggert, 2024/07/16
- master 31517e81d0d 03/13: Pacify 32-bit GCC 14.1.1 in timer_check_2,
Paul Eggert <=
- master a86c25c91f3 11/13: Prefer -I to -isystem, Paul Eggert, 2024/07/16
- master b77abd2bfeb 06/13: alloc.c: ckd_add, not by-hand checks, Paul Eggert, 2024/07/16
- master d10c1796c99 09/13: Test !FASTER_TIMEFNS with builtin resolutions, Paul Eggert, 2024/07/16
- master a826296cff6 12/13: Quote BIN_DESTDIR better, Paul Eggert, 2024/07/16