diff --git a/ChangeLog b/ChangeLog index acae8f7da..07e4b00d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2005-02-01 Yoshinori K. Okuji + + * 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 * configure.ac (AC_INIT): Upgraded to 0.96. diff --git a/docs/grub.8 b/docs/grub.8 index 6ee209533..fcd2fb913 100644 --- a/docs/grub.8 +++ b/docs/grub.8 @@ -1,5 +1,5 @@ .\" 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 diff --git a/docs/mbchk.1 b/docs/mbchk.1 index ce634216d..e673c3c95 100644 --- a/docs/mbchk.1 +++ b/docs/mbchk.1 @@ -1,5 +1,5 @@ .\" 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 diff --git a/grub/asmstub.c b/grub/asmstub.c index 094a9cd3a..e313c85e6 100644 --- a/grub/asmstub.c +++ b/grub/asmstub.c @@ -113,31 +113,33 @@ grub_stage2 (void) 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); diff --git a/lib/device.c b/lib/device.c index 4a49001ce..b05f3a906 100644 --- a/lib/device.c +++ b/lib/device.c @@ -493,12 +493,15 @@ check_device (const char *device) 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; diff --git a/stage2/builtins.c b/stage2/builtins.c index 535c713d2..df98a1e7a 100644 --- a/stage2/builtins.c +++ b/stage2/builtins.c @@ -141,9 +141,11 @@ blocklist_func (char *arg, int flags) 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) { @@ -589,8 +591,10 @@ color_func (char *arg, int flags) "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; @@ -1774,8 +1778,11 @@ install_func (char *arg, int flags) 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); @@ -1791,7 +1798,7 @@ install_func (char *arg, int flags) /* 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); @@ -3610,7 +3617,10 @@ setkey_func (char *arg, int flags) 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; @@ -3627,7 +3637,7 @@ setkey_func (char *arg, int flags) return 0; } - static int find_ascii_code (char *key) + auto int find_ascii_code (char *key) { int i; diff --git a/stage2/char_io.c b/stage2/char_io.c index d2960238f..c86c24066 100644 --- a/stage2/char_io.c +++ b/stage2/char_io.c @@ -1178,7 +1178,10 @@ int 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) @@ -1189,7 +1192,7 @@ memcheck (int addr, int len) return ret; } - static int end_addr (void) + auto int end_addr (void) { int ret; # if defined(HAVE_END_SYMBOL)