diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | include/ruby/ruby.h | 6 |
2 files changed, 7 insertions, 5 deletions
@@ -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) diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index a674de8dc6..61a5a50eeb 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -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) : \ |