+2014-02-24 Robert Dewar <dewar@adacore.com>
+
+ * g-sercom-mingw.adb, g-sercom-linux.adb, sem_prag.adb, freeze.adb,
+ atree.adb, atree.ads: Minor reformatting.
+
2014-02-24 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Body_Contract): Do not enforce
-- Copy_Separate_Tree --
------------------------
- function Copy_Separate_Tree (Source : Node_Id) return Node_Id
- is
+ function Copy_Separate_Tree (Source : Node_Id) return Node_Id is
New_Id : Node_Id;
function Copy_Entity (E : Entity_Id) return Entity_Id;
New_Ent : Entity_Id;
begin
- -- Build appropriate node.
+ -- Build appropriate node
case N_Entity (Nkind (E)) is
when N_Defining_Identifier =>
Set_Entity (New_Id, Empty);
end if;
- -- Reset all Etype fields and Analyzed flags, because tree may
- -- have been partly analyzed.
+ -- Reset all Etype fields and Analyzed flags, because input tree may
+ -- have been fully or partially analyzed.
if Nkind (New_Id) in N_Has_Etype then
Set_Etype (New_Id, Empty);
-- a copied node by the parent field are also copied.) The parent pointers
-- in the copy are properly set. Copy_Separate_Tree (Empty/Error) returns
-- Empty/Error. The new subtree does not share entities with the source,
- -- but has new entities with the same name. Most of the time this routine
- -- is called on an unanalyzed tree, and no semantic information is copied.
- -- However, to ensure that no entities are shared between the two when the
- -- source is already analyzed, entity fields in the copy are zeroed out,
- -- as well as Etype fields and the Analyzed flag.
+ -- but has new entities with the same name.
+ --
+ -- Most of the time this routine is called on an unanalyzed tree, and no
+ -- semantic information is copied. However, to ensure that no entities
+ -- are shared between the two when the source is already analyzed, and
+ -- that the result looks like an unanalyzed tree from the parser, Entity
+ -- fields and Etype fields are set to Empty, and Analyzed flags set False.
+ --
-- In addition, Expanded_Name nodes are converted back into the original
- -- parser form (where they are Selected_Components), so that renalysis does
- -- the right thing.
+ -- parser form (where they are Selected_Components), so that reanalysis
+ -- does the right thing.
function Copy_Separate_List (Source : List_Id) return List_Id;
-- Applies Copy_Separate_Tree to each element of the Source list, returning
-- Note on calls to Copy_Separate_Tree. The trees we are copying
-- here are fully analyzed, but we definitely want fully syntactic
-- unanalyzed trees in the body we construct, so that the analysis
- -- generates the right visibility.
+ -- generates the right visibility, and that is exactly what the
+ -- calls to Copy_Separate_Tree give us.
-- Acquire copy of Inline pragma
-- Change settings now
- Current.c_cflag := C_Data_Rate (Rate)
- or C_Bits (Bits)
- or C_Stop_Bits (Stop_Bits)
- or C_Parity (Parity)
- or CREAD;
- Current.c_iflag := 0;
- Current.c_lflag := 0;
- Current.c_oflag := 0;
+ Current.c_cflag := C_Data_Rate (Rate)
+ or C_Bits (Bits)
+ or C_Stop_Bits (Stop_Bits)
+ or C_Parity (Parity)
+ or CREAD;
+ Current.c_iflag := 0;
+ Current.c_lflag := 0;
+ Current.c_oflag := 0;
if Local then
Current.c_cflag := Current.c_cflag or CLOCAL;
end if;
case Flow is
- when None =>
+ when None =>
null;
- when RTS_CTS =>
+ when RTS_CTS =>
Current.c_cflag := Current.c_cflag or CRTSCTS;
when Xon_Xoff =>
Current.c_iflag := Current.c_iflag or IXON;
N_Img : constant String := Positive'Image (Number);
begin
if Number > 9 then
- return Port_Name ("\\.\COM" & N_Img (N_Img'First + 1 .. N_Img'Last));
+ return
+ Port_Name ("\\.\COM" & N_Img (N_Img'First + 1 .. N_Img'Last));
else
- return Port_Name
- ("COM" & N_Img (N_Img'First + 1 .. N_Img'Last) & ':');
+ return
+ Port_Name ("COM" & N_Img (N_Img'First + 1 .. N_Img'Last) & ':');
end if;
end Name;
Com_Settings.fOutxCtsFlow := 0;
end case;
- Com_Settings.fAbortOnError := 0;
- Com_Settings.ByteSize := BYTE (C_Bits (Bits));
- Com_Settings.Parity := BYTE (C_Parity (Parity));
- Com_Settings.StopBits := BYTE (C_Stop_Bits (Stop_Bits));
+ Com_Settings.fAbortOnError := 0;
+ Com_Settings.ByteSize := BYTE (C_Bits (Bits));
+ Com_Settings.Parity := BYTE (C_Parity (Parity));
+ Com_Settings.StopBits := BYTE (C_Stop_Bits (Stop_Bits));
Success := SetCommState (HANDLE (Port.H.all), Com_Settings'Access);
Next (Assoc);
end loop;
end if;
+
+ -- Anything else is an error
+
else
Error_Msg_N ("malformed global list", List);
end if;