]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
types: Make bool generally available
authorRobbie Harwood <rharwood@redhat.com>
Fri, 4 Nov 2022 16:13:34 +0000 (12:13 -0400)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 14 Nov 2022 16:17:21 +0000 (17:17 +0100)
Add an include on stdbool.h, making the bool type generally available
within the GRUB without needing to add a file-specific include every
time it would be used.

Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/commands/parttool.c
grub-core/loader/arm64/linux.c
grub-core/parttool/msdospart.c
include/grub/parttool.h
include/grub/types.h

index 051e31320e9ecb52fc1eaac48f089ddb7b6c6737..ff45c65e614cbb7f422a7cc2b703c9e672e06bb3 100644 (file)
@@ -315,7 +315,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
                    switch (curarg->type)
                      {
                      case GRUB_PARTTOOL_ARG_BOOL:
-                       pargs[curarg - ptool->args].bool
+                       pargs[curarg - ptool->args].b
                          = (args[j][grub_strlen (curarg->name)] != '-');
                        break;
 
index 9d0bacc85419d8b842b5c776e80c0a114719c2dd..48ab34a2565be4c9b0570a1a2d91337b6bf12fe4 100644 (file)
@@ -33,7 +33,6 @@
 #include <grub/i18n.h>
 #include <grub/lib/cmdline.h>
 #include <grub/verify.h>
-#include <stdbool.h>
 
 GRUB_MOD_LICENSE ("GPLv3+");
 
index 3918caa06ed06479b2dbce39591e8d809a5f7606..3a7699e4546781fadaa46da0c2258827a4174b9d 100644 (file)
@@ -61,7 +61,7 @@ static grub_err_t grub_pcpart_boot (const grub_device_t dev,
       return grub_errno;
     }
 
-  if (args[0].set && args[0].bool)
+  if (args[0].set && args[0].b)
     {
       for (i = 0; i < 4; i++)
        mbr.entries[i].flag = 0x0;
@@ -116,7 +116,7 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev,
 
   if (args[1].set)
     {
-      if (args[1].bool)
+      if (args[1].b)
        type |= GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG;
       else
        type &= ~GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG;
index 4e8f8d5e512588ba854ca5fd8adddc270f83fb42..4799a22c5d04032621aea22df69e711bc0989da2 100644 (file)
@@ -32,7 +32,7 @@ struct grub_parttool_args
   int set;
   union
   {
-    int bool;
+    int b;
     char *str;
   };
 };
index 5ae0ced388289e7657037faaf9e1f02840ea3a61..6d5dc5cdaa085f7def6ceed526a472ee07c8cf57 100644 (file)
@@ -20,6 +20,7 @@
 #define GRUB_TYPES_HEADER      1
 
 #include <config.h>
+#include <stdbool.h>
 #ifndef GRUB_UTIL
 #include <grub/cpu/types.h>
 #endif