From ec3b72c55d064424cd9ed3b92b1bd7be5b501ecd Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 29 May 2018 09:41:40 +0000 Subject: [PATCH] [Ada] Turn Ada.Calendar.Epoch_Offset into a function 2018-05-29 Arnaud Charlet gcc/ada/ * libgnat/a-calend.ads, libgnat/a-calend.adb (Epoch_Offset): Make it a function. From-SVN: r260878 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/libgnat/a-calend.adb | 9 +++++++++ gcc/ada/libgnat/a-calend.ads | 5 +++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index be6192ddf31..3eb0a41f799 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-05-29 Arnaud Charlet + + * libgnat/a-calend.ads, libgnat/a-calend.adb (Epoch_Offset): Make it a + function. + 2018-05-29 Olivier Hainque * libgnat/system-vxworks7-ppc-rtp.ads: New file. diff --git a/gcc/ada/libgnat/a-calend.adb b/gcc/ada/libgnat/a-calend.adb index 8299b74bc98..8bf5e7a5ce4 100644 --- a/gcc/ada/libgnat/a-calend.adb +++ b/gcc/ada/libgnat/a-calend.adb @@ -500,6 +500,15 @@ is return D; end Day; + ------------------ + -- Epoch_Offset -- + ------------------ + + function Epoch_Offset return Time_Rep is + begin + return (136 * 365 + 44 * 366) * Nanos_In_Day; + end Epoch_Offset; + ------------- -- Is_Leap -- ------------- diff --git a/gcc/ada/libgnat/a-calend.ads b/gcc/ada/libgnat/a-calend.ads index 4371e110a1e..b1243804cb1 100644 --- a/gcc/ada/libgnat/a-calend.ads +++ b/gcc/ada/libgnat/a-calend.ads @@ -221,8 +221,9 @@ private -- with overloading ambiguities in the body if we tried to use Time as an -- internal computational type. - Epoch_Offset : constant Time_Rep := (136 * 365 + 44 * 366) * Nanos_In_Day; - -- The difference between 2150-1-1 UTC and 1970-1-1 UTC expressed in + function Epoch_Offset return Time_Rep; + pragma Inline (Epoch_Offset); + -- Return the difference between 2150-1-1 UTC and 1970-1-1 UTC expressed in -- nanoseconds. Note that year 2100 is non-leap. Days_In_Month : constant array (Month_Number) of Day_Number := -- 2.30.2