a-catizo.ads, [...]: Minor reformatting.
authorRobert Dewar <dewar@adacore.com>
Mon, 23 Jan 2012 09:33:31 +0000 (09:33 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 23 Jan 2012 09:33:31 +0000 (10:33 +0100)
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

gcc/ada/ChangeLog
gcc/ada/a-calend.adb
gcc/ada/a-calend.ads
gcc/ada/a-catizo.ads
gcc/ada/par-ch13.adb

index 511afc0ea6bc79dccd212857639c121aa3ecb7f5..edc4dc458fc0c63f0e8c3f702c2c79fc5a3f0536 100644 (file)
@@ -1,3 +1,8 @@
+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>
 
        * sem_ch6.adb (Analyze_Subprogram_Declaration): Do not set the
index 731c4eddfb9c7fcfa2f03b5582ebcdcd7868817c..d85eb2cbc5b3efa0b354a3eb867e9efe3c4b59ce 100644 (file)
@@ -30,7 +30,9 @@
 ------------------------------------------------------------------------------
 
 with Ada.Unchecked_Conversion;
+
 with Interfaces.C;
+
 with System.OS_Primitives;
 
 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
    --  in turn utilizes various OS-dependent mechanisms to calculate the time
    --  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
    --  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
    --  time zone with Date effectively set to Clock.
+   --
    --  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
    --  localtime_r operates.
@@ -191,7 +194,7 @@ package body Ada.Calendar is
    Unix_Min : constant Time_Rep :=
                 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.
 
    Unix_Max : constant Time_Rep :=
index 61780190039132956acebb06ffb90e8e56d11ece..9e08c79375bfec5d040e60bd26ae1deec802c2ba 100644 (file)
@@ -193,6 +193,35 @@ private
    --  of year - 4 to year + 4. Internally, routines Split and Time_Of add or
    --  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
    --  integer number since it allows for easier processing of sub seconds
    --  and arithmetic.
@@ -351,7 +380,7 @@ private
    package Time_Zones_Operations is
 
       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.
 
    end Time_Zones_Operations;
index feb0402e7f1c87efa11844be3c6b8cb1577488bf..5f558691eef6c4125aeac76baddfc0e09a43a162 100644 (file)
@@ -6,8 +6,6 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---         Copyright (C) 2005-2012, Free Software Foundation, Inc.          --
---                                                                          --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT.  In accordance with the copyright of that document, you can freely --
 -- copy and modify this specification,  provided that if you redistribute a --
index 107426fb78c935afb69c3b12b892a4cb58788f0c..9526e325e0a22bf55585a84cd5da357f22229dfe 100644 (file)
@@ -514,14 +514,11 @@ package body Ch13 is
 
             if Token = Tok_Comma
               or else Token = Tok_Semicolon
-
             then
-               --  or else (not Semicolon and then Token /= Tok_Arrow)
                if Aspect_Argument (A_Id) /= Optional then
                   Error_Msg_Node_1 := Identifier (Aspect);
                   Error_Msg_AP ("aspect& requires an aspect definition");
                   OK := False;
-
                end if;
 
             elsif not Semicolon and then Token /= Tok_Arrow then