From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7850) id ED7AD385842D; Wed, 19 Apr 2023 21:59:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED7AD385842D Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Indu Bhagat To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org Subject: [binutils-gdb] libsframe: use return type of bool for predicate functions X-Act-Checkin: binutils-gdb X-Git-Author: Indu Bhagat X-Git-Refname: refs/heads/master X-Git-Oldrev: 6e4724970e7316387d5ff28958c25906f283c592 X-Git-Newrev: 26be6015b750e7e2b40718b09c6195e8986be461 Message-Id: <20230419215947.ED7AD385842D@sourceware.org> Date: Wed, 19 Apr 2023 21:59:47 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Apr 2023 21:59:48 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D26be6015b750= e7e2b40718b09c6195e8986be461 commit 26be6015b750e7e2b40718b09c6195e8986be461 Author: Indu Bhagat Date: Wed Apr 19 14:12:12 2023 -0700 libsframe: use return type of bool for predicate functions =20 libsframe/ * sframe.c (sframe_header_sanity_check_p): Change return type to bool. (sframe_fre_sanity_check_p): Likewise. Diff: --- 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) =20 /* Check if SFrame header has valid data. */ =20 -static int +static bool sframe_header_sanity_check_p (sframe_header *hp) { unsigned char all_flags =3D 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 !=3D SFRAME_MAGIC) || (hp->sfh_preamble.sfp_version !=3D SFRAME_VERSION) || ((hp->sfh_preamble.sfp_flags | all_flags) !=3D all_flags)) - return 0; + return false; =20 /* Check offsets are valid. */ if (hp->sfh_fdeoff > hp->sfh_freoff) - return 0; + return false; =20 - return 1; + return true; } =20 /* Flip the start address pointed to by FP. */ @@ -284,14 +284,14 @@ sframe_fre_start_addr_size (unsigned int fre_type) =20 /* Check if the FREP has valid data. */ =20 -static int +static bool sframe_fre_sanity_check_p (sframe_frame_row_entry *frep) { unsigned int offset_size, offset_cnt; unsigned int fre_info; =20 if (frep =3D=3D NULL) - return 0; + return false; =20 fre_info =3D frep->fre_info; offset_size =3D sframe_fre_get_offset_size (fre_info); @@ -299,13 +299,13 @@ sframe_fre_sanity_check_p (sframe_frame_row_entry *fr= ep) if (offset_size !=3D SFRAME_FRE_OFFSET_1B && offset_size !=3D SFRAME_FRE_OFFSET_2B && offset_size !=3D SFRAME_FRE_OFFSET_4B) - return 0; + return false; =20 offset_cnt =3D sframe_fre_get_offset_count (fre_info); if (offset_cnt > 3) - return 0; + return false; =20 - return 1; + return true; } =20 /* Get FRE_INFO's offset size in bytes. */