1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

ruby.h: merge FLONUM and non-FLONUM

* include/ruby/ruby.h (RB_FLOAT_TYPE_P): merge FLONUM and non-FLONUM
  versions.  inline TYPE() comparison and FLONUM_P() should be
  optimized away on non-FLONUM.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-09-06 05:48:34 +00:00
parent d80f56cba3
commit 38d0cbce65
2 changed files with 7 additions and 5 deletions

View file

@ -1,3 +1,9 @@
Thu Sep 6 14:48:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* include/ruby/ruby.h (RB_FLOAT_TYPE_P): merge FLONUM and non-FLONUM
versions. inline TYPE() comparison and FLONUM_P() should be
optimized away on non-FLONUM.
Thu Sep 6 08:20:55 2012 Ryan Davis <ryand-ruby@zenspider.com>
* lib/minitest/*: Imported minitest 3.4.0 (r7762)

View file

@ -1497,11 +1497,7 @@ rb_type(VALUE obj)
return BUILTIN_TYPE(obj);
}
#if USE_FLONUM
#define RB_FLOAT_TYPE_P(obj) (FLONUM_P(obj) || TYPE(obj) == T_FLOAT)
#else
#define RB_FLOAT_TYPE_P(obj) (!SPECIAL_CONST_P(obj) && BUILTIN_TYPE(obj) == T_FLOAT)
#endif
#define RB_FLOAT_TYPE_P(obj) (FLONUM_P(obj) || (!SPECIAL_CONST_P(obj) && BUILTIN_TYPE(obj) == T_FLOAT))
#define RB_TYPE_P(obj, type) ( \
((type) == T_FIXNUM) ? FIXNUM_P(obj) : \