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

Clean warnings: unused variables.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2010-06-23 05:32:46 +00:00
parent d514cd3ca0
commit 0de2d84af8
9 changed files with 12 additions and 17 deletions

View file

@ -577,7 +577,7 @@ class Socket < BasicSocket
def self.udp_server_recv(sockets)
sockets.each {|r|
begin
msg, sender_addrinfo, rflags, *controls = r.recvmsg_nonblock
msg, sender_addrinfo, _, *controls = r.recvmsg_nonblock
rescue IO::WaitReadable
next
end

View file

@ -246,7 +246,7 @@ module SingleForwardable
# provided, it is used as the name for the delegate method.
#
def def_single_delegator(accessor, method, ali = method)
line_no = __LINE__; str = %{
str = %{
def #{ali}(*args, &block)
begin
#{accessor}.__send__(:#{method}, *args, &block)
@ -264,7 +264,3 @@ module SingleForwardable
alias def_delegators def_single_delegators
alias def_delegator def_single_delegator
end

View file

@ -834,7 +834,6 @@ class Matrix
a = to_a
last_column = column_size - 1
last_row = row_size - 1
rank = 0
pivot_row = 0
previous_pivot = 1
0.upto(last_column) do |k|
@ -1237,7 +1236,7 @@ class Vector
# Vector[7, 4, ...]
#
def Vector.[](*array)
new convert_to_array(array, copy = false)
new convert_to_array(array, false)
end
#
@ -1532,6 +1531,6 @@ class Vector
# Overrides Object#inspect
#
def inspect
str = "Vector"+@elements.inspect
"Vector" + @elements.inspect
end
end

View file

@ -153,8 +153,7 @@ def map_dir(dir, map = nil)
map.inject(dir) {|d, (orig, new)| d.gsub(orig, new)}
end
topdir = File.dirname(libdir = File.dirname(__FILE__))
extdir = File.expand_path("ext", topdir)
topdir = File.dirname(File.dirname(__FILE__))
path = File.expand_path($0)
$extmk = path[0, topdir.size+1] == topdir+"/"
$extmk &&= %r"\A(?:ext|enc|tool|test(?:/.+))\z" =~ File.dirname(path[topdir.size+1..-1])

View file

@ -1097,8 +1097,8 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
assert_equal("[fcall(proc,[],&block([],[void()]))]", parse("proc{|;y|}"))
if defined?(Process::RLIMIT_AS)
assert_in_out_err(["-I#{File.dirname(__FILE__)}", "-rdummyparser"],
'Process.setrlimit(Process::RLIMIT_AS,102400); puts DummyParser.new("proc{|;y|}").parse',
["[fcall(proc,[],&block([],[void()]))]"], [], '[ruby-dev:39423]')
'Process.setrlimit(Process::RLIMIT_AS,102400); puts DummyParser.new("proc{|;y|!y}").parse',
["[fcall(proc,[],&block([],[unary(!,ref(y))]))]"], [], '[ruby-dev:39423]')
end
end

View file

@ -61,6 +61,7 @@ End
ObjectSpace.define_finalizer(a) { p :ok }
b = a.dup
ObjectSpace.define_finalizer(a) { p :ok }
!b
END
assert_raise(ArgumentError) { ObjectSpace.define_finalizer([], Object.new) }
end

View file

@ -182,7 +182,7 @@ class TestRubyOptions < Test::Unit::TestCase
end
def test_syntax_check
assert_in_out_err(%w(-c -e a=1+1), "", ["Syntax OK"], [])
assert_in_out_err(%w(-c -e a=1+1 -e !a), "", ["Syntax OK"], [])
end
def test_invalid_option

View file

@ -231,7 +231,7 @@ class TestThread < Test::Unit::TestCase
t1 = Thread.new { sleep }
Thread.pass
t2 = Thread.new { loop { } }
t3 = Thread.new { }.join
Thread.new { }.join
p [Thread.current, t1, t2].map{|t| t.object_id }.sort
p Thread.list.map{|t| t.object_id }.sort
INPUT

View file

@ -4,7 +4,7 @@ require_relative 'ruby/envutil'
# mathn redefines too much. It must be isolated to child processes.
class TestMathn < Test::Unit::TestCase
def test_power
assert_in_out_err ['-r', 'mathn', '-e', 'a=1**2'], "", [], [], '[ruby-core:25740]'
assert_in_out_err ['-r', 'mathn', '-e', 'a=(1<<126)**2'], "", [], [], '[ruby-core:25740]'
assert_in_out_err ['-r', 'mathn', '-e', 'a=1**2;!a'], "", [], [], '[ruby-core:25740]'
assert_in_out_err ['-r', 'mathn', '-e', 'a=(1<<126)**2;!a'], "", [], [], '[ruby-core:25740]'
end
end