diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2021-12-07 20:12:49 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-01-06 17:11:37 +0000 |
commit | 39521d958f6d114150b0e69288b7454ac57ccfa6 (patch) | |
tree | feb48f90f3b9463ec60d17f496ae48a3735025b1 | |
parent | cdfdd0de395a24fcc39749cc5bb545ace6f5bf4b (diff) | |
download | gcc-39521d958f6d114150b0e69288b7454ac57ccfa6.zip gcc-39521d958f6d114150b0e69288b7454ac57ccfa6.tar.gz gcc-39521d958f6d114150b0e69288b7454ac57ccfa6.tar.bz2 |
[Ada] Refactor repeated implicit conversion from Char_Code to Uint
gcc/ada/
* sem_res.adb (Resolve_String_Literal): Avoid unnecessary
conversions inside "<" and ">" bodies.
-rw-r--r-- | gcc/ada/sem_res.adb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index ee843d3..d8784f1 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) |