]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2005-02-01 Yoshinori K. Okuji <okuji@enbug.org>
authorokuji <okuji@localhost>
Tue, 1 Feb 2005 21:00:42 +0000 (21:00 +0000)
committerokuji <okuji@localhost>
Tue, 1 Feb 2005 21:00:42 +0000 (21:00 +0000)
  * 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.

ChangeLog
docs/grub.8
docs/mbchk.1
grub/asmstub.c
lib/device.c
stage2/builtins.c
stage2/char_io.c

index acae8f7da04425c7eb49e9593d45f00281400860..07e4b00d99da084cb9b66abaf88f0c37836e3072 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+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.
index 6ee209533c0e9b43abe348f46d4c43bc39ae651b..fcd2fb913e722b9f2418217caf75dce40eac0437 100644 (file)
@@ -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
index ce634216da938698cf565d4225f6344c51eee7c5..e673c3c95864f8b0b54db5cf6a8b14b19c25954e 100644 (file)
@@ -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
index 094a9cd3a58088542c37f98eeaee4acee4c95a33..e313c85e690870d80de1387876b0a8754113b5dd 100644 (file)
@@ -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);
index 4a49001ce8beb4d79645aa7a29cd86dbe7b986b4..b05f3a9066127d73012f46032e485925465c8a11 100644 (file)
@@ -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;
       
index 535c713d28a4b77a954f52194a2942831bd86d26..df98a1e7a01645e8bbee62d6afcf97b9ff23718d 100644 (file)
@@ -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;
       
index d2960238f61485b62ac28991594e3b314645e476..c86c240669215d939ec08db8d2f01b93e603b9a6 100644 (file)
@@ -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)