From bcb0389ef322d30c3031fffe2e6ed0ed7df494d6 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 2 May 2016 09:53:16 +0000 Subject: get_spark_xrefs.adb (Get_Nat, Get_Name): Initialize variables when they are declared... 2016-05-02 Arnaud Charlet * 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 --- gcc/ada/ChangeLog | 8 ++++++++ gcc/ada/eval_fat.adb | 6 +++--- gcc/ada/exp_ch3.adb | 2 +- gcc/ada/get_spark_xrefs.adb | 12 ++++-------- gcc/ada/gnatcmd.adb | 2 +- gcc/ada/prj-nmsc.adb | 4 ++-- gcc/ada/prj.adb | 4 ++-- gcc/ada/s-intman-android.adb | 4 ++-- gcc/ada/s-intman-posix.adb | 4 ++-- gcc/ada/sem_ch5.adb | 2 +- gcc/ada/sem_ch8.adb | 6 +++--- gcc/ada/sem_util.adb | 2 +- 12 files changed, 30 insertions(+), 26 deletions(-) (limited to 'gcc/ada') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index fe60f30..f5fe64f 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2016-05-02 Arnaud Charlet + + * 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 * a-tigeli.adb (Get_Line): Always set Last prior to returning. diff --git a/gcc/ada/eval_fat.adb b/gcc/ada/eval_fat.adb index 5b56ddd..df6e35a 100644 --- a/gcc/ada/eval_fat.adb +++ b/gcc/ada/eval_fat.adb @@ -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 diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index f0213ff..2eefb3d 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -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 diff --git a/gcc/ada/get_spark_xrefs.adb b/gcc/ada/get_spark_xrefs.adb index e0b58ce..9286678 100644 --- a/gcc/ada/get_spark_xrefs.adb +++ b/gcc/ada/get_spark_xrefs.adb @@ -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; diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb index 542d370..ce880ca 100644 --- a/gcc/ada/gnatcmd.adb +++ b/gcc/ada/gnatcmd.adb @@ -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; diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index 6c9db46..fb8ce27 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -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 diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb index ac5b445..35226db 100644 --- a/gcc/ada/prj.adb +++ b/gcc/ada/prj.adb @@ -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; diff --git a/gcc/ada/s-intman-android.adb b/gcc/ada/s-intman-android.adb index 30a980e..2822cbd 100644 --- a/gcc/ada/s-intman-android.adb +++ b/gcc/ada/s-intman-android.adb @@ -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))); diff --git a/gcc/ada/s-intman-posix.adb b/gcc/ada/s-intman-posix.adb index cbe0ea8..7cf08c8 100644 --- a/gcc/ada/s-intman-posix.adb +++ b/gcc/ada/s-intman-posix.adb @@ -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); diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index bdfe02e..5a755d0 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -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); diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 3f8556d..05f1d46 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -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; diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 4fc783f..34f3a20 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -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; -- cgit v1.1