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>
* sem_ch3.adb (Access_Definition): Do not create an Itype reference for
......
......@@ -222,17 +222,20 @@ package body Prj.Env is
-- Add_To_Buffer --
-------------------
-- Wouldn't it be more consistent to use a Table for Buffer ???
procedure Add_To_Buffer
(S : String;
Buffer : in out String_Access;
Buffer_Last : in out Natural)
is
Last : constant Natural := Buffer_Last + S'Length;
begin
while Last > Buffer'Last loop
declare
New_Buffer : constant String_Access :=
new String (1 .. 2 * Buffer'Last);
new String (1 .. 2 * Buffer'Last);
begin
New_Buffer (1 .. Buffer_Last) := Buffer (1 .. Buffer_Last);
......@@ -446,7 +449,7 @@ package body Prj.Env is
Namings : Naming_Table.Instance;
-- 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;
File_Name : Path_Name_Type := No_Path;
......@@ -471,7 +474,7 @@ package body Prj.Env is
-- file with procedure Write_Temp_File below.
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 --
......@@ -630,6 +633,7 @@ package body Prj.Env is
procedure Write_Temp_File is
Status : Boolean := False;
Last : Natural;
begin
Tempdir.Create_Temp_File (File, File_Name);
......@@ -646,15 +650,15 @@ package body Prj.Env is
end if;
end Write_Temp_File;
procedure Check_Imported_Projects is new For_Every_Project_Imported
(Integer, Check);
procedure Check_Imported_Projects is
new For_Every_Project_Imported (Integer, Check);
Dummy : Integer := 0;
-- Start of processing for Create_Config_Pragmas_File
begin
if not For_Project.Config_Checked then
Naming_Table.Init (Namings);
-- Check the naming schemes
......@@ -866,7 +870,7 @@ package body Prj.Env is
For_Every_Imported_Project (Project, Dummy);
declare
Last : Natural;
Last : Natural;
Status : Boolean := False;
begin
......@@ -1524,9 +1528,8 @@ package body Prj.Env is
Status : Boolean;
-- For calls to Close
Last : Natural;
Buffer : String_Access := new String (1 .. Buffer_Initial);
Last : Natural;
Buffer : String_Access := new String (1 .. Buffer_Initial);
Buffer_Last : Natural := 0;
procedure Recursive_Add (Project : Project_Id; Dummy : in out Boolean);
......@@ -1569,6 +1572,7 @@ package body Prj.Env is
procedure For_All_Projects is
new For_Every_Project_Imported (Boolean, Recursive_Add);
Dummy : Boolean := False;
-- Start of processing for Set_Ada_Paths
......@@ -1657,7 +1661,6 @@ package body Prj.Env is
if Last = Buffer_Last then
Close (Object_FD, Status);
else
Status := False;
end if;
......
......@@ -932,13 +932,14 @@ package body Sem_Ch3 is
Build_Itype_Reference (Anon_Type, Parent (Parent (Related_Nod)));
-- Similarly, if the access definition is the return result of a
-- function, create an itype reference for it because it
-- will be used within the function body. For a regular function that
-- is not a compilation unit, insert reference after the declaration.
-- For a protected operation, insert it after the enclosing protected
-- type declaration. In either case, do not create a reference for a
-- type obtained through a limited_with clause, because this would
-- introduce semantic dependencies.
-- function, create an itype reference for it because it will be used
-- within the function body. For a regular function that is not a
-- compilation unit, insert reference after the declaration. For a
-- protected operation, insert it after the enclosing protected type
-- declaration. In either case, do not create a reference for a type
-- obtained through a limited_with clause, because this would introduce
-- semantic dependencies.
-- Similarly, do not create a reference if the designated type is a
-- generic formal, because no use of it will reach the backend.
......@@ -955,10 +956,10 @@ package body Sem_Ch3 is
Build_Itype_Reference (Anon_Type, Parent (Related_Nod));
end if;
-- Finally, create an itype reference for an object declaration of
-- an anonymous access type. This is strictly necessary only for
-- deferred constants, but in any case will avoid out-of-scope
-- problems in the back-end.
-- Finally, create an itype reference for an object declaration of an
-- anonymous access type. This is strictly necessary only for deferred
-- constants, but in any case will avoid out-of-scope problems in the
-- back-end.
elsif Nkind (Related_Nod) = N_Object_Declaration then
Build_Itype_Reference (Anon_Type, Related_Nod);
......
......@@ -868,6 +868,8 @@ __gnat_localtime_tzoff (const time_t *timer, long *off)
(*Unlock_Task) ();
/* Correct the offset if Daylight Saving Time is in effect */
if (tp.tm_isdst > 0)
*off = *off + 3600;
}
......@@ -902,9 +904,16 @@ __gnat_localtime_tzoff (const time_t *timer, long *off)
tz_end = index (tz_start, ':');
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) ();
......
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