]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Move constant declaration
authorRonan Desplanques <desplanques@adacore.com>
Thu, 9 Oct 2025 08:08:50 +0000 (10:08 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 3 Nov 2025 14:15:16 +0000 (15:15 +0100)
This patch reduces the scope of a recently introduced variable because
it was much larger than it needed to be.

gcc/ada/ChangeLog:

* libgnat/s-stratt.adb (W_80IEEE): Make constant local.

gcc/ada/libgnat/s-stratt.adb

index 61bfa38f638fe14abf03f73df85eefca828bf87b..9315ae11ed449858bdab7037626b0102836c5bfd 100644 (file)
@@ -1036,8 +1036,6 @@ package body System.Stream_Attributes is
       Ada.Streams.Write (Stream.all, From_WWC (Item));
    end W_WWC;
 
-   N_IEEE_Extended_Precision_Bytes : constant := 10;
-
    procedure W_80IEEE (Stream : not null access RST; Item : Long_Long_Float) is
    begin
       if XDR_Support then
@@ -1047,6 +1045,8 @@ package body System.Stream_Attributes is
 
       declare
          X : S_LLF := From_LLF (Item);
+
+         N_IEEE_Extended_Precision_Bytes : constant := 10;
       begin
          X (N_IEEE_Extended_Precision_Bytes + 1 .. X'Last) := (others => 0);
          Ada.Streams.Write (Stream.all, X);