% svn diff --diff-cmd diff -x '-u -p' Index: lib/rake/application.rb =================================================================== --- lib/rake/application.rb (revision 49204) +++ lib/rake/application.rb (working copy) @@ -452,7 +452,7 @@ module Rake "(default is number of CPU cores + 4)", lambda { |value| if value.nil? || value == '' - value = FIXNUM_MAX + value = 2**32 elsif value =~ /^\d+$/ value = value.to_i else @@ -783,8 +783,5 @@ module Rake backtrace.find { |str| str =~ re } || '' end - private - FIXNUM_MAX = (2**(0.size * 8 - 2) - 1) # :nodoc: - end end Index: numeric.c =================================================================== --- numeric.c (revision 49204) +++ numeric.c (working copy) @@ -3671,11 +3671,19 @@ fix_abs(VALUE fix) * 1.size #=> 4 * -1.size #=> 4 * 2147483647.size #=> 4 + * + * This method will be changed in future. + * Use RbConfig::SIZEOF['long'] instead: + * + * require 'rbconfig/sizeof' + * RbConfig::SIZEOF['long'] #=> 4 + * */ static VALUE fix_size(VALUE fix) { + rb_warn("Use RbConfig::SIZEOF['long'] instead of Fixnum#size"); return INT2FIX(sizeof(long)); } Index: test/ruby/test_enumerator.rb =================================================================== --- test/ruby/test_enumerator.rb (revision 49204) +++ test/ruby/test_enumerator.rb (working copy) @@ -1,4 +1,5 @@ require 'test/unit' +require 'rbconfig/sizeof' class TestEnumerator < Test::Unit::TestCase def setup @@ -115,7 +116,7 @@ class TestEnumerator < Test::Unit::TestC def test_with_index_large_offset bug8010 = '[ruby-dev:47131] [Bug #8010]' - s = 1 << (8*1.size-2) + s = 1 << (8*RbConfig::SIZEOF['long']-2) assert_equal([[1,s],[2,s+1],[3,s+2]], @obj.to_enum(:foo, 1, 2, 3).with_index(s).to_a, bug8010) s <<= 1 assert_equal([[1,s],[2,s+1],[3,s+2]], @obj.to_enum(:foo, 1, 2, 3).with_index(s).to_a, bug8010)