From 7ec4533c93adc4838ce53f5119c2702b10c9043f Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 18 May 2016 01:17:43 +0000 Subject: ruby.h: RB_INTEGER_TYPE_P * include/ruby/ruby.h (RB_INTEGER_TYPE_P): new macro and underlying inline function to check if the object is an Integer (Fixnum or Bignum). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/date/date_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext') diff --git a/ext/date/date_core.c b/ext/date/date_core.c index 3a10fcb746..90377bf007 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -1360,7 +1360,7 @@ encode_year(VALUE nth, int y, double style, static void decode_jd(VALUE jd, VALUE *nth, int *rjd) { - assert(FIXNUM_P(jd) || RB_TYPE_P(jd, T_BIGNUM)); + assert(RB_INTEGER_TYPE_P(jd)); *nth = f_idiv(jd, INT2FIX(CM_PERIOD)); if (f_zero_p(*nth)) { assert(FIXNUM_P(jd)); @@ -3133,7 +3133,7 @@ wholenum_p(VALUE x) inline static VALUE to_integer(VALUE x) { - if (FIXNUM_P(x) || RB_TYPE_P(x, T_BIGNUM)) + if (RB_INTEGER_TYPE_P(x)) return x; return f_to_i(x); } -- cgit v1.2.3