summaryrefslogtreecommitdiff
path: root/ext/date/date_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/date/date_core.c')
-rw-r--r--ext/date/date_core.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index ee360b4..0775fec 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -114,7 +114,7 @@ f_zero_p(VALUE x)
return Qfalse;
case T_RATIONAL:
{
- VALUE num = RRATIONAL(x)->num;
+ VALUE num = rb_rational_num(x);
return f_boolcast(FIXNUM_P(num) && FIX2LONG(num) == 0);
}
}
@@ -305,9 +305,9 @@ inline static VALUE
canon(VALUE x)
{
if (TYPE(x) == T_RATIONAL) {
- VALUE den = RRATIONAL(x)->den;
+ VALUE den = rb_rational_den(x);
if (FIXNUM_P(den) && FIX2LONG(den) == 1)
- return RRATIONAL(x)->num;
+ return rb_rational_num(x);
}
return x;
}
@@ -2373,8 +2373,8 @@ offset_to_sec(VALUE vof, int *rof)
return 1;
}
#endif
- vn = RRATIONAL(vs)->num;
- vd = RRATIONAL(vs)->den;
+ vn = rb_rational_num(vs);
+ vd = rb_rational_den(vs);
if (FIXNUM_P(vn) && FIXNUM_P(vd) && (FIX2LONG(vd) == 1))
n = FIX2LONG(vn);
@@ -3097,7 +3097,7 @@ wholenum_p(VALUE x)
break;
case T_RATIONAL:
{
- VALUE den = RRATIONAL(x)->den;
+ VALUE den = rb_rational_den(x);
return FIXNUM_P(den) && FIX2LONG(den) == 1;
}
break;
@@ -5707,7 +5707,7 @@ d_lite_plus(VALUE self, VALUE other)
int jd, df, s;
if (wholenum_p(other))
- return d_lite_plus(self, RRATIONAL(other)->num);
+ return d_lite_plus(self, rb_rational_num(other));
if (f_positive_p(other))
s = +1;