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>
* einfo.ads, einfo.adb (Is_Actual_Subtype): New flag, defined
......
......@@ -56,7 +56,7 @@ package body GNAT.Command_Line is
(Variable : out Parameter_Type;
Arg_Num : Positive;
First : Positive;
Last : Positive;
Last : Natural;
Extra : Character := ASCII.NUL);
pragma Inline (Set_Parameter);
-- Set the parameter that will be returned by Parameter below
......@@ -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 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
-- isn't the parameter to a previous switch, since that has
......@@ -705,7 +705,7 @@ package body GNAT.Command_Line is
(if Concatenate then Parser.Current_Index else Arg'Last);
end if;
if Switches (Switches'First) = '*' then
if Switches /= "" and then Switches (Switches'First) = '*' then
-- Always prepend the switch character, so that users know
-- that this comes from a switch on the command line. This
......@@ -1061,7 +1061,9 @@ package body GNAT.Command_Line is
Section_Num := Section_Num + 1;
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
Argument (Parser, Index) = Parser.Switch_Character &
Section_Delimiters
......@@ -1127,7 +1129,7 @@ package body GNAT.Command_Line is
(Variable : out Parameter_Type;
Arg_Num : Positive;
First : Positive;
Last : Positive;
Last : Natural;
Extra : Character := ASCII.NUL)
is
begin
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -1030,7 +1030,7 @@ private
type Parameter_Type is record
Arg_Num : Positive;
First : Positive;
Last : Positive;
Last : Natural;
Extra : Character;
end record;
......
......@@ -1037,8 +1037,8 @@ package body Sem_Ch8 is
and then not Is_Access_Constant (Etype (Nam))
then
Error_Msg_N
("(Ada 2005): the renamed object is not access-to-constant "
& "(RM 8.5.1(6))", N);
("(Ada 2005): the renamed object is not access-to-constant "
& "(RM 8.5.1(6))", N);
elsif not Constant_Present (Access_Definition (N))
and then Is_Access_Constant (Etype (Nam))
......
......@@ -5061,7 +5061,7 @@ package body Sem_Prag is
end if;
-- 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
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