+2005-02-01 Yoshinori K. Okuji <okuji@enbug.org>
+
+ * grub/asmstub.c (grub_stage2): Use auto instead of static for
+ nested functions.
+
+ * stage2/char_io.c (memcheck) [GRUB_UTIL]: Likewise.
+
+ * stage2/builtins.c (blocklist_func): Likewise.
+ (color_func): Likewise.
+ (install_func): Likewise.
+ (setkey_func): Likewise.
+
+ * lib/device.c (read_device_map): Likewise.
+
2005-01-30 Yoshinori K. Okuji <okuji@enbug.org>
* configure.ac (AC_INIT): Upgraded to 0.96.
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23.
-.TH GRUB "8" "January 2005" "grub (GNU GRUB 0.96)" FSF
+.TH GRUB "8" "February 2005" "grub (GNU GRUB 0.96)" FSF
.SH NAME
grub \- the grub shell
.SH SYNOPSIS
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23.
-.TH MBCHK "1" "January 2005" "mbchk (GNU GRUB 0.96)" FSF
+.TH MBCHK "1" "February 2005" "mbchk (GNU GRUB 0.96)" FSF
.SH NAME
mbchk \- check the format of a Multiboot kernel
.SH SYNOPSIS
char *scratch, *simstack;
int i;
+ auto volatile void doit (void);
+
/* We need a nested function so that we get a clean stack frame,
regardless of how the code is optimized. */
- static volatile void doit ()
- {
- /* Make sure our stack lives in the simulated memory area. */
- asm volatile ("movl %%esp, %0\n\tmovl %1, %%esp\n"
- : "=&r" (realstack) : "r" (simstack));
-
- /* Do a setjmp here for the stop command. */
- if (! setjmp (env_for_exit))
- {
- /* Actually enter the generic stage2 code. */
- status = 0;
- init_bios_info ();
- }
- else
- {
- /* If ERRNUM is non-zero, then set STATUS to non-zero. */
- if (errnum)
- status = 1;
- }
-
- /* Replace our stack before we use any local variables. */
- asm volatile ("movl %0, %%esp\n" : : "r" (realstack));
- }
+ auto volatile void doit (void)
+ {
+ /* Make sure our stack lives in the simulated memory area. */
+ asm volatile ("movl %%esp, %0\n\tmovl %1, %%esp\n"
+ : "=&r" (realstack) : "r" (simstack));
+
+ /* Do a setjmp here for the stop command. */
+ if (! setjmp (env_for_exit))
+ {
+ /* Actually enter the generic stage2 code. */
+ status = 0;
+ init_bios_info ();
+ }
+ else
+ {
+ /* If ERRNUM is non-zero, then set STATUS to non-zero. */
+ if (errnum)
+ status = 1;
+ }
+
+ /* Replace our stack before we use any local variables. */
+ asm volatile ("movl %0, %%esp\n" : : "r" (realstack));
+ }
assert (grub_scratch_mem == 0);
scratch = malloc (0x100000 + EXTENDED_MEMSIZE + 15);
static int
read_device_map (FILE *fp, char **map, const char *map_file)
{
- static void show_error (int no, const char *msg)
+ auto void show_error (int no, const char *msg);
+ auto void show_warning (int no, const char *msg, ...);
+
+ auto void show_error (int no, const char *msg)
{
fprintf (stderr, "%s:%d: error: %s\n", map_file, no, msg);
}
- static void show_warning (int no, const char *msg, ...)
+ auto void show_warning (int no, const char *msg, ...)
{
va_list ap;
int num_entries = 0;
int last_length = 0;
+ auto void disk_read_blocklist_func (int sector, int offset, int length);
+
/* Collect contiguous blocks into one entry as many as possible,
and print the blocklist notation on the screen. */
- static void disk_read_blocklist_func (int sector, int offset, int length)
+ auto void disk_read_blocklist_func (int sector, int offset, int length)
{
if (num_sectors > 0)
{
"white"
};
+ auto int color_number (char *str);
+
/* Convert the color name STR into the magical number. */
- static int color_number (char *str)
+ auto int color_number (char *str)
{
char *ptr;
int i;
char *stage2_os_file = 0;
#endif /* GRUB_UTIL */
+ auto void disk_read_savesect_func (int sector, int offset, int length);
+ auto void disk_read_blocklist_func (int sector, int offset, int length);
+
/* Save the first sector of Stage2 in STAGE2_SECT. */
- static void disk_read_savesect_func (int sector, int offset, int length)
+ auto void disk_read_savesect_func (int sector, int offset, int length)
{
if (debug)
printf ("[%d]", sector);
/* Write SECTOR to INSTALLLIST, and update INSTALLADDR and
INSTALLSECT. */
- static void disk_read_blocklist_func (int sector, int offset, int length)
+ auto void disk_read_blocklist_func (int sector, int offset, int length)
{
if (debug)
printf("[%d]", sector);
int to_code, from_code;
int map_in_interrupt = 0;
- static int find_key_code (char *key)
+ auto int find_key_code (char *key);
+ auto int find_ascii_code (char *key);
+
+ auto int find_key_code (char *key)
{
int i;
return 0;
}
- static int find_ascii_code (char *key)
+ auto int find_ascii_code (char *key)
{
int i;
memcheck (int addr, int len)
{
#ifdef GRUB_UTIL
- static int start_addr (void)
+ auto int start_addr (void);
+ auto int end_addr (void);
+
+ auto int start_addr (void)
{
int ret;
# if defined(HAVE_START_SYMBOL)
return ret;
}
- static int end_addr (void)
+ auto int end_addr (void)
{
int ret;
# if defined(HAVE_END_SYMBOL)