types: Make bool generally available

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>
This commit is contained in:
Robbie Harwood 2022-11-04 12:13:34 -04:00 committed by Daniel Kiper
parent e364307f6a
commit 229b23a017
5 changed files with 5 additions and 5 deletions

View 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;

View 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+");

View 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;

View File

@ -32,7 +32,7 @@ struct grub_parttool_args
int set;
union
{
int bool;
int b;
char *str;
};
};

View 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