changeset 71804:1a7b37f82a06

(sit_for): Signal error if TIMEOUT is not a number in case arg comes directly from a Lisp variable.
author Kim F. Storm <storm@cua.dk>
date Tue, 11 Jul 2006 22:54:28 +0000
parents d35d3efc3d99
children 47e18306c435
files src/dispnew.c
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/dispnew.c	Tue Jul 11 20:13:59 2006 +0000
+++ b/src/dispnew.c	Tue Jul 11 22:54:28 2006 +0000
@@ -6519,17 +6519,21 @@
   if (do_display >= 2)
     redisplay_preserve_echo_area (2);
 
-  if (FLOATP (timeout))
+  if (INTEGERP (timeout))
     {
-      double seconds = XFLOAT_DATA (timeout);
+      sec = XFASTINT (timeout);
+      usec = 0;
+    }
+  else if (FLOATP (timeout))
+    {
+      double seconds;
+
+      seconds = XFLOAT_DATA (timeout);
       sec = (int) seconds;
       usec = (int) ((seconds - sec) * 1000000);
     }
   else
-    {
-      sec = XFASTINT (timeout);
-      usec = 0;
-    }
+    wrong_type_argument (Qnumberp, timeout);
 
   if (sec == 0 && usec == 0)
     return Qt;