All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian Göttsche" <cgzones@googlemail.com>
To: selinux@vger.kernel.org
Subject: [RFC PATCH 4/6] checkpolicy: rename bool identifiers
Date: Mon, 14 Nov 2022 21:10:40 +0100	[thread overview]
Message-ID: <20221114201042.17773-4-cgzones@googlemail.com> (raw)
In-Reply-To: <20221114201042.17773-1-cgzones@googlemail.com>

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>
---
 checkpolicy/checkpolicy.c | 8 ++++----
 checkpolicy/test/dismod.c | 8 ++++----
 checkpolicy/test/dispol.c | 8 ++++----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/checkpolicy/checkpolicy.c b/checkpolicy/checkpolicy.c
index a1406e7b..4c1b9b89 100644
--- a/checkpolicy/checkpolicy.c
+++ b/checkpolicy/checkpolicy.c
@@ -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;
 }
diff --git a/checkpolicy/test/dismod.c b/checkpolicy/test/dismod.c
index 51b68433..6328d326 100644
--- a/checkpolicy/test/dismod.c
+++ b/checkpolicy/test/dismod.c
@@ -598,14 +598,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;
 }
diff --git a/checkpolicy/test/dispol.c b/checkpolicy/test/dispol.c
index c396bef7..1d619e2c 100644
--- a/checkpolicy/test/dispol.c
+++ b/checkpolicy/test/dispol.c
@@ -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;
 }
-- 
2.38.1


  parent reply	other threads:[~2022-11-14 20:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14 20:10 [RFC PATCH 1/6] libsepol: rename struct member Christian Göttsche
2022-11-14 20:10 ` [RFC PATCH 2/6] checkpolicy: update cond_expr_t struct member name Christian Göttsche
2022-11-14 20:10 ` [RFC PATCH 3/6] libsepol/tests: rename bool indentifiers Christian Göttsche
2022-11-14 20:10 ` Christian Göttsche [this message]
2022-11-14 20:10 ` [RFC PATCH 5/6] libsepol: rename bool identifiers Christian Göttsche
2022-11-14 20:10 ` [RFC PATCH 6/6] libsemanage/tests: " Christian Göttsche
2022-11-17 21:45 ` [RFC PATCH 1/6] libsepol: rename struct member James Carter
2023-03-31 17:36   ` Christian Göttsche
2023-03-31 18:28     ` James Carter
2023-03-31 18:39       ` Christian Göttsche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221114201042.17773-4-cgzones@googlemail.com \
    --to=cgzones@googlemail.com \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.