Skip to content

Commit 43dd9c7

Browse files
nobumatzbot
authored andcommitted
[ruby/date] Fix mixed declarations and code
This still support ruby 2.6 which does not require C99. ruby/date@61d849758f
1 parent b910de6 commit 43dd9c7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ext/date/date_core.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8954,9 +8954,10 @@ date_to_time(VALUE self)
89548954
get_d1a(self);
89558955

89568956
if (m_julian_p(adat)) {
8957-
self = d_lite_gregorian(self);
8958-
get_d1b(self);
8957+
VALUE g = d_lite_gregorian(self);
8958+
get_d1b(g);
89598959
adat = bdat;
8960+
self = g;
89608961
}
89618962

89628963
t = f_local3(rb_cTime,
@@ -9034,9 +9035,10 @@ datetime_to_time(VALUE self)
90349035
get_d1(self);
90359036

90369037
if (m_julian_p(dat)) {
9037-
self = d_lite_gregorian(self);
9038-
get_d1a(self);
9038+
VALUE g = d_lite_gregorian(self);
9039+
get_d1a(g);
90399040
dat = adat;
9041+
self = g;
90409042
}
90419043

90429044
{

0 commit comments

Comments
 (0)