https://gcc.gnu.org/g:8013b4085527f9242f98ef1f47f7427efb7a20ea

commit r16-1240-g8013b4085527f9242f98ef1f47f7427efb7a20ea
Author: Piotr Trojanek <troja...@adacore.com>
Date:   Tue Feb 18 14:37:19 2025 +0100

    ada: Refine subtypes in routines for building floating-point numbers
    
    Propagate strict subtypes from callees to the caller; code cleanup.
    
    gcc/ada/ChangeLog:
    
            * cstand.adb (Build_Float_Type, Register_Float_Type): Refine
            parameter subtypes.
            * set_targ.ads (FPT_Mode_Entry): Refine component subtype.

Diff:
---
 gcc/ada/cstand.adb   | 10 +++++-----
 gcc/ada/set_targ.ads |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb
index 14c7496fa619..28c32690b48e 100644
--- a/gcc/ada/cstand.adb
+++ b/gcc/ada/cstand.adb
@@ -67,10 +67,10 @@ package body CStand is
 
    procedure Build_Float_Type
      (E     : Entity_Id;
-      Digs  : Int;
+      Digs  : Pos;
       Rep   : Float_Rep_Kind;
       Siz   : Int;
-      Align : Int);
+      Align : Nat);
    --  Procedure to build standard predefined float base type. The first
    --  parameter is the entity for the type. The second parameter is the
    --  digits value. The third parameter indicates the representation to
@@ -192,10 +192,10 @@ package body CStand is
 
    procedure Build_Float_Type
      (E     : Entity_Id;
-      Digs  : Int;
+      Digs  : Pos;
       Rep   : Float_Rep_Kind;
       Siz   : Int;
-      Align : Int)
+      Align : Nat)
    is
    begin
       Set_Type_Definition (Parent (E),
@@ -2086,7 +2086,7 @@ package body CStand is
       Set_Defining_Identifier (New_Node (N_Full_Type_Declaration, Stloc), Ent);
       Set_Scope (Ent, Standard_Standard);
       Build_Float_Type
-        (Ent, Pos (Digs), Float_Rep, Int (Size), Int (Alignment / 8));
+        (Ent, Pos (Digs), Float_Rep, Int (Size), Nat (Alignment / 8));
 
       Append_New_Elmt (Ent, Back_End_Float_Types);
    end Register_Float_Type;
diff --git a/gcc/ada/set_targ.ads b/gcc/ada/set_targ.ads
index b2e598fbb96b..e465c3ff5a15 100644
--- a/gcc/ada/set_targ.ads
+++ b/gcc/ada/set_targ.ads
@@ -93,7 +93,7 @@ package Set_Targ is
 
    type FPT_Mode_Entry is record
       NAME      : String_Ptr;     -- Name of mode (no null character at end)
-      DIGS      : Natural;        -- Digits for floating-point type
+      DIGS      : Positive;       -- Digits for floating-point type
       FLOAT_REP : Float_Rep_Kind; -- Float representation
       PRECISION : Natural;        -- Precision in bits
       SIZE      : Natural;        -- Size in bits

Reply via email to