type safety for bool optional
Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I6f10395ca6f1c73f3513031f561fdf1b1dedf451
This commit is contained in:
@@ -364,7 +364,7 @@ static long (*bpf_get_current_comm)(void* buf, uint32_t buf_size) = (void*) BPF_
|
||||
.gid = (prog_gid), \
|
||||
.min_kver = (min_kv), \
|
||||
.max_kver = (max_kv), \
|
||||
.optional = (opt), \
|
||||
.optional = (opt).optional, \
|
||||
.bpfloader_min_ver = (min_loader), \
|
||||
.bpfloader_max_ver = (max_loader), \
|
||||
.selinux_context = (selinux), \
|
||||
|
||||
@@ -120,9 +120,10 @@ struct shared_bool { bool shared; };
|
||||
#define PRIVATE ((struct shared_bool){ .shared = false })
|
||||
#define SHARED ((struct shared_bool){ .shared = true })
|
||||
|
||||
// constants for passing in to 'bool optional' (for programs)
|
||||
static const bool MANDATORY = false;
|
||||
static const bool OPTIONAL = true;
|
||||
// for programs:
|
||||
struct optional_bool { bool optional; };
|
||||
#define MANDATORY ((struct optional_bool){ .optional = false })
|
||||
#define OPTIONAL ((struct optional_bool){ .optional = true })
|
||||
|
||||
// constants for passing in to ignore_on_eng / ignore_on_user / ignore_on_userdebug
|
||||
static const bool LOAD_ON_ENG = false;
|
||||
|
||||
Reference in New Issue
Block a user