2 -- { dg-options "-Os -g" }
8 procedure Parse
(Str
: String;
9 Time_Type
: out time_t
;
11 Delt_Time
: out Duration) is
15 Minute
: Integer := 0;
16 Idx
: Integer := Str
'First;
17 Ch
: Character := Str
(Idx
);
22 Time_Type
:= Absolute_Time
;
23 Current_Time
:= Clock
;
24 Day
:= Ada
.Calendar
.Day
(Current_Time
);
25 Month
:= Ada
.Calendar
.Month
(Current_Time
);
26 Year
:= Ada
.Calendar
.Year
(Current_Time
);
28 Time_Type
:= Delta_Time
;
30 while Ch
in '0' .. '9' loop
31 Minute
:= Minute
+ Character'Pos (Ch
);
35 if Time_Type
= Absolute_Time
then
36 Abs_Time
:= Time_Of
(Year
, Month
, Day
, Day_Duration
(1));
38 Delt_Time
:= Duration (Float (Minute
));
41 when others => Opt7_Pkg
.My_Raise_Exception
;