get_spark_xrefs.adb (Get_Nat, Get_Name): Initialize variables when they are declared...

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
This commit is contained in:
Arnaud Charlet 2016-05-02 09:53:16 +00:00 committed by Arnaud Charlet
parent ef25192bee
commit bcb0389ef3
12 changed files with 30 additions and 26 deletions

View 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> 2016-05-02 Yannick Moy <moy@adacore.com>
* a-tigeli.adb (Get_Line): Always set Last prior to returning. * a-tigeli.adb (Get_Line): Always set Last prior to returning.

View File

@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- 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); Result := Truncation (RT, abs X);
Tail := abs X - Result; Tail := abs X - Result;
if Tail >= Ureal_Half then if Tail >= Ureal_Half then
Result := Result + Ureal_1; Result := Result + Ureal_1;
end if; end if;
@ -761,7 +761,7 @@ package body Eval_Fat is
Result := Truncation (RT, Abs_X); Result := Truncation (RT, Abs_X);
Tail := Abs_X - Result; Tail := Abs_X - Result;
if Tail > Ureal_Half then if Tail > Ureal_Half then
Result := Result + Ureal_1; Result := Result + Ureal_1;
elsif Tail = Ureal_Half then elsif Tail = Ureal_Half then

View File

@ -3921,7 +3921,7 @@ package body Exp_Ch3 is
-- return; -- return;
-- end if; -- end if;
-- if Rev then -- if Rev then
-- Li1 := Left_Hi; -- Li1 := Left_Hi;
-- Ri1 := Right_Hi; -- Ri1 := Right_Hi;
-- else -- else

View File

@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- 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 function Get_Nat return Nat is
Val : Nat; Val : Nat := 0;
C : Character; C : Character := Nextc;
begin begin
C := Nextc;
Val := 0;
if C not in '0' .. '9' then if C not in '0' .. '9' then
raise Data_Error; raise Data_Error;
end if; end if;
@ -152,10 +149,9 @@ procedure Get_SPARK_Xrefs is
-------------- --------------
procedure Get_Name is procedure Get_Name is
N : Integer; N : Natural := 0;
begin begin
N := 0;
while Nextc > ' ' loop while Nextc > ' ' loop
N := N + 1; N := N + 1;
Name_Str (N) := Getc; Name_Str (N) := Getc;

View File

@ -701,7 +701,7 @@ begin
if Call_GPR_Tool then if Call_GPR_Tool then
case The_Command is case The_Command is
when Make | Compile | Bind | Link => 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); Program := new String'(Gprbuild);
Get_Target := True; Get_Target := True;

View File

@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- 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 -- An extending project inherits its parent projects' languages
-- so if needed we should create entries for those languages -- so if needed we should create entries for those languages
if Lang = null then if Lang = null then
Extended := Project.Extends; Extended := Project.Extends;
while Extended /= null loop while Extended /= null loop
Lang := Get_Language_From_Name Lang := Get_Language_From_Name

View File

@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- 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); pragma Warnings (Off, Dont_Care);
begin begin
if not Opt.Keep_Temporary_Files then if not Opt.Keep_Temporary_Files then
if Current_Verbosity = High then if Current_Verbosity = High then
Write_Line ("Removing temp file: " & Get_Name_String (Path)); Write_Line ("Removing temp file: " & Get_Name_String (Path));
end if; end if;

View File

@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- 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 -- Add signals that map to Ada exceptions to the mask
for J in Exception_Interrupts'Range loop for J in Exception_Interrupts'Range loop
if State (Exception_Interrupts (J)) /= Default then if State (Exception_Interrupts (J)) /= Default then
Result := Result :=
sigaddset sigaddset
(Signal_Mask'Access, Signal (Exception_Interrupts (J))); (Signal_Mask'Access, Signal (Exception_Interrupts (J)));

View File

@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- 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 -- Add signals that map to Ada exceptions to the mask
for J in Exception_Interrupts'Range loop for J in Exception_Interrupts'Range loop
if State (Exception_Interrupts (J)) /= Default then if State (Exception_Interrupts (J)) /= Default then
Result := Result :=
sigaddset (Signal_Mask'Access, Signal (Exception_Interrupts (J))); sigaddset (Signal_Mask'Access, Signal (Exception_Interrupts (J)));
pragma Assert (Result = 0); pragma Assert (Result = 0);

View File

@ -3217,7 +3217,7 @@ package body Sem_Ch5 is
-- Verify that the loop name is hot hidden by an unrelated -- Verify that the loop name is hot hidden by an unrelated
-- declaration in an inner scope. -- 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_Sloc := Sloc (Ent);
Error_Msg_N ("implicit label declaration for & is hidden#", Id); Error_Msg_N ("implicit label declaration for & is hidden#", Id);

View File

@ -6957,7 +6957,7 @@ package body Sem_Ch8 is
-- Issue error message, but avoid this if error issued already. -- Issue error message, but avoid this if error issued already.
-- Use identifier of prefix if one is available. -- Use identifier of prefix if one is available.
if P_Name = Any_Id then if P_Name = Any_Id then
null; null;
-- It is not an error if the prefix is the current instance of -- 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); Next (Pack_Name);
end loop; end loop;
elsif Nkind (Decl) = N_Use_Type_Clause then elsif Nkind (Decl) = N_Use_Type_Clause then
Chain_Use_Clause (Decl); Chain_Use_Clause (Decl);
Id := First (Subtype_Marks (Decl)); Id := First (Subtype_Marks (Decl));
@ -9152,7 +9152,7 @@ package body Sem_Ch8 is
Ent1 := Entity_Of_Unit (Unit1); Ent1 := Entity_Of_Unit (Unit1);
Ent2 := Entity_Of_Unit (Unit2); 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)); Error_Msg_Sloc := Sloc (Current_Use_Clause (T));
Err_No := Clause1; Err_No := Clause1;

View File

@ -7153,7 +7153,7 @@ package body Sem_Util is
end if; end if;
while Present (Old_Disc) and then Present (New_Disc) loop 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; return New_Disc;
end if; end if;