Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Max timeout in ZLE type wrong



My smart new 64-bit laptop is running Fedora Core 6 X86_64 (everything
works!  Printing over Bluetooth, 802.11a with AES encryption, the SD
card reader, playing DVDs, the mute button at the top...) and gcc
pointed out that I'm shifting an int by the size of a long.  This made
ZMAXTIMEOUT 0 if ints were 32 bits and longs 64 bits.  The cast is in
the wrong place.

I believe this was new in 4.3.3/4.

Index: Src/Zle/zle_main.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_main.c,v
retrieving revision 1.95
diff -u -r1.95 zle_main.c
--- Src/Zle/zle_main.c	8 Feb 2007 10:43:30 -0000	1.95
+++ Src/Zle/zle_main.c	13 May 2007 18:30:49 -0000
@@ -425,7 +425,7 @@
      * there's no general way to fix up if that's wrong.
      */
     ZTM_MAX
-#define	ZMAXTIMEOUT	((time_t)(1 << (sizeof(time_t)*8-11)))
+#define	ZMAXTIMEOUT	((time_t)1 << (sizeof(time_t)*8-11))
 };
 
 struct ztmout {

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



Messages sorted by: Reverse Date, Date, Thread, Author