From 11a57c63f3842ced2bfeb6e650e1a34cbea1a8af Mon Sep 17 00:00:00 2001 From: marcandre Date: Fri, 28 Feb 2014 02:04:43 +0000 Subject: [PATCH] * numeric.c: Simplify by getting rid of macro git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/numeric.c b/numeric.c index 7523f4ff37..58dad48fe2 100644 --- a/numeric.c +++ b/numeric.c @@ -1864,14 +1864,6 @@ ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl) } \ } while (0) -#define NUM_STEP_GET_INF(to, desc, inf) do { \ - if (RB_TYPE_P(to, T_FLOAT)) { \ - double f = RFLOAT_VALUE(to); \ - inf = isinf(f) && (signbit(f) ? desc : !desc); \ - } \ - else inf = 0; \ -} while (0) - static VALUE num_step_size(VALUE from, VALUE args, VALUE eobj) { @@ -1947,8 +1939,11 @@ num_step(int argc, VALUE *argv, VALUE from) RETURN_SIZED_ENUMERATOR(from, argc, argv, num_step_size); NUM_STEP_SCAN_ARGS(argc, argv, to, step, hash, desc); - NUM_STEP_GET_INF(to, desc, inf); - + if (RB_TYPE_P(to, T_FLOAT)) { + double f = RFLOAT_VALUE(to); + inf = isinf(f) && (signbit(f) ? desc : !desc); + } + else inf = 0; if (FIXNUM_P(from) && (inf || FIXNUM_P(to)) && FIXNUM_P(step)) { long i = FIX2LONG(from);