diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-17 09:35:50 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-17 09:35:50 +0000 |
commit | 8aa885d03314fbb19d35723fb007a78d5d54cf8e (patch) | |
tree | f6706d5d774f7bc84126c8a56a3a088725140fd7 /gcc | |
parent | 70efb34b297972a148f245759052323aa1e5b52c (diff) | |
download | gcc-8aa885d03314fbb19d35723fb007a78d5d54cf8e.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150826 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/ada/prj-env.adb | 25 | ||||
-rw-r--r-- | gcc/ada/sem_ch3.adb | 23 | ||||
-rw-r--r-- | gcc/ada/sysdep.c | 13 |
4 files changed, 48 insertions, 24 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 10e15169911..ebbd96d6cc2 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +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 diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb index 16680521054..c14cbd63d20 100644 --- a/gcc/ada/prj-env.adb +++ b/gcc/ada/prj-env.adb @@ -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; diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 8b24cd6d071..c514206c00d 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -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); diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index ffda3abaeec..6019fd9cf91 100644 --- a/gcc/ada/sysdep.c +++ b/gcc/ada/sysdep.c @@ -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) (); |