get_spark_xrefs.adb (Get_Nat, Get_Name): Initialize variables when they are declared...
authorArnaud Charlet <charlet@adacore.com>
Mon, 2 May 2016 09:53:16 +0000 (09:53 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 2 May 2016 09:53:16 +0000 (11:53 +0200)
2016-05-02  Arnaud Charlet  <charlet@adacore.com>

* get_spark_xrefs.adb (Get_Nat, Get_Name): Initialize variables when
they are declared; refine type of a counter from Integer to Natural.
* sem_ch5.adb, gnatcmd.adb, s-intman-posix.adb, eval_fat.adb,
prj.adb, sem_util.adb, s-intman-android.adb, prj-nmsc.adb, sem_ch8.adb,
exp_ch3.adb: Minor editing.

From-SVN: r235729

12 files changed:
gcc/ada/ChangeLog
gcc/ada/eval_fat.adb
gcc/ada/exp_ch3.adb
gcc/ada/get_spark_xrefs.adb
gcc/ada/gnatcmd.adb
gcc/ada/prj-nmsc.adb
gcc/ada/prj.adb
gcc/ada/s-intman-android.adb
gcc/ada/s-intman-posix.adb
gcc/ada/sem_ch5.adb
gcc/ada/sem_ch8.adb
gcc/ada/sem_util.adb

index fe60f30..f5fe64f 100644 (file)
@@ -1,3 +1,11 @@
+2016-05-02  Arnaud Charlet  <charlet@adacore.com>
+
+       * get_spark_xrefs.adb (Get_Nat, Get_Name): Initialize variables when
+       they are declared; refine type of a counter from Integer to Natural.
+       * sem_ch5.adb, gnatcmd.adb, s-intman-posix.adb, eval_fat.adb,
+       prj.adb, sem_util.adb, s-intman-android.adb, prj-nmsc.adb, sem_ch8.adb,
+       exp_ch3.adb: Minor editing.
+
 2016-05-02  Yannick Moy  <moy@adacore.com>
 
        * a-tigeli.adb (Get_Line): Always set Last prior to returning.
index 5b56ddd..df6e35a 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2015, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2016, 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- --
@@ -666,7 +666,7 @@ package body Eval_Fat is
       Result := Truncation (RT, abs X);
       Tail   := abs X - Result;
 
-      if Tail >= Ureal_Half  then
+      if Tail >= Ureal_Half then
          Result := Result + Ureal_1;
       end if;
 
@@ -761,7 +761,7 @@ package body Eval_Fat is
       Result := Truncation (RT, Abs_X);
       Tail   := Abs_X - Result;
 
-      if Tail > Ureal_Half  then
+      if Tail > Ureal_Half then
          Result := Result + Ureal_1;
 
       elsif Tail = Ureal_Half then
index f0213ff..2eefb3d 100644 (file)
@@ -3921,7 +3921,7 @@ package body Exp_Ch3 is
    --          return;
    --       end if;
 
-   --       if Rev  then
+   --       if Rev then
    --          Li1 := Left_Hi;
    --          Ri1 := Right_Hi;
    --       else
index e0b58ce..9286678 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2011-2015, Free Software Foundation, Inc.         --
+--          Copyright (C) 2011-2016, 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- --
@@ -114,13 +114,10 @@ procedure Get_SPARK_Xrefs is
    -------------
 
    function Get_Nat return Nat is
-      Val : Nat;
-      C   : Character;
+      Val : Nat := 0;
+      C   : Character := Nextc;
 
    begin
-      C := Nextc;
-      Val := 0;
-
       if C not in '0' .. '9' then
          raise Data_Error;
       end if;
@@ -152,10 +149,9 @@ procedure Get_SPARK_Xrefs is
    --------------
 
    procedure Get_Name is
-      N : Integer;
+      N : Natural := 0;
 
    begin
-      N := 0;
       while Nextc > ' ' loop
          N := N + 1;
          Name_Str (N) := Getc;
index 542d370..ce880ca 100644 (file)
@@ -701,7 +701,7 @@ begin
                if Call_GPR_Tool then
                   case The_Command is
                      when Make | Compile | Bind | Link =>
-                        if Locate_Exec_On_Path (Gprbuild) /= null  then
+                        if Locate_Exec_On_Path (Gprbuild) /= null then
                            Program    := new String'(Gprbuild);
                            Get_Target := True;
 
index 6c9db46..fb8ce27 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2000-2015, Free Software Foundation, Inc.         --
+--          Copyright (C) 2000-2016, 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- --
@@ -4452,7 +4452,7 @@ package body Prj.Nmsc is
             --  An extending project inherits its parent projects' languages
             --  so if needed we should create entries for those languages
 
-            if Lang = null  then
+            if Lang = null then
                Extended := Project.Extends;
                while Extended /= null loop
                   Lang := Get_Language_From_Name
index ac5b445..35226db 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2001-2015, Free Software Foundation, Inc.         --
+--          Copyright (C) 2001-2016, 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- --
@@ -190,7 +190,7 @@ package body Prj is
       pragma Warnings (Off, Dont_Care);
 
    begin
-      if not Opt.Keep_Temporary_Files  then
+      if not Opt.Keep_Temporary_Files then
          if Current_Verbosity = High then
             Write_Line ("Removing temp file: " & Get_Name_String (Path));
          end if;
index 30a980e..2822cbd 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                  B o d y                                 --
 --                                                                          --
---             Copyright (C) 2014, Free Software Foundation, Inc.           --
+--          Copyright (C) 2014-2016, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNARL 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- --
@@ -239,7 +239,7 @@ package body System.Interrupt_Management is
       --  Add signals that map to Ada exceptions to the mask
 
       for J in Exception_Interrupts'Range loop
-         if State (Exception_Interrupts (J)) /= Default  then
+         if State (Exception_Interrupts (J)) /= Default then
             Result :=
               sigaddset
                 (Signal_Mask'Access, Signal (Exception_Interrupts (J)));
index cbe0ea8..7cf08c8 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                  B o d y                                 --
 --                                                                          --
---          Copyright (C) 1992-2009, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2016, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNARL 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- --
@@ -202,7 +202,7 @@ package body System.Interrupt_Management is
       --  Add signals that map to Ada exceptions to the mask
 
       for J in Exception_Interrupts'Range loop
-         if State (Exception_Interrupts (J)) /= Default  then
+         if State (Exception_Interrupts (J)) /= Default then
             Result :=
             sigaddset (Signal_Mask'Access, Signal (Exception_Interrupts (J)));
             pragma Assert (Result = 0);
index bdfe02e..5a755d0 100644 (file)
@@ -3217,7 +3217,7 @@ package body Sem_Ch5 is
          --  Verify that the loop name is hot hidden by an unrelated
          --  declaration in an inner scope.
 
-         elsif Ekind (Ent) /= E_Label and then Ekind (Ent) /= E_Loop  then
+         elsif Ekind (Ent) /= E_Label and then Ekind (Ent) /= E_Loop then
             Error_Msg_Sloc := Sloc (Ent);
             Error_Msg_N ("implicit label declaration for & is hidden#", Id);
 
index 3f8556d..05f1d46 100644 (file)
@@ -6957,7 +6957,7 @@ package body Sem_Ch8 is
             --  Issue error message, but avoid this if error issued already.
             --  Use identifier of prefix if one is available.
 
-            if P_Name = Any_Id  then
+            if P_Name = Any_Id then
                null;
 
             --  It is not an error if the prefix is the current instance of
@@ -8610,7 +8610,7 @@ package body Sem_Ch8 is
                   Next (Pack_Name);
                end loop;
 
-            elsif Nkind (Decl) = N_Use_Type_Clause  then
+            elsif Nkind (Decl) = N_Use_Type_Clause then
                Chain_Use_Clause (Decl);
 
                Id := First (Subtype_Marks (Decl));
@@ -9152,7 +9152,7 @@ package body Sem_Ch8 is
                      Ent1 := Entity_Of_Unit (Unit1);
                      Ent2 := Entity_Of_Unit (Unit2);
 
-                     if Scope (Ent2) = Standard_Standard  then
+                     if Scope (Ent2) = Standard_Standard then
                         Error_Msg_Sloc := Sloc (Current_Use_Clause (T));
                         Err_No := Clause1;
 
index 4fc783f..34f3a20 100644 (file)
@@ -7153,7 +7153,7 @@ package body Sem_Util is
       end if;
 
       while Present (Old_Disc) and then Present (New_Disc) loop
-         if Old_Disc = Par_Disc  then
+         if Old_Disc = Par_Disc then
             return New_Disc;
          end if;