summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-18 01:17:43 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-18 01:17:43 (GMT)
commit4a9705d6e3384342a3ee649bfdbd93062140b5fd (patch)
treeadf65284cfe148dee36c8d8def3739543dcdf37a /sprintf.c
parentabe32a00b1096c0be8196385cccb983ca2b5e497 (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 'sprintf.c')
-rw-r--r--sprintf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sprintf.c b/sprintf.c
index d8069b6..c6afb0d 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -1043,7 +1043,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
VALUE val = GETARG(), num, den;
int sign = (flags&FPLUS) ? 1 : 0, zero = 0;
long len, fill;
- if (FIXNUM_P(val) || RB_TYPE_P(val, T_BIGNUM)) {
+ if (RB_INTEGER_TYPE_P(val)) {
den = INT2FIX(1);
num = val;
}