OSDN Git Service

* gcc-interface/decl.c (make_type_from_size) <INTEGER_TYPE>: Just copy
[pf3gnuchains/gcc-fork.git] / gcc / ada / g-diopit.adb
index 8fa2e4b..ccab560 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---                  Copyright (C) 2001-2005 Adacore, Inc.                   --
+--                     Copyright (C) 2001-2008, AdaCore                     --
 --                                                                          --
 -- 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- --
@@ -16,8 +16,8 @@
 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
 -- for  more details.  You should have  received  a copy of the GNU General --
 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
--- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
--- MA 02111-1307, USA.                                                      --
+-- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
+-- Boston, MA 02110-1301, USA.                                              --
 --                                                                          --
 -- As a special exception,  if other files  instantiate  generics from this --
 -- unit, or you link  this unit with other files  to produce an executable, --
@@ -51,13 +51,14 @@ package body GNAT.Directory_Operations.Iteration is
    is
       File_Regexp : constant Regexp.Regexp := Regexp.Compile (File_Pattern);
       Index       : Natural := 0;
+      Quit        : Boolean;
 
       procedure Read_Directory (Directory : Dir_Name_Str);
       --  Open Directory and read all entries. This routine is called
       --  recursively for each sub-directories.
 
       function Make_Pathname (Dir, File : String) return String;
-      --  Returns the pathname for File by adding Dir as prefix.
+      --  Returns the pathname for File by adding Dir as prefix
 
       -------------------
       -- Make_Pathname --
@@ -77,10 +78,11 @@ package body GNAT.Directory_Operations.Iteration is
       --------------------
 
       procedure Read_Directory (Directory : Dir_Name_Str) is
-         Dir    : Dir_Type;
          Buffer : String (1 .. 2_048);
          Last   : Natural;
-         Quit   : Boolean;
+
+         Dir : Dir_Type;
+         pragma Warnings (Off, Dir);
 
       begin
          Open (Dir, Directory);
@@ -96,7 +98,6 @@ package body GNAT.Directory_Operations.Iteration is
 
             begin
                if Regexp.Match (Dir_Entry, File_Regexp) then
-                  Quit  := False;
                   Index := Index + 1;
 
                   begin
@@ -116,6 +117,7 @@ package body GNAT.Directory_Operations.Iteration is
                  and then OS_Lib.Is_Directory (Pathname)
                then
                   Read_Directory (Pathname);
+                  exit when Quit;
                end if;
             end;
          end loop;
@@ -124,6 +126,7 @@ package body GNAT.Directory_Operations.Iteration is
       end Read_Directory;
 
    begin
+      Quit := False;
       Read_Directory (Root_Directory);
    end Find;
 
@@ -318,7 +321,10 @@ package body GNAT.Directory_Operations.Iteration is
       is
          File_Regexp : constant Regexp.Regexp :=
                          Regexp.Compile (File_Pattern, Glob => True);
-         Dir    : Dir_Type;
+
+         Dir : Dir_Type;
+         pragma Warnings (Off, Dir);
+
          Buffer : String (1 .. 2_048);
          Last   : Natural;
 
@@ -370,7 +376,7 @@ package body GNAT.Directory_Operations.Iteration is
                end;
 
                --  Exit if Quit set by call to Action, either at this level
-               --  or at at some lower recursive call to Next_Level.
+               --  or at some lower recursive call to Next_Level.
 
                exit Dir_Iterator when Quit;
             end loop Dir_Iterator;
@@ -379,6 +385,8 @@ package body GNAT.Directory_Operations.Iteration is
          end if;
       end Read;
 
+   --  Start of processing for Wildcard_Iterator
+
    begin
       if Path = "" then
          return;