ruby-changes:33129
From: marcandre <ko1@a...>
Date: Fri, 28 Feb 2014 11:04:46 +0900 (JST)
Subject: [ruby-changes:33129] marcandRe: r45208 (trunk): * numeric.c: Simplify by getting rid of macro
marcandre 2014-02-28 11:04:43 +0900 (Fri, 28 Feb 2014) New Revision: 45208 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45208 Log: * numeric.c: Simplify by getting rid of macro Modified files: trunk/numeric.c Index: numeric.c =================================================================== --- numeric.c (revision 45207) +++ numeric.c (revision 45208) @@ -1864,14 +1864,6 @@ ruby_num_interval_step_size(VALUE from, https://github.com/ruby/ruby/blob/trunk/numeric.c#L1864 } \ } 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 fr https://github.com/ruby/ruby/blob/trunk/numeric.c#L1939 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/