From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id A51503857030 for ; Thu, 11 Aug 2022 07:01:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A51503857030 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 6AB62300089; Thu, 11 Aug 2022 07:01:15 +0000 (UTC) From: Tsukasa OI To: Tsukasa OI , Nelson Chu , Kito Cheng , Palmer Dabbelt Cc: binutils@sourceware.org Subject: [RFC PATCH 1/5] RISC-V: Use bool on riscv_set_options members Date: Thu, 11 Aug 2022 16:00:49 +0900 Message-Id: <23764761af27e9903ec2d1ed1e0f1e9547d10efe.1660201178.git.research_trasio@irq.a4lg.com> In-Reply-To: References: <1659692183-5682-1-git-send-email-nelson.chu@sifive.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2022 07:01:18 -0000 All uses of riscv_set_options members are safe to be bool. If we change them from `int' to `bool', we can shrink the `riscv_set_options' and the intent of the members are clearer. gas/ChangeLog: * config/tc-riscv.c (struct riscv_set_options): Make all members from `int' to `bool'. --- gas/config/tc-riscv.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 34ce68e8252..92eabf0cbc7 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -229,20 +229,20 @@ riscv_set_default_priv_spec (const char *s) /* This is the set of options which the .option pseudo-op may modify. */ struct riscv_set_options { - int pic; /* Generate position-independent code. */ - int rvc; /* Generate RVC code. */ - int relax; /* Emit relocs the linker is allowed to relax. */ - int arch_attr; /* Emit architecture and privileged elf attributes. */ - int csr_check; /* Enable the CSR checking. */ + bool pic; /* Generate position-independent code. */ + bool rvc; /* Generate RVC code. */ + bool relax; /* Emit relocs the linker is allowed to relax. */ + bool arch_attr; /* Emit architecture and privileged elf attributes. */ + bool csr_check; /* Enable the CSR checking. */ }; static struct riscv_set_options riscv_opts = { - 0, /* pic */ - 0, /* rvc */ - 1, /* relax */ - DEFAULT_RISCV_ATTR, /* arch_attr */ - 0, /* csr_check */ + false, /* pic */ + false, /* rvc */ + true, /* relax */ + (bool) DEFAULT_RISCV_ATTR, /* arch_attr */ + false, /* csr_check */ }; /* Enable or disable the rvc flags for riscv_opts. Turn on the rvc flag -- 2.34.1