diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-18 01:17:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-18 01:17:43 +0000 |
commit | 4a9705d6e3384342a3ee649bfdbd93062140b5fd (patch) | |
tree | adf65284cfe148dee36c8d8def3739543dcdf37a /ext/date | |
parent | abe32a00b1096c0be8196385cccb983ca2b5e497 (diff) |
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
Diffstat (limited to 'ext/date')
-rw-r--r-- | ext/date/date_core.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); } |