just silence GCC warnings.

This commit is contained in:
okuji 2000-09-07 10:06:22 +00:00
parent 6ee3c49cc8
commit 5fb0adb667
3 changed files with 16 additions and 9 deletions

View file

@ -1,3 +1,10 @@
2000-09-07 OKUJI Yoshinori <okuji@gnu.org>
From Alessandro Rubini:
* stage2/builtins.c (terminal_func): Rename TIMEOUT to TO, to
suppress GCC warnings.
* grub/asmstub.c (serial_checkkey): Likewise.
2000-09-06 OKUJI Yoshinori <okuji@gnu.org>
* stage2/char_io.c [!STAGE1_5] (auto_fill): New variable.

View file

@ -889,17 +889,17 @@ int
serial_checkkey (void)
{
fd_set fds;
struct timeval timeout;
struct timeval to;
/* 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;
to.tv_sec = 0;
to.tv_usec = 100000;
return select (serial_fd + 1, &fds, 0, 0, &timeout) > 0 ? : -1;
return select (serial_fd + 1, &fds, 0, 0, &to) > 0 ? : -1;
}
/* The serial version of grub_putchar. */

View file

@ -3363,7 +3363,7 @@ static int
terminal_func (char *arg, int flags)
{
int default_terminal = 0;
int timeout = -1;
int to = -1;
int dumb = 0;
int saved_terminal = terminal;
@ -3376,7 +3376,7 @@ terminal_func (char *arg, int flags)
{
char *val = arg + sizeof ("--timeout=") - 1;
if (! safe_parse_maxint (&val, &timeout))
if (! safe_parse_maxint (&val, &to))
return 1;
}
else
@ -3439,7 +3439,7 @@ terminal_func (char *arg, int flags)
;
/* Wait for a key input. */
while (timeout)
while (to)
{
if ((terminal & TERMINAL_CONSOLE) && console_checkkey () != -1)
{
@ -3465,8 +3465,8 @@ terminal_func (char *arg, int flags)
{
grub_printf ("Press any key to continue.\n");
time2 = time1;
if (timeout > 0)
timeout--;
if (to > 0)
to--;
}
}