Commit d1aea5dd by Arnaud Charlet

[multiple changes]

2016-06-22  Bob Duff  <duff@adacore.com>

	* g-comlin.ads (Parameter_Type): Change subtype of Last to
	Natural.
	* g-comlin.adb (Set_Parameter): Change subtype of Last to
	Natural.
	(Getopt): Check for Arg = "", and Switches /= "".
	(Internal_Initialize_Option_Scan): Check for Argument (Parser,
	Index) /= "".

2016-06-22  Gary Dismukes  <dismukes@adacore.com>

	* sem_prag.adb, sem_ch8.adb: Minor reformatting.

From-SVN: r237693
parent 405b907c
2016-06-22 Bob Duff <duff@adacore.com>
* g-comlin.ads (Parameter_Type): Change subtype of Last to
Natural.
* g-comlin.adb (Set_Parameter): Change subtype of Last to
Natural.
(Getopt): Check for Arg = "", and Switches /= "".
(Internal_Initialize_Option_Scan): Check for Argument (Parser,
Index) /= "".
2016-06-22 Gary Dismukes <dismukes@adacore.com>
* sem_prag.adb, sem_ch8.adb: Minor reformatting.
2016-06-22 Ed Schonberg <schonberg@adacore.com> 2016-06-22 Ed Schonberg <schonberg@adacore.com>
* einfo.ads, einfo.adb (Is_Actual_Subtype): New flag, defined * einfo.ads, einfo.adb (Is_Actual_Subtype): New flag, defined
......
...@@ -56,7 +56,7 @@ package body GNAT.Command_Line is ...@@ -56,7 +56,7 @@ package body GNAT.Command_Line is
(Variable : out Parameter_Type; (Variable : out Parameter_Type;
Arg_Num : Positive; Arg_Num : Positive;
First : Positive; First : Positive;
Last : Positive; Last : Natural;
Extra : Character := ASCII.NUL); Extra : Character := ASCII.NUL);
pragma Inline (Set_Parameter); pragma Inline (Set_Parameter);
-- Set the parameter that will be returned by Parameter below -- Set the parameter that will be returned by Parameter below
...@@ -621,7 +621,7 @@ package body GNAT.Command_Line is ...@@ -621,7 +621,7 @@ package body GNAT.Command_Line is
-- If we are on a new item, test if this might be a switch -- If we are on a new item, test if this might be a switch
if Parser.Current_Index = Arg'First then if Parser.Current_Index = Arg'First then
if Arg (Arg'First) /= Parser.Switch_Character then if Arg = "" or else Arg (Arg'First) /= Parser.Switch_Character then
-- If it isn't a switch, return it immediately. We also know it -- If it isn't a switch, return it immediately. We also know it
-- isn't the parameter to a previous switch, since that has -- isn't the parameter to a previous switch, since that has
...@@ -705,7 +705,7 @@ package body GNAT.Command_Line is ...@@ -705,7 +705,7 @@ package body GNAT.Command_Line is
(if Concatenate then Parser.Current_Index else Arg'Last); (if Concatenate then Parser.Current_Index else Arg'Last);
end if; end if;
if Switches (Switches'First) = '*' then if Switches /= "" and then Switches (Switches'First) = '*' then
-- Always prepend the switch character, so that users know -- Always prepend the switch character, so that users know
-- that this comes from a switch on the command line. This -- that this comes from a switch on the command line. This
...@@ -1061,7 +1061,9 @@ package body GNAT.Command_Line is ...@@ -1061,7 +1061,9 @@ package body GNAT.Command_Line is
Section_Num := Section_Num + 1; Section_Num := Section_Num + 1;
for Index in 1 .. Parser.Arg_Count loop for Index in 1 .. Parser.Arg_Count loop
if Argument (Parser, Index)(1) = Parser.Switch_Character pragma Assert (Argument (Parser, Index)'First = 1);
if Argument (Parser, Index) /= ""
and then Argument (Parser, Index)(1) = Parser.Switch_Character
and then and then
Argument (Parser, Index) = Parser.Switch_Character & Argument (Parser, Index) = Parser.Switch_Character &
Section_Delimiters Section_Delimiters
...@@ -1127,7 +1129,7 @@ package body GNAT.Command_Line is ...@@ -1127,7 +1129,7 @@ package body GNAT.Command_Line is
(Variable : out Parameter_Type; (Variable : out Parameter_Type;
Arg_Num : Positive; Arg_Num : Positive;
First : Positive; First : Positive;
Last : Positive; Last : Natural;
Extra : Character := ASCII.NUL) Extra : Character := ASCII.NUL)
is is
begin begin
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1999-2015, AdaCore -- -- Copyright (C) 1999-2016, AdaCore --
-- -- -- --
-- 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- --
...@@ -1030,7 +1030,7 @@ private ...@@ -1030,7 +1030,7 @@ private
type Parameter_Type is record type Parameter_Type is record
Arg_Num : Positive; Arg_Num : Positive;
First : Positive; First : Positive;
Last : Positive; Last : Natural;
Extra : Character; Extra : Character;
end record; end record;
......
...@@ -1037,8 +1037,8 @@ package body Sem_Ch8 is ...@@ -1037,8 +1037,8 @@ package body Sem_Ch8 is
and then not Is_Access_Constant (Etype (Nam)) and then not Is_Access_Constant (Etype (Nam))
then then
Error_Msg_N Error_Msg_N
("(Ada 2005): the renamed object is not access-to-constant " ("(Ada 2005): the renamed object is not access-to-constant "
& "(RM 8.5.1(6))", N); & "(RM 8.5.1(6))", N);
elsif not Constant_Present (Access_Definition (N)) elsif not Constant_Present (Access_Definition (N))
and then Is_Access_Constant (Etype (Nam)) and then Is_Access_Constant (Etype (Nam))
......
...@@ -5061,7 +5061,7 @@ package body Sem_Prag is ...@@ -5061,7 +5061,7 @@ package body Sem_Prag is
end if; end if;
-- An expression cannot be considered static if its resolution failed -- An expression cannot be considered static if its resolution failed
-- or if it erroneous. Stop the analysis of the related pragma. -- or if it's erroneous. Stop the analysis of the related pragma.
if Etype (Expr) = Any_Type or else Error_Posted (Expr) then if Etype (Expr) = Any_Type or else Error_Posted (Expr) then
raise Pragma_Exit; raise Pragma_Exit;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment