In addition to the zillion warnings in the netboot/ dir (which I'm
dealing with), there are others. Since compilation has warnings on, I
think they should disappear.  Some are the fault of *curses, which
polluted the namespace in a horrible and unacceptable way. This cleans
two of such warnings of three ("timeout redefined"). No ChangeLog
needed, in my opinion.

The other curses-generated warning is in unzip.c, butchanging unzip.c
is bad, or even "Bad". I think the best thing to do in order to use
any form of curses (independent of this warning) is including the
curses staff only from files that need it, not in shared.h. Due to
autoconf issues, I'd use a ./usecurses.h where all the ifdef should
fall. If you agree, I'd be glad to do that.

standard disclaimer:
        feel free to flame if this irrelevant stuff interferes with real work.

Index: grub/asmstub.c
===================================================================
RCS file: /cvs/grub/grub/asmstub.c,v
retrieving revision 1.60
diff -u -d -u -r1.60 asmstub.c
--- grub/asmstub.c      2000/08/28 12:22:03     1.60
+++ grub/asmstub.c      2000/09/03 09:42:12
@@ -888,17 +888,17 @@
 serial_checkkey (void)
 {
   fd_set fds;
-  struct timeval timeout;
+  struct timeval to; /* timeout */
 
   /* Wait only for the serial device.  */
   FD_ZERO (&fds);
   FD_SET (serial_fd, &fds);
 
   /* Set the timeout to 100ms.  */
-  timeout.tv_sec = 0;
-  timeout.tv_usec = 100000;
-  
-  return select (serial_fd + 1, &fds, 0, 0, &timeout) > 0 ? : -1;
+  to.tv_sec = 0;
+  to.tv_usec = 100000;
+ 
+  return select (serial_fd + 1, &fds, 0, 0, &to) > 0 ? : -1;
 }
 
 /* The serial version of grub_putchar.  */
Index: stage2/builtins.c
===================================================================
RCS file: /cvs/grub/stage2/builtins.c,v
retrieving revision 1.77
diff -u -d -u -r1.77 builtins.c
--- stage2/builtins.c   2000/09/03 05:08:50     1.77
+++ stage2/builtins.c   2000/09/03 09:42:13
@@ -3284,7 +3284,7 @@
 terminal_func (char *arg, int flags)
 {
   int default_terminal = 0;
-  int timeout = -1;
+  int to = -1; /* timeout */
   int dumb = 0;
   int saved_terminal = terminal;
 
@@ -3297,7 +3297,7 @@
        {
          char *val = arg + sizeof ("--timeout=") - 1;
          
-         if (! safe_parse_maxint (&val, &timeout))
+         if (! safe_parse_maxint (&val, &to))
            return 1;
        }
       else
@@ -3360,7 +3360,7 @@
        ;
 
       /* Wait for a key input.  */
-      while (timeout)
+      while (to)
        {
          if ((terminal & TERMINAL_CONSOLE) && console_checkkey () != -1)
            {
@@ -3386,8 +3386,8 @@
            {
              grub_printf ("Press any key to continue.\n");
              time2 = time1;
-             if (timeout > 0)
-               timeout--;
+             if (to > 0)
+               to--;
            }
        }
 

Reply via email to