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

* ext/socket/mkconstants.rb (INTEGER2NUM): Make less comparisons.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2013-05-18 11:28:51 +00:00
parent 05c0a22854
commit 9cc1cc2045
2 changed files with 12 additions and 6 deletions

View file

@ -1,3 +1,7 @@
Sat May 18 20:28:12 2013 Tanaka Akira <akr@fsij.org>
* ext/socket/mkconstants.rb (INTEGER2NUM): Make less comparisons.
Sat May 18 20:15:28 2013 NARUSE, Yui <naruse@ruby-lang.org>
* string.c (str_scrub_bang): add String#scrub!. [Feature #8414]

View file

@ -280,13 +280,15 @@ result = ERB.new(<<'EOS', nil, '%').result(binding)
<%= INTERN_DEFS.map {|vardef, gen_hash, decl, func| vardef }.join("\n") %>
#ifdef HAVE_LONG_LONG
#define INTEGER2NUM(n) (0 < (n) ? \
((n) <= FIXNUM_MAX ? LONG2FIX(n) : ULL2NUM(n)) : \
(FIXNUM_MIN <= (LONG_LONG)(n) ? LONG2FIX(n) : LL2NUM(n)))
#define INTEGER2NUM(n) \
(FIXNUM_MAX < (n) ? ULL2NUM(n) : \
FIXNUM_MIN > (LONG_LONG)(n) ? LL2NUM(n) : \
LONG2FIX(n))
#else
#define INTEGER2NUM(n) (0 < (n) ? \
((n) <= FIXNUM_MAX ? LONG2FIX(n) : ULONG2NUM(n)) : \
(FIXNUM_MIN <= (long)(n) ? LONG2FIX(n) : LONG2NUM(n)))
#define INTEGER2NUM(n) \
(FIXNUM_MAX < (n) ? ULONG2NUM(n) : \
FIXNUM_MIN > (long)(n) ? LONG2NUM(n) : \
LONG2FIX(n))
#endif
static void