public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-6305] [Ada] Refactor repeated implicit conversion from Char_Code to Uint Date: Thu, 6 Jan 2022 17:14:08 +0000 (GMT) [thread overview] Message-ID: <20220106171408.2AB173858020@sourceware.org> (raw) https://gcc.gnu.org/g:39521d958f6d114150b0e69288b7454ac57ccfa6 commit r12-6305-g39521d958f6d114150b0e69288b7454ac57ccfa6 Author: Piotr Trojanek <trojanek@adacore.com> Date: Tue Dec 7 20:12:49 2021 +0100 [Ada] Refactor repeated implicit conversion from Char_Code to Uint gcc/ada/ * sem_res.adb (Resolve_String_Literal): Avoid unnecessary conversions inside "<" and ">" bodies. Diff: --- gcc/ada/sem_res.adb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index ee843d39e9d..d8784f15075 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -11722,14 +11722,14 @@ package body Sem_Res is Comp_Typ_Hi : constant Node_Id := Type_High_Bound (Component_Type (Typ)); - Char_Val : Int; + Char_Val : Uint; begin if Compile_Time_Known_Value (Comp_Typ_Lo) and then Compile_Time_Known_Value (Comp_Typ_Hi) then for J in 1 .. Strlen loop - Char_Val := Int (Get_String_Char (Str, J)); + Char_Val := UI_From_CC (Get_String_Char (Str, J)); if Char_Val < Expr_Value (Comp_Typ_Lo) or else Char_Val > Expr_Value (Comp_Typ_Hi)
reply other threads:[~2022-01-06 17:14 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220106171408.2AB173858020@sourceware.org \ --to=pmderodat@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.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: linkBe 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).