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:
parent
e364307f6a
commit
229b23a017
@ -315,7 +315,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
|
|||||||
switch (curarg->type)
|
switch (curarg->type)
|
||||||
{
|
{
|
||||||
case GRUB_PARTTOOL_ARG_BOOL:
|
case GRUB_PARTTOOL_ARG_BOOL:
|
||||||
pargs[curarg - ptool->args].bool
|
pargs[curarg - ptool->args].b
|
||||||
= (args[j][grub_strlen (curarg->name)] != '-');
|
= (args[j][grub_strlen (curarg->name)] != '-');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,6 @@
|
|||||||
#include <grub/i18n.h>
|
#include <grub/i18n.h>
|
||||||
#include <grub/lib/cmdline.h>
|
#include <grub/lib/cmdline.h>
|
||||||
#include <grub/verify.h>
|
#include <grub/verify.h>
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
GRUB_MOD_LICENSE ("GPLv3+");
|
GRUB_MOD_LICENSE ("GPLv3+");
|
||||||
|
|
||||||
|
|||||||
@ -61,7 +61,7 @@ static grub_err_t grub_pcpart_boot (const grub_device_t dev,
|
|||||||
return grub_errno;
|
return grub_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args[0].set && args[0].bool)
|
if (args[0].set && args[0].b)
|
||||||
{
|
{
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
mbr.entries[i].flag = 0x0;
|
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].set)
|
||||||
{
|
{
|
||||||
if (args[1].bool)
|
if (args[1].b)
|
||||||
type |= GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG;
|
type |= GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG;
|
||||||
else
|
else
|
||||||
type &= ~GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG;
|
type &= ~GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG;
|
||||||
|
|||||||
@ -32,7 +32,7 @@ struct grub_parttool_args
|
|||||||
int set;
|
int set;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
int bool;
|
int b;
|
||||||
char *str;
|
char *str;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -20,6 +20,7 @@
|
|||||||
#define GRUB_TYPES_HEADER 1
|
#define GRUB_TYPES_HEADER 1
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#include <stdbool.h>
|
||||||
#ifndef GRUB_UTIL
|
#ifndef GRUB_UTIL
|
||||||
#include <grub/cpu/types.h>
|
#include <grub/cpu/types.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user