aboutsummaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-18 01:17:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-18 01:17:43 +0000
commit7ec4533c93adc4838ce53f5119c2702b10c9043f (patch)
treeadf65284cfe148dee36c8d8def3739543dcdf37a /ext
parent3736ef5b0f89887a0b47edf5b23c33698c5f1645 (diff)
downloadruby-7ec4533c93adc4838ce53f5119c2702b10c9043f.tar.gz
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')
-rw-r--r--ext/date/date_core.c4
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);
}