summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-06 05:48:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-06 05:48:34 +0000
commit38d0cbce65d97a8ddc61609d2a052cd91d4a2789 (patch)
treef57326cf99db9479c3c033f2dfee9e9385d2b2ed
parentd80f56cba3eb0b920e02912243e4dc5ee965914e (diff)
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
-rw-r--r--ChangeLog6
-rw-r--r--include/ruby/ruby.h6
2 files changed, 7 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 55cb5084e5..a305df6e83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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) : \