aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
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 /numeric.c
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 'numeric.c')
-rw-r--r--numeric.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/numeric.c b/numeric.c
index c61f5d0982..6523249697 100644
--- a/numeric.c
+++ b/numeric.c
@@ -4037,11 +4037,10 @@ int_comp(VALUE num)
static int
bit_coerce(VALUE *x, VALUE *y)
{
- if (!FIXNUM_P(*y) && !RB_TYPE_P(*y, T_BIGNUM)) {
+ if (!RB_INTEGER_TYPE_P(*y)) {
VALUE orig = *x;
do_coerce(x, y, TRUE);
- if (!FIXNUM_P(*x) && !RB_TYPE_P(*x, T_BIGNUM)
- && !FIXNUM_P(*y) && !RB_TYPE_P(*y, T_BIGNUM)) {
+ if (!RB_INTEGER_TYPE_P(*x) && !RB_INTEGER_TYPE_P(*y)) {
coerce_failed(orig, *y);
}
}