checkpolicy: rename bool identifiers

Avoid using the identifier `bool` to improve support with future C
standards.  C23 is about to make `bool` a predefined macro (see N2654).

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
Christian Göttsche 2023-04-20 17:35:54 +02:00 committed by James Carter
parent 893b50c6ce
commit d213d80f56
3 changed files with 12 additions and 12 deletions

View File

@ -354,14 +354,14 @@ static int display_cond_expressions(void)
static int change_bool(const char *name, int state)
{
cond_bool_datum_t *bool;
cond_bool_datum_t *boolean;
bool = hashtab_search(policydbp->p_bools.table, name);
if (bool == NULL) {
boolean = hashtab_search(policydbp->p_bools.table, name);
if (boolean == NULL) {
printf("Could not find bool %s\n", name);
return -1;
}
bool->state = state;
boolean->state = state;
evaluate_conds(policydbp);
return 0;
}

View File

@ -602,14 +602,14 @@ int display_cond_expressions(policydb_t * p, FILE * fp)
int change_bool(char *name, int state, policydb_t * p, FILE * fp)
{
cond_bool_datum_t *bool;
cond_bool_datum_t *boolean;
bool = hashtab_search(p->p_bools.table, name);
if (bool == NULL) {
boolean = hashtab_search(p->p_bools.table, name);
if (boolean == NULL) {
fprintf(fp, "Could not find bool %s\n", name);
return -1;
}
bool->state = state;
boolean->state = state;
evaluate_conds(p);
return 0;
}

View File

@ -262,14 +262,14 @@ static int display_handle_unknown(policydb_t * p, FILE * out_fp)
static int change_bool(char *name, int state, policydb_t * p, FILE * fp)
{
cond_bool_datum_t *bool;
cond_bool_datum_t *boolean;
bool = hashtab_search(p->p_bools.table, name);
if (bool == NULL) {
boolean = hashtab_search(p->p_bools.table, name);
if (boolean == NULL) {
fprintf(fp, "Could not find bool %s\n", name);
return -1;
}
bool->state = state;
boolean->state = state;
evaluate_conds(p);
return 0;
}