]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
a-coinve.adb: Reorder the code to avoid uninitialized warning.
authorPascal Obry <obry@adacore.com>
Tue, 5 Aug 2008 13:23:44 +0000 (15:23 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 5 Aug 2008 13:23:44 +0000 (15:23 +0200)
2008-08-05  Pascal Obry  <obry@adacore.com>

* a-coinve.adb: Reorder the code to avoid uninitialized warning.

From-SVN: r138701

gcc/ada/a-coinve.adb

index c97f4eb2406c6d276c6a7207391e8685b40392be..0f107be4356a511cf3e6befe3767c8fe77f3cd2d 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2004-2007, Free Software Foundation, Inc.         --
+--          Copyright (C) 2004-2008, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -1124,13 +1124,12 @@ package body Ada.Containers.Indefinite_Vectors is
 
                   Index : constant Index_Type := Index_Type (Index_As_Int);
 
-                  J : Index_Type'Base;
+                  J : Index_Type'Base := Before;
 
                begin
                   E (Index .. New_Last) := E (Before .. Container.Last);
                   Container.Last := New_Last;
 
-                  J := Before;
                   while J < Index loop
                      E (J) := new Element_Type'(New_Item);
                      J := J + 1;