Commit 65a07a30 by Robert Dewar Committed by Arnaud Charlet

s-fileio.adb, [...]: Minor reformatting

2009-10-27  Robert Dewar  <dewar@adacore.com>

	* s-fileio.adb, s-fileio.ads, sem_util.adb, sem_warn.adb,
	sem_warn.ads: Minor reformatting

From-SVN: r153597
parent 3d9d6c8e
2009-10-27 Robert Dewar <dewar@adacore.com> 2009-10-27 Robert Dewar <dewar@adacore.com>
* s-fileio.adb, s-fileio.ads, sem_util.adb, sem_warn.adb,
sem_warn.ads: Minor reformatting
2009-10-27 Robert Dewar <dewar@adacore.com>
* sem_warn.adb, sem_util.adb, sem_util.ads: Minor reformatting. Add * sem_warn.adb, sem_util.adb, sem_util.ads: Minor reformatting. Add
comments. comments.
......
...@@ -523,8 +523,7 @@ package body System.File_IO is ...@@ -523,8 +523,7 @@ package body System.File_IO is
function Form_Boolean function Form_Boolean
(Form : String; (Form : String;
Keyword : String; Keyword : String;
Default : Boolean) Default : Boolean) return Boolean
return Boolean
is is
V1, V2 : Natural; V1, V2 : Natural;
pragma Unreferenced (V2); pragma Unreferenced (V2);
...@@ -553,8 +552,7 @@ package body System.File_IO is ...@@ -553,8 +552,7 @@ package body System.File_IO is
function Form_Integer function Form_Integer
(Form : String; (Form : String;
Keyword : String; Keyword : String;
Default : Integer) Default : Integer) return Integer
return Integer
is is
V1, V2 : Natural; V1, V2 : Natural;
V : Integer; V : Integer;
......
...@@ -125,8 +125,8 @@ package System.File_IO is ...@@ -125,8 +125,8 @@ package System.File_IO is
-- if used with temporary files or standard files. -- if used with temporary files or standard files.
function Form (File : FCB.AFCB_Ptr) return String; function Form (File : FCB.AFCB_Ptr) return String;
-- Returns the form as supplied by create, open or reset -- Returns the form as supplied by create, open or reset The string is
-- The string is normalized to all lower case letters. -- normalized to all lower case letters.
function Is_Open (File : FCB.AFCB_Ptr) return Boolean; function Is_Open (File : FCB.AFCB_Ptr) return Boolean;
-- Determines if file is open or not -- Determines if file is open or not
...@@ -145,25 +145,25 @@ package System.File_IO is ...@@ -145,25 +145,25 @@ package System.File_IO is
-- not opened in the normal manner. Note that the caller is responsible -- not opened in the normal manner. Note that the caller is responsible
-- for task lock out to protect the global data structures if this is -- for task lock out to protect the global data structures if this is
-- necessary (it is needed for the calls from within this unit itself, -- necessary (it is needed for the calls from within this unit itself,
-- but not required for the calls from Text_IO and Wide_Text_IO that -- but not required for the calls from Text_IO and [Wide_]Wide_Text_IO
-- are made during elaboration of the environment task). -- that are made during elaboration of the environment task).
procedure Check_File_Open (File : FCB.AFCB_Ptr); procedure Check_File_Open (File : FCB.AFCB_Ptr);
-- If the current file is not open, then Status_Error is raised. -- If the current file is not open, then Status_Error is raised. Otherwise
-- Otherwise control returns normally (with File pointing to the -- control returns normally (with File pointing to the control block for
-- control block for the open file. -- the open file.
procedure Check_Read_Status (File : FCB.AFCB_Ptr); procedure Check_Read_Status (File : FCB.AFCB_Ptr);
-- If the current file is not open, then Status_Error is raised. If -- If the current file is not open, then Status_Error is raised. If the
-- the file is open, then the mode is checked to ensure that reading -- file is open, then the mode is checked to make sure that reading is
-- is permitted, and if not Mode_Error is raised, otherwise control -- permitted, and if not Mode_Error is raised, otherwise control returns
-- returns normally. -- normally.
procedure Check_Write_Status (File : FCB.AFCB_Ptr); procedure Check_Write_Status (File : FCB.AFCB_Ptr);
-- If the current file is not open, then Status_Error is raised. If -- If the current file is not open, then Status_Error is raised. If the
-- the file is open, then the mode is checked to ensure that writing -- file is open, then the mode is checked to ensure that writing is
-- is permitted, and if not Mode_Error is raised, otherwise control -- permitted, and if not Mode_Error is raised, otherwise control returns
-- returns normally. -- normally.
function End_Of_File (File : FCB.AFCB_Ptr) return Boolean; function End_Of_File (File : FCB.AFCB_Ptr) return Boolean;
-- File must be opened in read mode. True is returned if the stream is -- File must be opened in read mode. True is returned if the stream is
...@@ -171,30 +171,28 @@ package System.File_IO is ...@@ -171,30 +171,28 @@ package System.File_IO is
-- The position of the stream is not affected. -- The position of the stream is not affected.
procedure Flush (File : FCB.AFCB_Ptr); procedure Flush (File : FCB.AFCB_Ptr);
-- Flushes the stream associated with the given file. The file must be -- Flushes the stream associated with the given file. The file must be open
-- open and in write mode (if not, an appropriate exception is raised) -- and in write mode (if not, an appropriate exception is raised)
function Form_Boolean function Form_Boolean
(Form : String; (Form : String;
Keyword : String; Keyword : String;
Default : Boolean) Default : Boolean) return Boolean;
return Boolean; -- Searches form string for an entry of the form keyword=xx where xx is
-- Searches form string for an entry of the form Keyword=xx where xx is -- either yes/no or y/n. Returns True if yes or y is found, False if no or
-- either Yes/No or y/n. Returns True if Yes or Y is found, False if No -- n is found. If the keyword parameter is not found, returns the value
-- or N is found. If the keyword parameter is not found, returns the -- given as Default. May raise Use_Error if a form string syntax error is
-- value given as Default. May raise Use_Error if a form string syntax -- detected. Keyword and Form must be in lower case.
-- error is detected. Keyword and Form must be in lower case.
function Form_Integer function Form_Integer
(Form : String; (Form : String;
Keyword : String; Keyword : String;
Default : Integer) Default : Integer) return Integer;
return Integer; -- Searches form string for an entry of the form Keyword=xx where xx is an
-- Searches form string for an entry of the form Keyword=xx where xx is -- unsigned decimal integer in the range 0 to 999_999. Returns this integer
-- an unsigned decimal integer in the range 0 to 999_999. Returns this -- value if it is found. If the keyword parameter is not found, returns the
-- integer value if it is found. If the keyword parameter is not found, -- value given as Default. Raise Use_Error if a form string syntax error is
-- returns the value given as Default. Raise Use_Error if a form string -- detected. Keyword and Form must be in lower case.
-- syntax error is detected. Keyword and Form must be in lower case.
procedure Form_Parameter procedure Form_Parameter
(Form : String; (Form : String;
...@@ -221,22 +219,22 @@ package System.File_IO is ...@@ -221,22 +219,22 @@ package System.File_IO is
Buf : Address; Buf : Address;
Siz : Interfaces.C_Streams.size_t; Siz : Interfaces.C_Streams.size_t;
Count : out Interfaces.C_Streams.size_t); Count : out Interfaces.C_Streams.size_t);
-- Reads Siz bytes from File.Stream into Buf. The caller has checked -- Reads Siz bytes from File.Stream into Buf. The caller has checked that
-- that the file is open in read mode. Device Error is raised if an error -- the file is open in read mode. Device Error is raised if an error
-- occurs. Count is the actual number of bytes read, which may be less -- occurs. Count is the actual number of bytes read, which may be less
-- than Siz if the end of file is encountered. -- than Siz if the end of file is encountered.
procedure Append_Set (File : FCB.AFCB_Ptr); procedure Append_Set (File : FCB.AFCB_Ptr);
-- If the mode of the file is Append_File, then the file is positioned -- If the mode of the file is Append_File, then the file is positioned at
-- at the end of file using fseek, otherwise this call has no effect. -- the end of file using fseek, otherwise this call has no effect.
procedure Write_Buf procedure Write_Buf
(File : FCB.AFCB_Ptr; (File : FCB.AFCB_Ptr;
Buf : Address; Buf : Address;
Siz : Interfaces.C_Streams.size_t); Siz : Interfaces.C_Streams.size_t);
-- Writes size_t bytes to File.Stream from Buf. The caller has checked -- Writes size_t bytes to File.Stream from Buf. The caller has checked that
-- that the file is open in write mode. Raises Device_Error if the -- the file is open in write mode. Raises Device_Error if the complete
-- complete buffer cannot be written. -- buffer cannot be written.
procedure Make_Unbuffered (File : FCB.AFCB_Ptr); procedure Make_Unbuffered (File : FCB.AFCB_Ptr);
......
...@@ -2146,7 +2146,7 @@ package body Sem_Util is ...@@ -2146,7 +2146,7 @@ package body Sem_Util is
-- If we have entity names, then must be same entity -- If we have entity names, then must be same entity
if Is_Entity_Name (A1) then if Is_Entity_Name (A1) then
if Is_Entity_Name (A2)then if Is_Entity_Name (A2) then
return Entity (A1) = Entity (A2); return Entity (A1) = Entity (A2);
else else
return False; return False;
...@@ -2249,8 +2249,8 @@ package body Sem_Util is ...@@ -2249,8 +2249,8 @@ package body Sem_Util is
return Denotes_Same_Prefix (A2, A1); return Denotes_Same_Prefix (A2, A1);
elsif Nkind_In (A1, N_Selected_Component, N_Indexed_Component, N_Slice) elsif Nkind_In (A1, N_Selected_Component, N_Indexed_Component, N_Slice)
and then and then
Nkind_In (A2, N_Selected_Component, N_Indexed_Component, N_Slice) Nkind_In (A2, N_Selected_Component, N_Indexed_Component, N_Slice)
then then
declare declare
Root1, Root2 : Node_Id; Root1, Root2 : Node_Id;
......
...@@ -3554,17 +3554,15 @@ package body Sem_Warn is ...@@ -3554,17 +3554,15 @@ package body Sem_Warn is
-- Exclude calls rewritten as enumeration literals -- Exclude calls rewritten as enumeration literals
if not Nkind_In if not Nkind_In (N, N_Function_Call, N_Procedure_Call_Statement) then
(N, N_Function_Call, N_Procedure_Call_Statement)
then
return; return;
end if; end if;
-- Exclude calls to library subprograms. Container operations -- Exclude calls to library subprograms. Container operations specify
-- specify safe behavior when source and target coincide. -- safe behavior when source and target coincide.
if Is_Predefined_File_Name ( if Is_Predefined_File_Name
Unit_File_Name (Get_Source_Unit (Sloc (Subp)))) (Unit_File_Name (Get_Source_Unit (Sloc (Subp))))
then then
return; return;
end if; end if;
...@@ -3596,7 +3594,8 @@ package body Sem_Warn is ...@@ -3596,7 +3594,8 @@ package body Sem_Warn is
null; null;
elsif Is_Generic_Type (Etype (Act1)) elsif Is_Generic_Type (Etype (Act1))
or else Is_Generic_Type (Etype (Act2)) or else
Is_Generic_Type (Etype (Act2))
then then
null; null;
...@@ -3634,9 +3633,8 @@ package body Sem_Warn is ...@@ -3634,9 +3633,8 @@ package body Sem_Warn is
if Is_Entity_Name (First_Actual (N)) if Is_Entity_Name (First_Actual (N))
and then Nkind (Original_Node (N)) = Nkind (N) and then Nkind (Original_Node (N)) = Nkind (N)
and then and then Nkind (Name (Original_Node (N))) =
Nkind (Name (Original_Node (N))) = N_Selected_Component
N_Selected_Component
and then and then
Is_Entity_Name (Prefix (Name (Original_Node (N)))) Is_Entity_Name (Prefix (Name (Original_Node (N))))
and then and then
...@@ -3645,7 +3643,7 @@ package body Sem_Warn is ...@@ -3645,7 +3643,7 @@ package body Sem_Warn is
then then
if Act1 = First_Actual (N) then if Act1 = First_Actual (N) then
Error_Msg_FE Error_Msg_FE
("in-out prefix overlaps with actual for&?", ("`IN OUT` prefix overlaps with actual for&?",
Act1, Form); Act1, Form);
else else
Error_Msg_FE Error_Msg_FE
......
...@@ -211,8 +211,8 @@ package Sem_Warn is ...@@ -211,8 +211,8 @@ package Sem_Warn is
-- an only OUT parameter, or if Warn_On_All_Unread_Out_Parameters is set. -- an only OUT parameter, or if Warn_On_All_Unread_Out_Parameters is set.
procedure Warn_On_Overlapping_Actuals (Subp : Entity_Id; N : Node_Id); procedure Warn_On_Overlapping_Actuals (Subp : Entity_Id; N : Node_Id);
-- Called on a subprogram call. Checks whether an in-out actual that is -- Called on a subprogram call. Checks whether an IN OUT actual that is
-- not by-copy may overlap with another actual, thus leadind to aliasing -- not by-copy may overlap with another actual, thus leading to aliasing
-- in the body of the called subprogram. -- in the body of the called subprogram.
procedure Warn_On_Suspicious_Index (Name : Entity_Id; X : Node_Id); procedure Warn_On_Suspicious_Index (Name : Entity_Id; X : Node_Id);
......
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