From 61d849758fe497897740a876bc9a91e531c6f0da Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 29 Nov 2024 11:12:34 +0900 Subject: [PATCH] Fix mixed declarations and code This still support ruby 2.6 which does not require C99. --- ext/date/date_core.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ext/date/date_core.c b/ext/date/date_core.c index 09bf0c7..2e92539 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -8954,9 +8954,10 @@ date_to_time(VALUE self) get_d1a(self); if (m_julian_p(adat)) { - self = d_lite_gregorian(self); - get_d1b(self); + VALUE g = d_lite_gregorian(self); + get_d1b(g); adat = bdat; + self = g; } t = f_local3(rb_cTime, @@ -9034,9 +9035,10 @@ datetime_to_time(VALUE self) get_d1(self); if (m_julian_p(dat)) { - self = d_lite_gregorian(self); - get_d1a(self); + VALUE g = d_lite_gregorian(self); + get_d1a(g); dat = adat; + self = g; } {