aboutsummaryrefslogtreecommitdiffstats
path: root/ext/date
diff options
context:
space:
mode:
Diffstat (limited to 'ext/date')
-rw-r--r--ext/date/date_core.c6
-rw-r--r--ext/date/date_parse.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index 0775fecbf2..7ed21db5fc 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -304,7 +304,7 @@ union DateData {
inline static VALUE
canon(VALUE x)
{
- if (TYPE(x) == T_RATIONAL) {
+ if (RB_TYPE_P(x, T_RATIONAL)) {
VALUE den = rb_rational_den(x);
if (FIXNUM_P(den) && FIX2LONG(den) == 1)
return rb_rational_num(x);
@@ -5843,7 +5843,7 @@ minus_dd(VALUE self, VALUE other)
if (f_nonzero_p(sf))
r = f_add(r, ns_to_day(sf));
- if (TYPE(r) == T_RATIONAL)
+ if (RB_TYPE_P(r, T_RATIONAL))
return r;
return rb_rational_new1(r);
}
@@ -7048,7 +7048,7 @@ d_lite_marshal_load(VALUE self, VALUE a)
rb_check_frozen(self);
rb_check_trusted(self);
- if (TYPE(a) != T_ARRAY)
+ if (!RB_TYPE_P(a, T_ARRAY))
rb_raise(rb_eTypeError, "expected an array");
switch (RARRAY_LEN(a)) {
diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c
index 3003b45239..239e2643b0 100644
--- a/ext/date/date_parse.c
+++ b/ext/date/date_parse.c
@@ -70,7 +70,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
{
VALUE c = Qnil;
- if (TYPE(m) != T_STRING)
+ if (!RB_TYPE_P(m, T_STRING))
m = f_to_s(m);
if (!NIL_P(y) && !NIL_P(m) && NIL_P(d)) {
@@ -585,12 +585,12 @@ date_zone_to_diff(VALUE str)
if (NIL_P(hour))
offset = INT2FIX(0);
else {
- if (TYPE(hour) == T_STRING)
+ if (RB_TYPE_P(hour, T_STRING))
hour = str2num(hour);
offset = f_mul(hour, INT2FIX(3600));
}
if (!NIL_P(min)) {
- if (TYPE(min) == T_STRING)
+ if (RB_TYPE_P(min, T_STRING))
min = str2num(min);
offset = f_add(offset, f_mul(min, INT2FIX(60)));
}