* ext/socket/extconf.rb: suppress a warning.

* ext/extmk.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2010-01-26 12:34:51 +00:00
Родитель b71cab7fa0
Коммит fe98a03c53
7 изменённых файлов: 41 добавлений и 27 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Tue Jan 26 21:32:03 2010 Tanaka Akira <akr@fsij.org>
* ext/socket/extconf.rb: suppress a warning.
* ext/extmk.rb: ditto.
Tue Jan 26 20:23:22 2010 Yusuke Endoh <mame@tsg.ne.jp>
* vm.c (rb_vm_invoke_proc): this function must not catch TAG_RETURN

Просмотреть файл

@ -267,7 +267,7 @@ def parse_args()
if arg = v.first
arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg
end
$makeflags.concat(v.reject {|arg| /\AMINIRUBY=/ =~ arg}.quote)
$makeflags.concat(v.reject {|arg2| /\AMINIRUBY=/ =~ arg2}.quote)
$mflags.concat(v)
end
opts.on('--message [MESSAGE]', String) do |v|
@ -570,19 +570,19 @@ $mflags.unshift("topdir=#$topdir")
ENV.delete("RUBYOPT")
if $command_output
message = "echo #{message}"
cmd = $makeflags.map {|s|s.sub(/.*[$(){};\s].*/, %q['\&'])}.join(' ')
open($command_output, 'wb') do |f|
cmd = $makeflags.map {|ss|ss.sub(/.*[$(){};\s].*/, %q['\&'])}.join(' ')
open($command_output, 'wb') do |ff|
case $command_output
when /\.sh\z/
f.puts message, "rm -f $0; exec \"$@\" #{cmd}"
ff.puts message, "rm -f $0; exec \"$@\" #{cmd}"
when /\.bat\z/
["@echo off", message, "%* #{cmd}", "del %0 & exit %ERRORLEVEL%"].each do |s|
f.print s, "\r\n"
["@echo off", message, "%* #{cmd}", "del %0 & exit %ERRORLEVEL%"].each do |ss|
ff.print ss, "\r\n"
end
else
f.puts cmd
ff.puts cmd
end
f.chmod(0755)
ff.chmod(0755)
end
else
puts message

Просмотреть файл

@ -107,7 +107,7 @@ if have_struct_member("struct sockaddr", "sa_len", headers)
$defs[-1] = "-DHAVE_SA_LEN "
end
have_header("netinet/tcp.h") if not /cygwin/ =~ RUBY_PLATFORM # for cygwin 1.1.5
have_header("netinet/tcp.h") if /cygwin/ !~ RUBY_PLATFORM # for cygwin 1.1.5
have_header("netinet/udp.h")
if have_func("sendmsg") | have_func("recvmsg")

Просмотреть файл

@ -67,7 +67,7 @@ class TestDir_M17N < Test::Unit::TestCase
s2 = File.stat(filename2) rescue nil
s3 = File.stat(filename3) rescue nil
s4 = File.stat(filename4) rescue nil
exit (s1 && s2 && !s3 && !s4) ? true : false
exit((s1 && s2 && !s3 && !s4) ? true : false)
EOS
}
end
@ -122,7 +122,7 @@ class TestDir_M17N < Test::Unit::TestCase
s1 = File.stat(filename1) rescue nil
s2 = File.stat(filename2) rescue nil
s3 = File.stat(filename3) rescue nil
exit (s1 && s2 && s3) ? true : false
exit((s1 && s2 && s3) ? true : false)
EOS
}
end

Просмотреть файл

@ -1218,8 +1218,8 @@ class TestM17N < Test::Unit::TestCase
assert_equal(Encoding::US_ASCII, eval("\n# -*- encoding: ASCII-8BIT -*-\n__ENCODING__".force_encoding("US-ASCII")))
# leading expressions
assert_equal(Encoding::ASCII_8BIT, eval("1+1 # -*- encoding: US-ASCII -*-\n__ENCODING__".force_encoding("ASCII-8BIT")))
assert_equal(Encoding::US_ASCII, eval("1+1 # -*- encoding: ASCII-8BIT -*-\n__ENCODING__".force_encoding("US-ASCII")))
assert_equal(Encoding::ASCII_8BIT, eval("v=1 # -*- encoding: US-ASCII -*-\n__ENCODING__".force_encoding("ASCII-8BIT")))
assert_equal(Encoding::US_ASCII, eval("v=1 # -*- encoding: ASCII-8BIT -*-\n__ENCODING__".force_encoding("US-ASCII")))
end
def test_regexp_usascii

Просмотреть файл

@ -1057,7 +1057,7 @@ class TestM17NComb < Test::Unit::TestCase
def test_str_oct
STRINGS.each {|s|
t = s.oct
t2 = a(s)[/\A[0-9a-fA-FxXbB]*/].oct
t2 = a(s)[/\A[0-9a-fA-FxX]*/].oct
assert_equal(t2, t)
}
end

Просмотреть файл

@ -189,8 +189,12 @@ class TestRange < Test::Unit::TestCase
o1 = Object.new
o2 = Object.new
def o1.<=>(x); -1; end
def o2.<=>(x); 0; end
def o1.setcmp(v) @cmpresult = v end
o1.setcmp(-1)
def o1.<=>(x); @cmpresult; end
def o2.setcmp(v) @cmpresult = v end
o2.setcmp(0)
def o2.<=>(x); @cmpresult; end
class << o1; self; end.class_eval do
define_method(:succ) { o2 }
end
@ -206,19 +210,19 @@ class TestRange < Test::Unit::TestCase
r2.each {|x| a << x }
assert_equal([o1], a)
def o2.<=>(x); 1; end
o2.setcmp(1)
a = []
r1.each {|x| a << x }
assert_equal([o1], a)
def o2.<=>(x); nil; end
o2.setcmp(nil)
a = []
r1.each {|x| a << x }
assert_equal([o1], a)
def o1.<=>(x); nil; end
o1.setcmp(nil)
a = []
r2.each {|x| a << x }
@ -270,20 +274,24 @@ class TestRange < Test::Unit::TestCase
def test_beg_len
o = Object.new
assert_raise(TypeError) { [][o] }
def o.begin; -10; end
class << o; attr_accessor :begin end
o.begin = -10
assert_raise(TypeError) { [][o] }
def o.end; 0; end
class << o; attr_accessor :end end
o.end = 0
assert_raise(NoMethodError) { [][o] }
def o.exclude_end?; false; end
def o.exclude_end=(v) @exclude_end = v end
def o.exclude_end?() @exclude_end end
o.exclude_end = false
assert_nil([0][o])
assert_raise(RangeError) { [0][o] = 1 }
def o.begin; 10; end
def o.end; 10; end
o.begin = 10
o.end = 10
assert_nil([0][o])
def o.begin; 0; end
o.begin = 0
assert_equal([0], [0][o])
def o.begin; 2; end
def o.end; 0; end
o.begin = 2
o.end = 0
assert_equal([], [0, 1, 2][o])
end