aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ada/g-catiio.adb27
-rw-r--r--gcc/ada/g-catiio.ads11
2 files changed, 18 insertions, 20 deletions
diff --git a/gcc/ada/g-catiio.adb b/gcc/ada/g-catiio.adb
index f7b318e..0d0b9b8 100644
--- a/gcc/ada/g-catiio.adb
+++ b/gcc/ada/g-catiio.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2007, AdaCore --
+-- Copyright (C) 1999-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -560,13 +560,15 @@ package body GNAT.Calendar.Time_IO is
D : String (1 .. 21);
D_Length : constant Natural := Date'Length;
- Year : Year_Number;
- Month : Month_Number;
- Day : Day_Number;
- Hour : Hour_Number;
- Minute : Minute_Number;
- Second : Second_Number;
+ Year : Year_Number;
+ Month : Month_Number;
+ Day : Day_Number;
+ Hour : Hour_Number;
+ Minute : Minute_Number;
+ Second : Second_Number;
+
Sub_Second : Second_Duration;
+ -- We ignore subseconds in this routine, so this is a throw away value
procedure Extract_Date
(Year : out Year_Number;
@@ -770,9 +772,6 @@ package body GNAT.Calendar.Time_IO is
-- Start of processing for Value
begin
- Split (Clock, Year, Month, Day, Hour, Minute, Second, Sub_Second);
- Sub_Second := 0.0;
-
-- Length checks
if D_Length /= 8
@@ -792,12 +791,12 @@ package body GNAT.Calendar.Time_IO is
D (1 .. D_Length) := Date;
- if D_Length /= 8
- or else D (3) /= ':'
- then
+ if D_Length /= 8 or else D (3) /= ':' then
Extract_Date (Year, Month, Day, Time_Start);
Extract_Time (Time_Start, Hour, Minute, Second, Check_Space => True);
+
else
+ Split (Clock, Year, Month, Day, Hour, Minute, Second, Sub_Second);
Extract_Time (1, Hour, Minute, Second, Check_Space => False);
end if;
@@ -813,7 +812,7 @@ package body GNAT.Calendar.Time_IO is
raise Constraint_Error;
end if;
- return Time_Of (Year, Month, Day, Hour, Minute, Second, Sub_Second);
+ return Time_Of (Year, Month, Day, Hour, Minute, Second);
end Value;
--------------
diff --git a/gcc/ada/g-catiio.ads b/gcc/ada/g-catiio.ads
index 34a3887..1f73c21 100644
--- a/gcc/ada/g-catiio.ads
+++ b/gcc/ada/g-catiio.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1999-2007, AdaCore --
+-- Copyright (C) 1999-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -132,7 +132,7 @@ package GNAT.Calendar.Time_IO is
--
-- Trailing characters (in particular spaces) are not allowed
--
- -- yyyy*mm*dd
+ -- yyyy*mm*dd - ISO format
-- yy*mm*dd - Year is assumed to be 20yy
-- mm*dd*yyyy - (US date format)
-- dd*mmm*yyyy - month spelled out
@@ -141,12 +141,11 @@ package GNAT.Calendar.Time_IO is
-- mmm dd, yyyy - month spelled out
-- dd mmm yyyy - month spelled out
--
- -- Constraint_Error is raised if the input string is malformatted or
+ -- Constraint_Error is raised if the input string is malformed (does not
+ -- conform to one of the above dates, or has an invalid time string), or
-- the resulting time is not valid.
- procedure Put_Time
- (Date : Ada.Calendar.Time;
- Picture : Picture_String);
+ procedure Put_Time (Date : Ada.Calendar.Time; Picture : Picture_String);
-- Put Date with format Picture. Raise Picture_Error if bad picture string
private