]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Refine type of a local size variable
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 14 Dec 2020 13:49:02 +0000 (14:49 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 29 Apr 2021 08:00:46 +0000 (04:00 -0400)
gcc/ada/

* layout.adb (Layout_Type): Refine type of a local variable with
the required size of object from Int to Pos (it is initialized
with 8 and only multiplied by 2); fix unbalanced parens in
comment.

gcc/ada/layout.adb

index ad808495e604707f070dc3c77bd0793c3f1d6639..0c65870503f06e36c4cb59de5ec2fac458bddd1f 100644 (file)
@@ -368,7 +368,7 @@ package body Layout is
 
             if not Known_Esize (E) then
                declare
-                  S : Int := 8;
+                  S : Pos := 8;
 
                begin
                   loop
@@ -381,7 +381,7 @@ package body Layout is
                      --  If the RM_Size is greater than System_Max_Integer_Size
                      --  (happens only when strange values are specified by the
                      --  user), then Esize is simply a copy of RM_Size, it will
-                     --  be further refined later on).
+                     --  be further refined later on.
 
                      elsif S = System_Max_Integer_Size then
                         Set_Esize (E, RM_Size (E));