summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-07 12:42:43 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-07 12:42:43 +0000
commit063ed58ba58dbc58df2d0e1176dc962f0ffd7c45 (patch)
treeb7d0419a6b1561d3e0b6744e89abd1f3e5bb63bd /gcc
parent6ecef78852742a5294ce9e5ece9d0cd92af18db9 (diff)
downloadgcc-063ed58ba58dbc58df2d0e1176dc962f0ffd7c45.tar.gz
2009-07-07 Robert Dewar <dewar@adacore.com>
* a-calend.adb: Minor code reorganization (use conditional expressions) * s-stusta.ads, s-interr-hwint.adb, g-expect-vms.adb, s-secsta.ads, prj-nmsc.adb, a-teioed.adb, output.ads, prj-attr.ads, a-textio.adb, s-taskin.ads, scans.ads, s-osinte-vms.adb, s-taprop-solaris.adb, s-tpopsp-posix-foreign.adb, s-trafor-default.adb, gnat1drv.adb, s-stchop-vxworks.adb, s-tpopsp-posix.adb, prj-env.adb, prj-env.ads, g-comlin.adb, exp_ch11.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149320 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog11
-rw-r--r--gcc/ada/a-calend.adb32
-rw-r--r--gcc/ada/a-teioed.adb21
-rw-r--r--gcc/ada/a-textio.adb22
-rw-r--r--gcc/ada/exp_ch11.adb2
-rw-r--r--gcc/ada/g-comlin.adb4
-rw-r--r--gcc/ada/g-expect-vms.adb2
-rw-r--r--gcc/ada/gnat1drv.adb4
-rw-r--r--gcc/ada/output.ads2
-rw-r--r--gcc/ada/prj-attr.ads4
-rw-r--r--gcc/ada/prj-env.adb35
-rw-r--r--gcc/ada/prj-env.ads4
-rw-r--r--gcc/ada/prj-nmsc.adb88
-rw-r--r--gcc/ada/s-interr-hwint.adb2
-rw-r--r--gcc/ada/s-osinte-vms.adb4
-rw-r--r--gcc/ada/s-secsta.ads1
-rw-r--r--gcc/ada/s-stchop-vxworks.adb17
-rw-r--r--gcc/ada/s-stusta.ads6
-rw-r--r--gcc/ada/s-taprop-solaris.adb2
-rw-r--r--gcc/ada/s-taskin.ads2
-rw-r--r--gcc/ada/s-tpopsp-posix-foreign.adb2
-rw-r--r--gcc/ada/s-tpopsp-posix.adb2
-rw-r--r--gcc/ada/s-trafor-default.adb17
-rw-r--r--gcc/ada/scans.ads7
24 files changed, 160 insertions, 133 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index edb7aeeb921..c8c03216382 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,14 @@
+2009-07-07 Robert Dewar <dewar@adacore.com>
+
+ * a-calend.adb: Minor code reorganization (use conditional expressions)
+
+ * s-stusta.ads, s-interr-hwint.adb, g-expect-vms.adb, s-secsta.ads,
+ prj-nmsc.adb, a-teioed.adb, output.ads, prj-attr.ads, a-textio.adb,
+ s-taskin.ads, scans.ads, s-osinte-vms.adb, s-taprop-solaris.adb,
+ s-tpopsp-posix-foreign.adb, s-trafor-default.adb, gnat1drv.adb,
+ s-stchop-vxworks.adb, s-tpopsp-posix.adb, prj-env.adb, prj-env.ads,
+ g-comlin.adb, exp_ch11.adb: Minor reformatting.
+
2009-07-07 Gary Dismukes <dismukes@adacore.com>
* checks.adb (Generate_Range_Check): Replace type conversions with
diff --git a/gcc/ada/a-calend.adb b/gcc/ada/a-calend.adb
index 4c340eec0d1..04ea98b1884 100644
--- a/gcc/ada/a-calend.adb
+++ b/gcc/ada/a-calend.adb
@@ -940,11 +940,7 @@ package body Ada.Calendar is
-- Step 3: Handle leap second occurrences
- if Leap_Sec then
- tm_sec := 60;
- else
- tm_sec := Second;
- end if;
+ tm_sec := (if Leap_Sec then 60 else Second);
end To_Struct_Tm;
------------------
@@ -1014,11 +1010,8 @@ package body Ada.Calendar is
-- the input. Guard against very large delay values such as the end
-- of time since the computation will overflow.
- if Res_N > Safe_Ada_High then
- Res_N := Safe_Ada_High;
- else
- Res_N := Res_N + Epoch_Offset;
- end if;
+ Res_N := (if Res_N > Safe_Ada_High then Safe_Ada_High
+ else Res_N + Epoch_Offset);
return Time_Rep_To_Duration (Res_N);
end To_Duration;
@@ -1495,7 +1488,7 @@ package body Ada.Calendar is
---------------------
function UTC_Time_Offset (Date : Time) return Long_Integer is
- Adj_Cent : Integer := 0;
+ Adj_Cent : Integer;
Date_N : Time_Rep;
Offset : aliased long;
Secs_T : aliased time_t;
@@ -1507,18 +1500,11 @@ package body Ada.Calendar is
-- saving and so on. Non-leap centennial years violate this rule by
-- one day and as a consequence, special adjustment is needed.
- if Date_N > T_2100_2_28 then
- if Date_N > T_2200_2_28 then
- if Date_N > T_2300_2_28 then
- Adj_Cent := 3;
- else
- Adj_Cent := 2;
- end if;
-
- else
- Adj_Cent := 1;
- end if;
- end if;
+ Adj_Cent :=
+ (if Date_N <= T_2100_2_28 then 0
+ elsif Date_N <= T_2200_2_28 then 1
+ elsif Date_N <= T_2300_2_28 then 2
+ else 3);
if Adj_Cent > 0 then
Date_N := Date_N - Time_Rep (Adj_Cent) * Nanos_In_Day;
diff --git a/gcc/ada/a-teioed.adb b/gcc/ada/a-teioed.adb
index 8d3e01faada..2d6a3a9b75a 100644
--- a/gcc/ada/a-teioed.adb
+++ b/gcc/ada/a-teioed.adb
@@ -306,14 +306,12 @@ package body Ada.Text_IO.Editing is
raise Ada.Text_IO.Layout_Error;
end if;
- if Pic.Radix_Position = Invalid_Position then
- Position := Answer'Last;
- else
- Position := Pic.Radix_Position - 1;
- end if;
+ Position :=
+ (if Pic.Radix_Position = Invalid_Position
+ then Answer'Last
+ else Pic.Radix_Position - 1);
for J in reverse Attrs.Start_Of_Int .. Attrs.End_Of_Int loop
-
while Answer (Position) /= '9'
and Answer (Position) /= Pic.Floater
loop
@@ -562,7 +560,6 @@ package body Ada.Text_IO.Editing is
Last := Pic.Radix_Position + 1;
for J in Last .. Answer'Last loop
-
if Answer (J) = '9' or Answer (J) = Pic.Floater then
Answer (J) := Rounded (Position);
@@ -624,15 +621,13 @@ package body Ada.Text_IO.Editing is
-- No trailing digits, but now J may need to stick in a currency
-- symbol or sign.
- if Pic.Start_Currency = Invalid_Position then
- Position := Answer'Last + 1;
- else
- Position := Pic.Start_Currency;
- end if;
+ Position :=
+ (if Pic.Start_Currency = Invalid_Position
+ then Answer'Last + 1
+ else Pic.Start_Currency);
end if;
for J in Position .. Answer'Last loop
-
if Pic.Start_Currency /= Invalid_Position and then
Answer (Pic.Start_Currency) = '#' then
Currency_Pos := 1;
diff --git a/gcc/ada/a-textio.adb b/gcc/ada/a-textio.adb
index 5e76ebb34b0..4ea003dcda8 100644
--- a/gcc/ada/a-textio.adb
+++ b/gcc/ada/a-textio.adb
@@ -562,13 +562,10 @@ package body Ada.Text_IO is
if ch = EOF then
raise End_Error;
else
- if not Is_Start_Of_Encoding
- (Character'Val (ch), File.WC_Method)
- then
- Item := Character'Val (ch);
- else
- Item := Get_Upper_Half_Char_Immed (Character'Val (ch), File);
- end if;
+ Item :=
+ (if not Is_Start_Of_Encoding (Character'Val (ch), File.WC_Method)
+ then Character'Val (ch)
+ else Get_Upper_Half_Char_Immed (Character'Val (ch), File));
end if;
end if;
end Get_Immediate;
@@ -625,13 +622,10 @@ package body Ada.Text_IO is
else
Available := True;
- if Is_Start_Of_Encoding
- (Character'Val (ch), File.WC_Method)
- then
- Item := Character'Val (ch);
- else
- Item := Get_Upper_Half_Char_Immed (Character'Val (ch), File);
- end if;
+ Item :=
+ (if Is_Start_Of_Encoding (Character'Val (ch), File.WC_Method)
+ then Character'Val (ch)
+ else Get_Upper_Half_Char_Immed (Character'Val (ch), File));
end if;
end if;
diff --git a/gcc/ada/exp_ch11.adb b/gcc/ada/exp_ch11.adb
index 961716685b5..51d2f69a1b7 100644
--- a/gcc/ada/exp_ch11.adb
+++ b/gcc/ada/exp_ch11.adb
@@ -1401,9 +1401,7 @@ package body Exp_Ch11 is
-- If a string expression is present, then the raise statement is
-- converted to a call:
-
-- Raise_Exception (exception-name'Identity, string);
-
-- and there is nothing else to do.
if Present (Expression (N)) then
diff --git a/gcc/ada/g-comlin.adb b/gcc/ada/g-comlin.adb
index b0106226252..e655cad763d 100644
--- a/gcc/ada/g-comlin.adb
+++ b/gcc/ada/g-comlin.adb
@@ -113,10 +113,10 @@ package body GNAT.Command_Line is
-- the beginning, else it is appended.
function Can_Have_Parameter (S : String) return Boolean;
- -- True if S can have a parameter.
+ -- True if S can have a parameter
function Require_Parameter (S : String) return Boolean;
- -- True if S requires a parameter.
+ -- True if S requires a parameter
function Actual_Switch (S : String) return String;
-- Remove any possible trailing '!', ':', '?' and '='
diff --git a/gcc/ada/g-expect-vms.adb b/gcc/ada/g-expect-vms.adb
index 1162f50aa69..429a66ca55c 100644
--- a/gcc/ada/g-expect-vms.adb
+++ b/gcc/ada/g-expect-vms.adb
@@ -1103,7 +1103,7 @@ package body GNAT.Expect is
-- currently we can cleanly close the unneeded ends of the pipes, but
-- this doesn't really matter.
- -- We could close Pipe1.Output, Pipe2.Input, Pipe3.Input.
+ -- We could close Pipe1.Output, Pipe2.Input, Pipe3.Input
Dup2 (Pipe1.Input, GNAT.OS_Lib.Standin);
Dup2 (Pipe2.Output, GNAT.OS_Lib.Standout);
diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb
index 93f2297bc02..b5a3354323e 100644
--- a/gcc/ada/gnat1drv.adb
+++ b/gcc/ada/gnat1drv.adb
@@ -87,7 +87,7 @@ procedure Gnat1drv is
-- There are various interactions between front end switch settings,
-- including debug switch settings and target dependent parameters.
-- This procedure takes care of properly handling these interactions.
- -- We do it after scanning out all the switches, that way we are not
+ -- We do it after scanning out all the switches, so that we are not
-- depending on the order in which switches appear.
procedure Check_Bad_Body;
@@ -174,7 +174,7 @@ procedure Gnat1drv is
-- Deal with forcing OpenVMS switches True if debug flag M is set, but
-- record the setting of Targparm.Open_VMS_On_Target in True_VMS_Target
- -- before doing this, so we know if we are in real openVMS or not!
+ -- before doing this, so we know if we are in real OpenVMS or not!
Opt.True_VMS_Target := Targparm.OpenVMS_On_Target;
diff --git a/gcc/ada/output.ads b/gcc/ada/output.ads
index 6e9176e8802..7f13dc24b15 100644
--- a/gcc/ada/output.ads
+++ b/gcc/ada/output.ads
@@ -91,7 +91,7 @@ package Output is
-- beginning of the line, wrapping around if it gets too long.
procedure Outdent;
- -- Decreases the current indentation level.
+ -- Decreases the current indentation level
procedure Write_Char (C : Character);
-- Write one character to the standard output file. If the character is LF,
diff --git a/gcc/ada/prj-attr.ads b/gcc/ada/prj-attr.ads
index d1839e527d1..a8f9e15412e 100644
--- a/gcc/ada/prj-attr.ads
+++ b/gcc/ada/prj-attr.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2009, 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- --
@@ -183,7 +183,7 @@ package Prj.Attr is
-- Default value of Package_Node_Id objects
Unknown_Package : constant Package_Node_Id;
- -- Value of an unknown package that has been found but is unknown.
+ -- Value of an unknown package that has been found but is unknown
procedure Register_New_Package (Name : String; Id : out Package_Node_Id);
-- Add a new package. Fails if Name (the package name) is empty or is
diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb
index 3478676be81..e3766b5d70e 100644
--- a/gcc/ada/prj-env.adb
+++ b/gcc/ada/prj-env.adb
@@ -384,8 +384,8 @@ package body Prj.Env is
--------------------------------
procedure Create_Config_Pragmas_File
- (For_Project : Project_Id;
- In_Tree : Project_Tree_Ref)
+ (For_Project : Project_Id;
+ In_Tree : Project_Tree_Ref)
is
type Naming_Id is new Nat;
package Naming_Table is new GNAT.Dynamic_Tables
@@ -436,8 +436,9 @@ package body Prj.Env is
procedure Check (Project : Project_Id; State : in out Integer) is
pragma Unreferenced (State);
Lang : constant Language_Ptr :=
- Get_Language_From_Name (Project, "ada");
+ Get_Language_From_Name (Project, "ada");
Naming : Lang_Naming_Data;
+
begin
if Current_Verbosity = High then
Write_Str ("Checking project file """);
@@ -450,6 +451,7 @@ package body Prj.Env is
if Current_Verbosity = High then
Write_Str ("Languages does not contain Ada, nothing to do");
end if;
+
return;
end if;
@@ -460,11 +462,11 @@ package body Prj.Env is
Current_Naming := Default_Naming;
while Current_Naming <= Naming_Table.Last (Namings)
and then Namings.Table (Current_Naming).Dot_Replacement =
- Naming.Dot_Replacement
+ Naming.Dot_Replacement
and then Namings.Table (Current_Naming).Casing =
- Naming.Casing
+ Naming.Casing
and then Namings.Table (Current_Naming).Separate_Suffix =
- Naming.Separate_Suffix
+ Naming.Separate_Suffix
loop
Current_Naming := Current_Naming + 1;
end loop;
@@ -984,7 +986,7 @@ package body Prj.Env is
The_Body_Name : Name_Id;
begin
- -- ??? Same block in Project_Od
+ -- ??? Same block in Project_Of
Canonical_Case_File_Name (Original_Name);
Name_Len := Original_Name'Length;
Name_Buffer (1 .. Name_Len) := Original_Name;
@@ -994,9 +996,12 @@ package body Prj.Env is
declare
Naming : constant Lang_Naming_Data := Lang.Config.Naming_Data;
Extended_Spec_Name : String :=
- Name & Namet.Get_Name_String (Naming.Spec_Suffix);
+ Name & Namet.Get_Name_String
+ (Naming.Spec_Suffix);
Extended_Body_Name : String :=
- Name & Namet.Get_Name_String (Naming.Body_Suffix);
+ Name & Namet.Get_Name_String
+ (Naming.Body_Suffix);
+
begin
Canonical_Case_File_Name (Extended_Spec_Name);
Name_Len := Extended_Spec_Name'Length;
@@ -1435,7 +1440,7 @@ package body Prj.Env is
Original_Name : String := Name;
Lang : constant Language_Ptr :=
- Get_Language_From_Name (Main_Project, "ada");
+ Get_Language_From_Name (Main_Project, "ada");
Unit : Unit_Index;
@@ -1455,9 +1460,12 @@ package body Prj.Env is
declare
Naming : Lang_Naming_Data renames Lang.Config.Naming_Data;
Extended_Spec_Name : String :=
- Name & Namet.Get_Name_String (Naming.Spec_Suffix);
+ Name & Namet.Get_Name_String
+ (Naming.Spec_Suffix);
Extended_Body_Name : String :=
- Name & Namet.Get_Name_String (Naming.Body_Suffix);
+ Name & Namet.Get_Name_String
+ (Naming.Body_Suffix);
+
begin
Canonical_Case_File_Name (Extended_Spec_Name);
Name_Len := Extended_Spec_Name'Length;
@@ -1469,14 +1477,15 @@ package body Prj.Env is
Name_Buffer (1 .. Name_Len) := Extended_Body_Name;
The_Body_Name := Name_Find;
end;
+
else
The_Spec_Name := The_Original_Name;
The_Body_Name := The_Original_Name;
end if;
Unit := Units_Htable.Get_First (In_Tree.Units_HT);
-
while Unit /= null loop
+
-- Case of a body present
if Unit.File_Names (Impl) /= null then
diff --git a/gcc/ada/prj-env.ads b/gcc/ada/prj-env.ads
index 8104e341976..97a2d363d11 100644
--- a/gcc/ada/prj-env.ads
+++ b/gcc/ada/prj-env.ads
@@ -62,8 +62,8 @@ package Prj.Env is
-- to the Ada_Only mode.
procedure Create_Config_Pragmas_File
- (For_Project : Project_Id;
- In_Tree : Project_Tree_Ref);
+ (For_Project : Project_Id;
+ In_Tree : Project_Tree_Ref);
-- If there needs to have SFN pragmas, either for non standard naming
-- schemes or for individual units.
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index f4a1894971e..4e49b50abd9 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -93,6 +93,9 @@ package body Prj.Nmsc is
-- Hash table to store file names found in string list attribute
-- Source_Files or in a source list file, stored in hash table
-- Source_Names, used by procedure Get_Path_Names_And_Record_Sources.
+ --
+ -- ??? Should not be a global table, as it is needed only when processing
+ -- a project
-- More documentation needed on what unit exceptions are about ???
@@ -280,11 +283,10 @@ package body Prj.Nmsc is
Bodies : out Array_Element_Id;
Specs : out Array_Element_Id);
-- Check the naming scheme part of Data, and initialize the naming scheme
- -- data in the config of the various languages.
- -- Is_Config_File should be True if Project is a config file (.cgpr)
- -- This also returns the naming scheme exceptions for unit-based
- -- languages (Bodies and Specs are associative arrays mapping individual
- -- unit names to source file names).
+ -- data in the config of the various languages. Is_Config_File should be
+ -- True if Project is a config file (.cgpr) This also returns the naming
+ -- scheme exceptions for unit-based languages (Bodies and Specs are
+ -- associative arrays mapping individual unit names to source file names).
procedure Check_Configuration
(Project : Project_Id;
@@ -476,11 +478,11 @@ package body Prj.Nmsc is
-- based languages)
procedure Compute_Unit_Name
- (File_Name : File_Name_Type;
- Naming : Lang_Naming_Data;
- Kind : out Source_Kind;
- Unit : out Name_Id;
- In_Tree : Project_Tree_Ref);
+ (File_Name : File_Name_Type;
+ Naming : Lang_Naming_Data;
+ Kind : out Source_Kind;
+ Unit : out Name_Id;
+ In_Tree : Project_Tree_Ref);
-- Check whether the file matches the naming scheme. If it does,
-- compute its unit name. If Unit is set to No_Name on exit, none of the
-- other out parameters are relevant.
@@ -569,7 +571,10 @@ package body Prj.Nmsc is
procedure Remove_Source
(Id : Source_Id;
Replaced_By : Source_Id);
- -- ??? needs comment
+ -- Remove a file from the list of sources of a project.
+ -- This might be because the file is replaced by another one in an
+ -- extending project, or because a file was added as a naming exception
+ -- but was not found in the end.
procedure Report_No_Sources
(Project : Project_Id;
@@ -2398,8 +2403,7 @@ package body Prj.Nmsc is
Lang_Index := Project.Languages;
while Lang_Index /= No_Language_Index loop
-- For all languages, Compiler_Driver needs to be specified. This is
- -- only necessary if we do intend to compile (not in GPS for
- -- instance)
+ -- only needed if we do intend to compile (not in GPS for instance).
if Compiler_Driver_Mandatory
and then Lang_Index.Config.Compiler_Driver = No_File
@@ -2409,7 +2413,7 @@ package body Prj.Nmsc is
(Project,
In_Tree,
"?no compiler specified for language %%" &
- ", ignoring all its sources",
+ ", ignoring all its sources",
No_Location);
if Lang_Index = Project.Languages then
@@ -3124,13 +3128,15 @@ package body Prj.Nmsc is
Sep_Suffix_Loc : Source_Ptr;
begin
+ -- If no language, then nothing to do
+
if Ada = null then
- -- No language, thus nothing to do
return;
end if;
declare
Data : Lang_Naming_Data renames Ada.Config.Naming_Data;
+
begin
-- The default value of separate suffix should be the same as the
-- body suffix, so we need to compute that first.
@@ -3192,9 +3198,9 @@ package body Prj.Nmsc is
if Data.Spec_Suffix = Data.Body_Suffix then
Error_Msg
(Project, In_Tree,
- "Body_Suffix (""" &
- Get_Name_String (Data.Body_Suffix) &
- """) cannot be the same as Spec_Suffix.",
+ "Body_Suffix ("""
+ & Get_Name_String (Data.Body_Suffix)
+ & """) cannot be the same as Spec_Suffix.",
Ada_Body_Suffix_Loc);
end if;
@@ -3203,9 +3209,9 @@ package body Prj.Nmsc is
then
Error_Msg
(Project, In_Tree,
- "Separate_Suffix (""" &
- Get_Name_String (Data.Separate_Suffix) &
- """) cannot be the same as Spec_Suffix.",
+ "Separate_Suffix ("""
+ & Get_Name_String (Data.Separate_Suffix)
+ & """) cannot be the same as Spec_Suffix.",
Sep_Suffix_Loc);
end if;
end;
@@ -3233,8 +3239,8 @@ package body Prj.Nmsc is
Separate_Suffix => Separate_Suffix,
Sep_Suffix_Loc => Sep_Suffix_Loc);
- -- For all unit based languages, if any, set the specified
- -- value of Dot_Replacement, Casing and/or Separate_Suffix. Do not
+ -- For all unit based languages, if any, set the specified value
+ -- of Dot_Replacement, Casing and/or Separate_Suffix. Do not
-- systematically overwrite, since the defaults come from the
-- configuration file
@@ -4197,6 +4203,8 @@ package body Prj.Nmsc is
end if;
end Add_Language;
+ -- Start of processing for Check_Programming_Languages
+
begin
Project.Languages := null;
Languages :=
@@ -4230,6 +4238,7 @@ package body Prj.Nmsc is
"no languages defined for this project",
Project.Location);
Def_Lang_Id := No_Name;
+
else
Def_Lang_Id := Name_Ada;
end if;
@@ -4251,8 +4260,8 @@ package body Prj.Nmsc is
else
declare
- Current : String_List_Id := Languages.Values;
- Element : String_Element;
+ Current : String_List_Id := Languages.Values;
+ Element : String_Element;
begin
-- If there are no languages declared, there are no sources
@@ -4299,6 +4308,7 @@ package body Prj.Nmsc is
Extending : Boolean) return Boolean
is
Prj : Project_Id;
+
begin
if P = Root_Project then
return True;
@@ -6026,11 +6036,11 @@ package body Prj.Nmsc is
-----------------------
procedure Compute_Unit_Name
- (File_Name : File_Name_Type;
- Naming : Lang_Naming_Data;
- Kind : out Source_Kind;
- Unit : out Name_Id;
- In_Tree : Project_Tree_Ref)
+ (File_Name : File_Name_Type;
+ Naming : Lang_Naming_Data;
+ Kind : out Source_Kind;
+ Unit : out Name_Id;
+ In_Tree : Project_Tree_Ref)
is
Filename : constant String := Get_Name_String (File_Name);
Last : Integer := Filename'Last;
@@ -6048,6 +6058,7 @@ package body Prj.Nmsc is
Unit_Except : Unit_Exception;
Masked : Boolean := False;
+
begin
Unit := No_Name;
Kind := Spec;
@@ -6056,6 +6067,7 @@ package body Prj.Nmsc is
if Current_Verbosity = High then
Write_Line (" No dot_replacement specified");
end if;
+
return;
end if;
@@ -6087,6 +6099,7 @@ package body Prj.Nmsc is
if Current_Verbosity = High then
Write_Line (" No matching suffix");
end if;
+
return;
end if;
@@ -6102,6 +6115,7 @@ package body Prj.Nmsc is
if Current_Verbosity = High then
Write_Line (" Invalid casing");
end if;
+
return;
end if;
end loop;
@@ -6114,6 +6128,7 @@ package body Prj.Nmsc is
if Current_Verbosity = High then
Write_Line (" Invalid casing");
end if;
+
return;
end if;
end loop;
@@ -6128,7 +6143,7 @@ package body Prj.Nmsc is
declare
Dot_Repl : constant String :=
- Get_Name_String (Naming.Dot_Replacement);
+ Get_Name_String (Naming.Dot_Replacement);
begin
if Dot_Repl /= "." then
@@ -6137,12 +6152,14 @@ package body Prj.Nmsc is
if Current_Verbosity = High then
Write_Line (" Invalid name, contains dot");
end if;
+
return;
end if;
end loop;
Replace_Into_Name_Buffer
(Filename (Filename'First .. Last), Dot_Repl, '.');
+
else
Name_Len := Last - Filename'First + 1;
Name_Buffer (1 .. Name_Len) := Filename (Filename'First .. Last);
@@ -6162,7 +6179,7 @@ package body Prj.Nmsc is
S3 : constant Character := Name_Buffer (3);
begin
- if S1 = 'a'
+ if S1 = 'a'
or else S1 = 'g'
or else S1 = 'i'
or else S1 = 's'
@@ -7288,7 +7305,6 @@ package body Prj.Nmsc is
else
if Name_Loc.Found then
-
-- Check if it is OK to have the same file name in several
-- source directories.
@@ -7309,6 +7325,12 @@ package body Prj.Nmsc is
Check_Name := True;
else
+ -- ??? Issue: there could be several entries for the same
+ -- source file in the list of sources, in case the file
+ -- contains multiple units. We should share the data as much
+ -- as possible, and more importantly set the path for all
+ -- instances.
+
Name_Loc.Source.Path := (Canonical_Path, Path);
Source_Paths_Htable.Set
diff --git a/gcc/ada/s-interr-hwint.adb b/gcc/ada/s-interr-hwint.adb
index 8fbac2e78d7..038db362f23 100644
--- a/gcc/ada/s-interr-hwint.adb
+++ b/gcc/ada/s-interr-hwint.adb
@@ -1078,7 +1078,7 @@ package body System.Interrupts is
POP.Write_Lock (Self_Id);
- -- Unassociate the interrupt handler.
+ -- Unassociate the interrupt handler
Semaphore_ID_Map (Interrupt) := 0;
diff --git a/gcc/ada/s-osinte-vms.adb b/gcc/ada/s-osinte-vms.adb
index 411bac3a771..a1d04975ea8 100644
--- a/gcc/ada/s-osinte-vms.adb
+++ b/gcc/ada/s-osinte-vms.adb
@@ -7,7 +7,7 @@
-- B o d y --
-- --
-- Copyright (C) 1991-1994, Florida State University --
--- Copyright (C) 1995-2006, AdaCore --
+-- Copyright (C) 1995-2009, AdaCore --
-- --
-- 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- --
@@ -32,7 +32,7 @@
-- --
------------------------------------------------------------------------------
--- This is a OpenVMS/Alpha version of this package.
+-- This is a OpenVMS/Alpha version of this package
-- This package encapsulates all direct interfaces to OS services
-- that are needed by children of System.
diff --git a/gcc/ada/s-secsta.ads b/gcc/ada/s-secsta.ads
index bfbab33e37f..7e6d11d51fb 100644
--- a/gcc/ada/s-secsta.ads
+++ b/gcc/ada/s-secsta.ads
@@ -83,6 +83,7 @@ package System.Secondary_Stack is
procedure SS_Release (M : Mark_Id);
-- Restore the state of the stack corresponding to the mark M. If an
-- additional chunk have been allocated, it will never be freed during a
+ -- ??? missing comment here
function SS_Get_Max return Long_Long_Integer;
-- Return maximum used space in storage units for the current secondary
diff --git a/gcc/ada/s-stchop-vxworks.adb b/gcc/ada/s-stchop-vxworks.adb
index 9d1231f5f7b..9552d570fc0 100644
--- a/gcc/ada/s-stchop-vxworks.adb
+++ b/gcc/ada/s-stchop-vxworks.adb
@@ -85,10 +85,12 @@ package body System.Stack_Checking.Operations is
procedure Initialize_Stack_Limit is
begin
- -- For the environment task.
+ -- For the environment task
+
Set_Stack_Limit_For_Current_Task;
- -- Will be called by every created task.
+ -- Will be called by every created task
+
Set_Stack_Limit_Hook := Set_Stack_Limit_For_Current_Task'Access;
end Initialize_Stack_Limit;
@@ -99,10 +101,10 @@ package body System.Stack_Checking.Operations is
procedure Set_Stack_Limit_For_Current_Task is
use Interfaces.C;
- -- Import from VxWorks.
function Task_Var_Add (Tid : Interfaces.C.int; Var : Address)
return Interfaces.C.int;
pragma Import (C, Task_Var_Add, "taskVarAdd");
+ -- Import from VxWorks
type OS_Stack_Info is record
Size : Interfaces.C.int;
@@ -120,9 +122,11 @@ package body System.Stack_Checking.Operations is
Stack_Info : aliased OS_Stack_Info;
- Limit : System.Address;
+ Limit : System.Address;
+
begin
- -- Get stack bounds from VxWorks.
+ -- Get stack bounds from VxWorks
+
Get_Stack_Info (Stack_Info'Access);
if Stack_Grows_Down then
@@ -131,7 +135,8 @@ package body System.Stack_Checking.Operations is
Limit := Stack_Info.Base + Storage_Offset (Stack_Info.Size);
end if;
- -- Note: taskVarAdd implicitly calls taskVarInit if required.
+ -- Note: taskVarAdd implicitly calls taskVarInit if required
+
if Task_Var_Add (0, Stack_Limit'Address) = 0 then
Stack_Limit := Limit;
end if;
diff --git a/gcc/ada/s-stusta.ads b/gcc/ada/s-stusta.ads
index cc121d5fcf6..67952b103c6 100644
--- a/gcc/ada/s-stusta.ads
+++ b/gcc/ada/s-stusta.ads
@@ -1,8 +1,8 @@
------------------------------------------------------------------------------
-- --
--- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
+-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
--- S Y S T E M . S T A C K _ U S A G E . T AS K I N G --
+-- S Y S T E M . S T A C K _ U S A G E . T A S K I N G --
-- --
-- S p e c --
-- --
@@ -60,7 +60,7 @@ package System.Stack_Usage.Tasking is
"__gnat_tasks_stack_usage_report_current_task");
subtype Stack_Usage_Result is System.Stack_Usage.Task_Result;
- -- This type is a descriptor for task stack usage result.
+ -- This type is a descriptor for task stack usage result
type Stack_Usage_Result_Array is
array (Positive range <>) of Stack_Usage_Result;
diff --git a/gcc/ada/s-taprop-solaris.adb b/gcc/ada/s-taprop-solaris.adb
index a5b8dfbba5b..cf2a09e2a24 100644
--- a/gcc/ada/s-taprop-solaris.adb
+++ b/gcc/ada/s-taprop-solaris.adb
@@ -1136,7 +1136,7 @@ package body System.Task_Primitives.Operations is
-- System.Real_Time.Time_Span in the same way, i.e., as a 64-bit count of
-- nanoseconds.
- -- This allows us to always pass the timeout value as a Duration.
+ -- This allows us to always pass the timeout value as a Duration
-- ???
-- We are taking liberties here with the semantics of the delays. That is,
diff --git a/gcc/ada/s-taskin.ads b/gcc/ada/s-taskin.ads
index 5012abec555..0cc43f38680 100644
--- a/gcc/ada/s-taskin.ads
+++ b/gcc/ada/s-taskin.ads
@@ -200,7 +200,7 @@ package System.Tasking is
-- completion event/signal to occur.
Activating,
- -- Task has been created and is being made Runnable.
+ -- Task has been created and is being made Runnable
Acceptor_Delay_Sleep
-- Task is waiting on an selective wait statement
diff --git a/gcc/ada/s-tpopsp-posix-foreign.adb b/gcc/ada/s-tpopsp-posix-foreign.adb
index 910152ad7f1..c987f6e27f3 100644
--- a/gcc/ada/s-tpopsp-posix-foreign.adb
+++ b/gcc/ada/s-tpopsp-posix-foreign.adb
@@ -94,7 +94,7 @@ package body Specific is
begin
Result := pthread_getspecific (ATCB_Key);
- -- If the key value is Null, then it is a non-Ada task.
+ -- If the key value is Null then it is a non-Ada task
if Result /= System.Null_Address then
return To_Task_Id (Result);
diff --git a/gcc/ada/s-tpopsp-posix.adb b/gcc/ada/s-tpopsp-posix.adb
index dba33ced7b2..e7273a586fc 100644
--- a/gcc/ada/s-tpopsp-posix.adb
+++ b/gcc/ada/s-tpopsp-posix.adb
@@ -29,7 +29,7 @@
-- --
------------------------------------------------------------------------------
--- This is a POSIX-like version of this package.
+-- This is a POSIX-like version of this package
separate (System.Task_Primitives.Operations)
package body Specific is
diff --git a/gcc/ada/s-trafor-default.adb b/gcc/ada/s-trafor-default.adb
index 326f487cf9d..85a66177d8d 100644
--- a/gcc/ada/s-trafor-default.adb
+++ b/gcc/ada/s-trafor-default.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2009 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2009, 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- --
@@ -66,25 +66,25 @@ package body System.Traces.Format is
function Append
(Source : String_Trace;
- Annex : String)
- return String_Trace
+ Annex : String) return String_Trace
is
Result : String_Trace := (others => ' ');
- Source_Length : Integer := 1;
Annex_Length : Integer := Annex'Length;
+ Source_Length : Integer;
begin
if Parameters.Runtime_Traces then
- -- First we determine the size used, without the spaces at the
- -- end, if a String_Trace is present. Look at
- -- System.Traces.Tasking for examples.
+ -- First we determine the size used, without the spaces at the end,
+ -- if a String_Trace is present. Look at System.Traces.Tasking for
+ -- examples.
+ Source_Length := 1;
while Source (Source_Length) /= ASCII.NUL loop
Source_Length := Source_Length + 1;
end loop;
- -- Then we fill the string.
+ -- Then we fill the string
if Source_Length - 1 + Annex_Length <= Max_Size then
Result (1 .. Source_Length - 1) :=
@@ -97,6 +97,7 @@ package body System.Traces.Format is
Result (Source_Length + Annex_Length + 1 .. Max_Size) :=
(others => ' ');
+
else
Result (1 .. Source_Length - 1) := Source (1 .. Source_Length - 1);
Result (Source_Length .. Max_Size - 1) :=
diff --git a/gcc/ada/scans.ads b/gcc/ada/scans.ads
index 6f9bcb8c727..4fe0700a4e4 100644
--- a/gcc/ada/scans.ads
+++ b/gcc/ada/scans.ads
@@ -363,7 +363,7 @@ package Scans is
-- Pointer to first character of current token
Current_Line_Start : Source_Ptr := No_Location; -- init for -gnatVa
- -- Pointer to first character of line containing current token.
+ -- Pointer to first character of line containing current token
Start_Column : Column_Number := No_Column_Number; -- init for -gnatVa
-- Starting column number (zero origin) of the first non-blank character
@@ -444,6 +444,11 @@ package Scans is
-- Is it really right for this to be a Name rather than a String, what
-- about the case of Wide_Wide_Characters???
+ Inside_Conditional_Expression : Nat := 0;
+ -- This is a counter that is set non-zero while scanning out a conditional
+ -- expression (incremented on entry, decremented on exit). It is used to
+ -- disconnect format checks that normally apply to keywords THEN, ELSE etc.
+
--------------------------------------------------------
-- Procedures for Saving and Restoring the Scan State --
--------------------------------------------------------