summaryrefslogtreecommitdiff
path: root/gcc/ada/a-calend.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-15 10:26:33 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-15 10:26:33 +0000
commitc970afb73a4d0516216b792baf6071d0077c222a (patch)
tree447369126eb4e677e186ff36876e121c754064be /gcc/ada/a-calend.adb
parenta0d9619fa08b438aaeda58cb70100b803942e9fe (diff)
downloadgcc-c970afb73a4d0516216b792baf6071d0077c222a.tar.gz
2009-04-15 Hristian Kirtchev <kirtchev@adacore.com>
* a-calend.adb: Add new constant Nanos_In_Four_Years. (Formatting_Operations.Time_Of): Change the way four year chunks of nanoseconds are added to the intermediate result. 2009-04-15 Nicolas Setton <setton@adacore.com> * sysdep.c: Add __APPLE__ in the list of systems where get_immediate does not need to wait for a carriage return. 2009-04-15 Tristan Gingold <gingold@adacore.com> * bindgen.adb: Do not generate adafinal if No_Finalization restriction is set. 2009-04-15 Ed Schonberg <schonberg@adacore.com> * freeze.adb (Freeze_Entity): improve error message for improper use of incomplete types. Diagnose additional illegal uses of incomplete types in formal parts. appearing in formal parts. * sem_ch6.adb (Process_Formals, Analyze_Return_Type): ditto. 2009-04-15 Robert Dewar <dewar@adacore.com> * exp_ch4.adb (Expand_N_Allocator): Install test for object too large. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146098 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-calend.adb')
-rw-r--r--gcc/ada/a-calend.adb5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/ada/a-calend.adb b/gcc/ada/a-calend.adb
index a2759b53a89..7e785116f02 100644
--- a/gcc/ada/a-calend.adb
+++ b/gcc/ada/a-calend.adb
@@ -148,6 +148,7 @@ package body Ada.Calendar is
Ada_Min_Year : constant Year_Number := Year_Number'First;
Secs_In_Four_Years : constant := (3 * 365 + 366) * Secs_In_Day;
Secs_In_Non_Leap_Year : constant := 365 * Secs_In_Day;
+ Nanos_In_Four_Years : constant := Secs_In_Four_Years * Nano;
-- Lower and upper bound of Ada time. The zero (0) value of type Time is
-- positioned at year 2150. Note that the lower and upper bound account
@@ -1317,7 +1318,9 @@ package body Ada.Calendar is
-- the input date.
Count := (Year - Year_Number'First) / 4;
- Res_N := Res_N + Time_Rep (Count) * Secs_In_Four_Years * Nano;
+ for Four_Year_Segments in 1 .. Count loop
+ Res_N := Res_N + Nanos_In_Four_Years;
+ end loop;
-- Note that non-leap centennial years are automatically considered
-- leap in the operation above. An adjustment of several days is