Commit 88eb6e62 by Arnaud Charlet

[multiple changes]

2009-08-17  Robert Dewar  <dewar@adacore.com>

	* prj-env.adb: Minor reformatting
	* sem_ch3.adb: Minor reformatting

2009-08-17  Hristian Kirtchev  <kirtchev@adacore.com>

	* sysdep.c (__gnat_localtime_tzoff): VxWorks case - Flip the sign of
	the time zone since VxWorks chose positive values to represent west
	time zones and negative for east zones.

From-SVN: r150826
parent 23532a92
2009-08-17 Robert Dewar <dewar@adacore.com>
* prj-env.adb: Minor reformatting
* sem_ch3.adb: Minor reformatting
2009-08-17 Hristian Kirtchev <kirtchev@adacore.com>
* sysdep.c (__gnat_localtime_tzoff): VxWorks case - Flip the sign of
the time zone since VxWorks chose positive values to represent west
time zones and negative for east zones.
2009-08-17 Ed Schonberg <schonberg@adacore.com> 2009-08-17 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Access_Definition): Do not create an Itype reference for * sem_ch3.adb (Access_Definition): Do not create an Itype reference for
......
...@@ -222,17 +222,20 @@ package body Prj.Env is ...@@ -222,17 +222,20 @@ package body Prj.Env is
-- Add_To_Buffer -- -- Add_To_Buffer --
------------------- -------------------
-- Wouldn't it be more consistent to use a Table for Buffer ???
procedure Add_To_Buffer procedure Add_To_Buffer
(S : String; (S : String;
Buffer : in out String_Access; Buffer : in out String_Access;
Buffer_Last : in out Natural) Buffer_Last : in out Natural)
is is
Last : constant Natural := Buffer_Last + S'Length; Last : constant Natural := Buffer_Last + S'Length;
begin begin
while Last > Buffer'Last loop while Last > Buffer'Last loop
declare declare
New_Buffer : constant String_Access := New_Buffer : constant String_Access :=
new String (1 .. 2 * Buffer'Last); new String (1 .. 2 * Buffer'Last);
begin begin
New_Buffer (1 .. Buffer_Last) := Buffer (1 .. Buffer_Last); New_Buffer (1 .. Buffer_Last) := Buffer (1 .. Buffer_Last);
...@@ -446,7 +449,7 @@ package body Prj.Env is ...@@ -446,7 +449,7 @@ package body Prj.Env is
Namings : Naming_Table.Instance; Namings : Naming_Table.Instance;
-- Table storing the naming data for gnatmake/gprmake -- Table storing the naming data for gnatmake/gprmake
Buffer : String_Access := new String (1 .. Buffer_Initial); Buffer : String_Access := new String (1 .. Buffer_Initial);
Buffer_Last : Natural := 0; Buffer_Last : Natural := 0;
File_Name : Path_Name_Type := No_Path; File_Name : Path_Name_Type := No_Path;
...@@ -471,7 +474,7 @@ package body Prj.Env is ...@@ -471,7 +474,7 @@ package body Prj.Env is
-- file with procedure Write_Temp_File below. -- file with procedure Write_Temp_File below.
procedure Write_Temp_File; procedure Write_Temp_File;
-- Create a temporary file and put the content of the buffer in it. -- Create a temporary file and put the content of the buffer in it
----------- -----------
-- Check -- -- Check --
...@@ -630,6 +633,7 @@ package body Prj.Env is ...@@ -630,6 +633,7 @@ package body Prj.Env is
procedure Write_Temp_File is procedure Write_Temp_File is
Status : Boolean := False; Status : Boolean := False;
Last : Natural; Last : Natural;
begin begin
Tempdir.Create_Temp_File (File, File_Name); Tempdir.Create_Temp_File (File, File_Name);
...@@ -646,15 +650,15 @@ package body Prj.Env is ...@@ -646,15 +650,15 @@ package body Prj.Env is
end if; end if;
end Write_Temp_File; end Write_Temp_File;
procedure Check_Imported_Projects is new For_Every_Project_Imported procedure Check_Imported_Projects is
(Integer, Check); new For_Every_Project_Imported (Integer, Check);
Dummy : Integer := 0; Dummy : Integer := 0;
-- Start of processing for Create_Config_Pragmas_File -- Start of processing for Create_Config_Pragmas_File
begin begin
if not For_Project.Config_Checked then if not For_Project.Config_Checked then
Naming_Table.Init (Namings); Naming_Table.Init (Namings);
-- Check the naming schemes -- Check the naming schemes
...@@ -866,7 +870,7 @@ package body Prj.Env is ...@@ -866,7 +870,7 @@ package body Prj.Env is
For_Every_Imported_Project (Project, Dummy); For_Every_Imported_Project (Project, Dummy);
declare declare
Last : Natural; Last : Natural;
Status : Boolean := False; Status : Boolean := False;
begin begin
...@@ -1524,9 +1528,8 @@ package body Prj.Env is ...@@ -1524,9 +1528,8 @@ package body Prj.Env is
Status : Boolean; Status : Boolean;
-- For calls to Close -- For calls to Close
Last : Natural; Last : Natural;
Buffer : String_Access := new String (1 .. Buffer_Initial);
Buffer : String_Access := new String (1 .. Buffer_Initial);
Buffer_Last : Natural := 0; Buffer_Last : Natural := 0;
procedure Recursive_Add (Project : Project_Id; Dummy : in out Boolean); procedure Recursive_Add (Project : Project_Id; Dummy : in out Boolean);
...@@ -1569,6 +1572,7 @@ package body Prj.Env is ...@@ -1569,6 +1572,7 @@ package body Prj.Env is
procedure For_All_Projects is procedure For_All_Projects is
new For_Every_Project_Imported (Boolean, Recursive_Add); new For_Every_Project_Imported (Boolean, Recursive_Add);
Dummy : Boolean := False; Dummy : Boolean := False;
-- Start of processing for Set_Ada_Paths -- Start of processing for Set_Ada_Paths
...@@ -1657,7 +1661,6 @@ package body Prj.Env is ...@@ -1657,7 +1661,6 @@ package body Prj.Env is
if Last = Buffer_Last then if Last = Buffer_Last then
Close (Object_FD, Status); Close (Object_FD, Status);
else else
Status := False; Status := False;
end if; end if;
......
...@@ -932,13 +932,14 @@ package body Sem_Ch3 is ...@@ -932,13 +932,14 @@ package body Sem_Ch3 is
Build_Itype_Reference (Anon_Type, Parent (Parent (Related_Nod))); Build_Itype_Reference (Anon_Type, Parent (Parent (Related_Nod)));
-- Similarly, if the access definition is the return result of a -- Similarly, if the access definition is the return result of a
-- function, create an itype reference for it because it -- function, create an itype reference for it because it will be used
-- will be used within the function body. For a regular function that -- within the function body. For a regular function that is not a
-- is not a compilation unit, insert reference after the declaration. -- compilation unit, insert reference after the declaration. For a
-- For a protected operation, insert it after the enclosing protected -- protected operation, insert it after the enclosing protected type
-- type declaration. In either case, do not create a reference for a -- declaration. In either case, do not create a reference for a type
-- type obtained through a limited_with clause, because this would -- obtained through a limited_with clause, because this would introduce
-- introduce semantic dependencies. -- semantic dependencies.
-- Similarly, do not create a reference if the designated type is a -- Similarly, do not create a reference if the designated type is a
-- generic formal, because no use of it will reach the backend. -- generic formal, because no use of it will reach the backend.
...@@ -955,10 +956,10 @@ package body Sem_Ch3 is ...@@ -955,10 +956,10 @@ package body Sem_Ch3 is
Build_Itype_Reference (Anon_Type, Parent (Related_Nod)); Build_Itype_Reference (Anon_Type, Parent (Related_Nod));
end if; end if;
-- Finally, create an itype reference for an object declaration of -- Finally, create an itype reference for an object declaration of an
-- an anonymous access type. This is strictly necessary only for -- anonymous access type. This is strictly necessary only for deferred
-- deferred constants, but in any case will avoid out-of-scope -- constants, but in any case will avoid out-of-scope problems in the
-- problems in the back-end. -- back-end.
elsif Nkind (Related_Nod) = N_Object_Declaration then elsif Nkind (Related_Nod) = N_Object_Declaration then
Build_Itype_Reference (Anon_Type, Related_Nod); Build_Itype_Reference (Anon_Type, Related_Nod);
......
...@@ -868,6 +868,8 @@ __gnat_localtime_tzoff (const time_t *timer, long *off) ...@@ -868,6 +868,8 @@ __gnat_localtime_tzoff (const time_t *timer, long *off)
(*Unlock_Task) (); (*Unlock_Task) ();
/* Correct the offset if Daylight Saving Time is in effect */
if (tp.tm_isdst > 0) if (tp.tm_isdst > 0)
*off = *off + 3600; *off = *off + 3600;
} }
...@@ -902,9 +904,16 @@ __gnat_localtime_tzoff (const time_t *timer, long *off) ...@@ -902,9 +904,16 @@ __gnat_localtime_tzoff (const time_t *timer, long *off)
tz_end = index (tz_start, ':'); tz_end = index (tz_start, ':');
tz_end = '\0'; tz_end = '\0';
/* The Ada layer expects an offset in seconds */ /* The Ada layer expects an offset in seconds. Note that we must reverse
the sign of the result since west is positive and east is negative on
VxWorks targets. */
*off = -atol (tz_start) * 60;
/* Correct the offset if Daylight Saving Time is in effect */
*off = atol (tz_start) * 60; if (tp.tm_isdst > 0)
*off = *off - 3600;
} }
(*Unlock_Task) (); (*Unlock_Task) ();
......
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