public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Indu Bhagat <indu.bhagat@oracle.com>
To: binutils@sourceware.org
Cc: Indu Bhagat <indu.bhagat@oracle.com>
Subject: [COMMITTED 3/6] libsframe: use return type of bool for predicate functions
Date: Wed, 19 Apr 2023 15:11:22 -0700	[thread overview]
Message-ID: <20230419221125.502883-4-indu.bhagat@oracle.com> (raw)
In-Reply-To: <20230419221125.502883-1-indu.bhagat@oracle.com>

libsframe/
	* sframe.c (sframe_header_sanity_check_p): Change return type to
	bool.
	(sframe_fre_sanity_check_p): Likewise.
---
 libsframe/sframe.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/libsframe/sframe.c b/libsframe/sframe.c
index ea3169ba7aa..907214a8a89 100644
--- a/libsframe/sframe.c
+++ b/libsframe/sframe.c
@@ -201,7 +201,7 @@ flip_fde (sframe_func_desc_entry *fdep)
 
 /* Check if SFrame header has valid data.  */
 
-static int
+static bool
 sframe_header_sanity_check_p (sframe_header *hp)
 {
   unsigned char all_flags = SFRAME_F_FDE_SORTED | SFRAME_F_FRAME_POINTER;
@@ -209,13 +209,13 @@ sframe_header_sanity_check_p (sframe_header *hp)
   if ((hp->sfh_preamble.sfp_magic != SFRAME_MAGIC)
       || (hp->sfh_preamble.sfp_version != SFRAME_VERSION)
       || ((hp->sfh_preamble.sfp_flags | all_flags) != all_flags))
-    return 0;
+    return false;
 
   /* Check offsets are valid.  */
   if (hp->sfh_fdeoff > hp->sfh_freoff)
-    return 0;
+    return false;
 
-  return 1;
+  return true;
 }
 
 /* Flip the start address pointed to by FP.  */
@@ -284,14 +284,14 @@ sframe_fre_start_addr_size (unsigned int fre_type)
 
 /* Check if the FREP has valid data.  */
 
-static int
+static bool
 sframe_fre_sanity_check_p (sframe_frame_row_entry *frep)
 {
   unsigned int offset_size, offset_cnt;
   unsigned int fre_info;
 
   if (frep == NULL)
-    return 0;
+    return false;
 
   fre_info = frep->fre_info;
   offset_size = sframe_fre_get_offset_size (fre_info);
@@ -299,13 +299,13 @@ sframe_fre_sanity_check_p (sframe_frame_row_entry *frep)
   if (offset_size != SFRAME_FRE_OFFSET_1B
       && offset_size != SFRAME_FRE_OFFSET_2B
       && offset_size != SFRAME_FRE_OFFSET_4B)
-    return 0;
+    return false;
 
   offset_cnt = sframe_fre_get_offset_count (fre_info);
   if (offset_cnt > 3)
-    return 0;
+    return false;
 
-  return 1;
+  return true;
 }
 
 /* Get FRE_INFO's offset size in bytes.  */
-- 
2.39.2


  parent reply	other threads:[~2023-04-19 22:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-19 22:11 [COMMITTED 0/6] Minor sframe related patches Indu Bhagat
2023-04-19 22:11 ` [COMMITTED 1/6] gas: sframe: use ATTRIBUTE_UNUSED consistently Indu Bhagat
2023-04-19 22:11 ` [COMMITTED 2/6] gas: sframe: fix comment Indu Bhagat
2023-04-19 22:11 ` Indu Bhagat [this message]
2023-04-19 22:11 ` [COMMITTED 4/6] sframe: correct some typos Indu Bhagat
2023-04-19 22:11 ` [COMMITTED 5/6] libsframe: use consistent function argument names Indu Bhagat
2023-04-19 22:11 ` [COMMITTED 6/6] libsframe: minor formatting fixes in sframe_encoder_write_fre Indu Bhagat

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=20230419221125.502883-4-indu.bhagat@oracle.com \
    --to=indu.bhagat@oracle.com \
    --cc=binutils@sourceware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).