Commit c61b6f0f by Robert Dewar Committed by Arnaud Charlet

a-catizo.ads, [...]: Minor reformatting.

2012-01-23  Robert Dewar  <dewar@adacore.com>

	* a-catizo.ads, a-calend.adb, a-calend.ads, par-ch13.adb: Minor
	reformatting.

From-SVN: r183417
parent b57cca0b
2012-01-23 Robert Dewar <dewar@adacore.com>
* a-catizo.ads, a-calend.adb, a-calend.ads, par-ch13.adb: Minor
reformatting.
2012-01-23 Ed Schonberg <schonberg@adacore.com> 2012-01-23 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Declaration): Do not set the * sem_ch6.adb (Analyze_Subprogram_Declaration): Do not set the
......
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
with Ada.Unchecked_Conversion; with Ada.Unchecked_Conversion;
with Interfaces.C; with Interfaces.C;
with System.OS_Primitives; with System.OS_Primitives;
package body Ada.Calendar is package body Ada.Calendar is
...@@ -115,11 +117,12 @@ package body Ada.Calendar is ...@@ -115,11 +117,12 @@ package body Ada.Calendar is
-- This routine acts as an Ada wrapper around __gnat_localtime_tzoff which -- This routine acts as an Ada wrapper around __gnat_localtime_tzoff which
-- in turn utilizes various OS-dependent mechanisms to calculate the time -- in turn utilizes various OS-dependent mechanisms to calculate the time
-- zone offset of a date. Formal parameter Date represents an arbitrary -- zone offset of a date. Formal parameter Date represents an arbitrary
-- time stamp, either in the past, now, or in the future. If flag -- time stamp, either in the past, now, or in the future. If the flag
-- Is_Historic is set, this routine would try to calculate to the best of -- Is_Historic is set, this routine would try to calculate to the best of
-- the OS's abilities the time zone offset that was or will be in effect -- the OS's abilities the time zone offset that was or will be in effect
-- on Date. If the flag is set to False, the routine returns the current -- on Date. If the flag is set to False, the routine returns the current
-- time zone with Date effectively set to Clock. -- time zone with Date effectively set to Clock.
--
-- NOTE: Targets which support localtime_r will aways return a historic -- NOTE: Targets which support localtime_r will aways return a historic
-- time zone even if flag Is_Historic is set to False because this is how -- time zone even if flag Is_Historic is set to False because this is how
-- localtime_r operates. -- localtime_r operates.
...@@ -191,7 +194,7 @@ package body Ada.Calendar is ...@@ -191,7 +194,7 @@ package body Ada.Calendar is
Unix_Min : constant Time_Rep := Unix_Min : constant Time_Rep :=
Ada_Low + Time_Rep (17 * 366 + 52 * 365) * Nanos_In_Day; Ada_Low + Time_Rep (17 * 366 + 52 * 365) * Nanos_In_Day;
-- The Unix upper time bound expressed as nonoseconds since the start of -- The Unix upper time bound expressed as nanoseconds since the start of
-- Ada time in UTC. -- Ada time in UTC.
Unix_Max : constant Time_Rep := Unix_Max : constant Time_Rep :=
......
...@@ -193,6 +193,35 @@ private ...@@ -193,6 +193,35 @@ private
-- of year - 4 to year + 4. Internally, routines Split and Time_Of add or -- of year - 4 to year + 4. Internally, routines Split and Time_Of add or
-- subtract a "fake" February 29 to facilitate the arithmetic involved. -- subtract a "fake" February 29 to facilitate the arithmetic involved.
------------------------------------
-- Time zones and UTC_Time_Offset --
------------------------------------
-- The implementation-defined time zone of Ada.Calendar routines is the
-- local time zone. The term "local time zone" can be interpreted in two
-- different ways - either the offset from UTC of the "now" or the offset
-- from UTC of some input date.
-- For efficency reasons, Split and Time_Of take the first approach. Since
-- the Ada Reference Manual does not mandate that Split and Time_Of should
-- be concious of historic time zones, this interpretation is acceptable
-- and efficent in terms of performance. Split and Time_Of localize their
-- respective input regardless of whether it represent a past or a future
-- date.
-- UTC_Time_Offset on the other hand must be knowledgeable of historic time
-- zones. To achieve this, the implementation relies on various operating
-- system routines. Note that not all operating systems support time zones.
-- UTC_Time_Offset calculates the offset from UTC as it occurred or will
-- occur on the input date relative to the local time zone. Example:
-- Date Offset Reason
-- 2012-01-11 -300
-- 2011-03-12 -300
-- 2011-03-14 -240 Daylight savings is in effect
-- Local declarations
-- The underlying type of Time has been chosen to be a 64 bit signed -- The underlying type of Time has been chosen to be a 64 bit signed
-- integer number since it allows for easier processing of sub seconds -- integer number since it allows for easier processing of sub seconds
-- and arithmetic. -- and arithmetic.
...@@ -351,7 +380,7 @@ private ...@@ -351,7 +380,7 @@ private
package Time_Zones_Operations is package Time_Zones_Operations is
function UTC_Time_Offset (Date : Time) return Long_Integer; function UTC_Time_Offset (Date : Time) return Long_Integer;
-- Return (in seconds), the difference between the local time zone and -- Return (in seconds) the difference between the local time zone and
-- UTC time at a specific historic date. -- UTC time at a specific historic date.
end Time_Zones_Operations; end Time_Zones_Operations;
......
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2005-2012, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. In accordance with the copyright of that document, you can freely -- -- GNAT. In accordance with the copyright of that document, you can freely --
-- copy and modify this specification, provided that if you redistribute a -- -- copy and modify this specification, provided that if you redistribute a --
......
...@@ -514,14 +514,11 @@ package body Ch13 is ...@@ -514,14 +514,11 @@ package body Ch13 is
if Token = Tok_Comma if Token = Tok_Comma
or else Token = Tok_Semicolon or else Token = Tok_Semicolon
then then
-- or else (not Semicolon and then Token /= Tok_Arrow)
if Aspect_Argument (A_Id) /= Optional then if Aspect_Argument (A_Id) /= Optional then
Error_Msg_Node_1 := Identifier (Aspect); Error_Msg_Node_1 := Identifier (Aspect);
Error_Msg_AP ("aspect& requires an aspect definition"); Error_Msg_AP ("aspect& requires an aspect definition");
OK := False; OK := False;
end if; end if;
elsif not Semicolon and then Token /= Tok_Arrow then elsif not Semicolon and then Token /= Tok_Arrow then
......
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