]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/lib/arg.c: Don't discard const attribute.
authorVladimir Serbinenko <phcoder@gmail.com>
Sat, 21 Dec 2013 12:28:52 +0000 (13:28 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sat, 21 Dec 2013 12:28:52 +0000 (13:28 +0100)
ChangeLog
grub-core/lib/arg.c

index 037c60fd70fb2ccc8a77408c51d03089c6bbff5b..d3eca7490d465c1af7d2e164f47a479b173e00e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-12-21  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/lib/arg.c: Don't discard const attribute.
+
 2013-12-21  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/kern/dl.c: Don't discard const attribute.
index 47db949792b7894a995d7f9545b872818442e655..fd7744a6ff659138894ae2901e2de8ba682297fe 100644 (file)
@@ -35,22 +35,22 @@ static const struct grub_arg_option help_options[] =
   };
 
 /* Helper for find_short.  */
-static struct grub_arg_option *
+static const struct grub_arg_option *
 fnd_short (const struct grub_arg_option *opt, char c)
 {
   while (opt->doc)
     {
       if (opt->shortarg == c)
-       return (struct grub_arg_option *) opt;
+       return opt;
       opt++;
     }
   return 0;
 }
 
-static struct grub_arg_option *
+static const struct grub_arg_option *
 find_short (const struct grub_arg_option *options, char c)
 {
-  struct grub_arg_option *found = 0;
+  const struct grub_arg_option *found = 0;
 
   if (options)
     found = fnd_short (options, c);
@@ -60,11 +60,11 @@ find_short (const struct grub_arg_option *options, char c)
       switch (c)
        {
        case 'h':
-         found = (struct grub_arg_option *) help_options;
+         found = help_options;
          break;
 
        case 'u':
-         found = (struct grub_arg_option *) (help_options + 1);
+         found = (help_options + 1);
          break;
 
        default:
@@ -76,23 +76,23 @@ find_short (const struct grub_arg_option *options, char c)
 }
 
 /* Helper for find_long.  */
-static struct grub_arg_option *
+static const struct grub_arg_option *
 fnd_long (const struct grub_arg_option *opt, const char *s, int len)
 {
   while (opt->doc)
     {
       if (opt->longarg && ! grub_strncmp (opt->longarg, s, len) &&
          opt->longarg[len] == '\0')
-       return (struct grub_arg_option *) opt;
+       return opt;
       opt++;
     }
   return 0;
 }
 
-static struct grub_arg_option *
+static const struct grub_arg_option *
 find_long (const struct grub_arg_option *options, const char *s, int len)
 {
-  struct grub_arg_option *found = 0;
+  const struct grub_arg_option *found = 0;
 
   if (options)
     found = fnd_long (options, s, len);
@@ -240,7 +240,7 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv,
   for (curarg = 0; curarg < argc; curarg++)
     {
       char *arg = argv[curarg];
-      struct grub_arg_option *opt;
+      const struct grub_arg_option *opt;
       char *option = 0;
 
       /* No option is used.  */