Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Suppress warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 131f694330d1d44add74643a264ff7c4d7f06216 1 parent c558195
@nurse nurse authored
View
10 test/gdbm/test_gdbm.rb
@@ -147,14 +147,14 @@ def test_s_open_with_block
def test_s_open_lock
return unless have_fork? # snip this test
pid = fork() {
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}", 0644))
+ assert_instance_of(GDBM, GDBM.open("#{@tmpdir}/#{@prefix}", 0644))
sleep 2
}
begin
sleep 1
assert_raise(Errno::EWOULDBLOCK) {
begin
- assert_instance_of(GDBM, gdbm2 = GDBM.open("#{@tmpdir}/#{@prefix}", 0644))
+ assert_instance_of(GDBM, GDBM.open("#{@tmpdir}/#{@prefix}", 0644))
rescue Errno::EAGAIN, Errno::EACCES
raise Errno::EWOULDBLOCK
end
@@ -187,7 +187,7 @@ def test_s_open_nolock
return unless have_fork? # snip this test
pid = fork() {
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}", 0644,
+ assert_instance_of(GDBM, GDBM.open("#{@tmpdir}/#{@prefix}", 0644,
GDBM::NOLOCK))
sleep 2
}
@@ -202,10 +202,10 @@ def test_s_open_nolock
gdbm2.close if gdbm2
end
- p Dir.glob("#{@tmpdir}/#{@prefix}*") if $DEBUG
+ STDERR.puts Dir.glob("#{@tmpdir}/#{@prefix}*") if $DEBUG
pid = fork() {
- assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}", 0644))
+ assert_instance_of(GDBM, GDBM.open("#{@tmpdir}/#{@prefix}", 0644))
sleep 2
}
begin
View
30 test/ruby/test_econv.rb
@@ -44,9 +44,9 @@ def test_s_asciicompat_encoding
def test_asciicompat_encoding_iso2022jp
acenc = Encoding::Converter.asciicompat_encoding("ISO-2022-JP")
- str = "\e$B~~\(B".force_encoding("iso-2022-jp")
+ str = "\e$B~~\e(B".force_encoding("iso-2022-jp")
str2 = str.encode(acenc)
- str3 = str.encode("ISO-2022-JP")
+ str3 = str2.encode("ISO-2022-JP")
assert_equal(str, str3)
end
@@ -147,7 +147,7 @@ def test_output_region
def test_nil_source_buffer
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
- ret = ec.primitive_convert(nil, dst="", nil, 10)
+ ret = ec.primitive_convert(nil, "", nil, 10)
assert_equal(:finished, ret)
end
@@ -475,44 +475,44 @@ def test_after_output
def test_errinfo_invalid_euc_jp
ec = Encoding::Converter.new("EUC-JP", "Shift_JIS")
- ec.primitive_convert(src="\xff", dst="", nil, 10)
+ ec.primitive_convert("\xff", "", nil, 10)
assert_errinfo(:invalid_byte_sequence, "EUC-JP", "Shift_JIS", "\xFF", "", ec)
end
def test_errinfo_invalid_euc_jp2
ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
- ec.primitive_convert(src="\xff", dst="", nil, 10)
+ ec.primitive_convert("\xff", "", nil, 10)
assert_errinfo(:invalid_byte_sequence, "EUC-JP", "UTF-8", "\xFF", "", ec)
end
def test_errinfo_undefined_hiragana
ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
- ec.primitive_convert(src="\xa4\xa2", dst="", nil, 10)
+ ec.primitive_convert("\xa4\xa2", "", nil, 10)
assert_errinfo(:undefined_conversion, "UTF-8", "ISO-8859-1", "\xE3\x81\x82", "", ec)
end
def test_errinfo_invalid_partial_character
ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
- ec.primitive_convert(src="\xa4", dst="", nil, 10)
+ ec.primitive_convert("\xa4", "", nil, 10)
assert_errinfo(:incomplete_input, "EUC-JP", "UTF-8", "\xA4", "", ec)
end
def test_errinfo_valid_partial_character
ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
- ec.primitive_convert(src="\xa4", dst="", nil, 10, :partial_input=>true)
+ ec.primitive_convert("\xa4", "", nil, 10, :partial_input=>true)
assert_errinfo(:source_buffer_empty, nil, nil, nil, nil, ec)
end
def test_errinfo_invalid_utf16be
ec = Encoding::Converter.new("UTF-16BE", "UTF-8")
- ec.primitive_convert(src="\xd8\x00\x00@", dst="", nil, 10)
+ ec.primitive_convert(src="\xd8\x00\x00@", "", nil, 10)
assert_errinfo(:invalid_byte_sequence, "UTF-16BE", "UTF-8", "\xD8\x00", "\x00", ec)
assert_equal("@", src)
end
def test_errinfo_invalid_utf16le
ec = Encoding::Converter.new("UTF-16LE", "UTF-8")
- ec.primitive_convert(src="\x00\xd8@\x00", dst="", nil, 10)
+ ec.primitive_convert(src="\x00\xd8@\x00", "", nil, 10)
assert_errinfo(:invalid_byte_sequence, "UTF-16LE", "UTF-8", "\x00\xD8", "@\x00", ec)
assert_equal("", src)
end
@@ -599,7 +599,7 @@ def test_putback
def test_putback2
ec = Encoding::Converter.new("utf-16le", "euc-jp")
- ret = ec.primitive_convert(src="\x00\xd8\x21\x00", dst="", nil, nil)
+ ret = ec.primitive_convert("\x00\xd8\x21\x00", "", nil, nil)
assert_equal(:invalid_byte_sequence, ret)
assert_equal("\x00".force_encoding("utf-16le"), ec.putback(1))
assert_equal("\x21".force_encoding("utf-16le"), ec.putback(1))
@@ -705,20 +705,20 @@ def test_finish_incomplete_error
def test_last_error1
ec = Encoding::Converter.new("sjis", "euc-jp")
assert_equal(nil, ec.last_error)
- assert_equal(:incomplete_input, ec.primitive_convert(src="fo\x81", dst="", nil, nil))
+ assert_equal(:incomplete_input, ec.primitive_convert("fo\x81", "", nil, nil))
assert_kind_of(Encoding::InvalidByteSequenceError, ec.last_error)
end
def test_last_error2
ec = Encoding::Converter.new("sjis", "euc-jp")
- assert_equal("fo", ec.convert(src="fo\x81"))
+ assert_equal("fo", ec.convert("fo\x81"))
assert_raise(Encoding::InvalidByteSequenceError) { ec.finish }
assert_kind_of(Encoding::InvalidByteSequenceError, ec.last_error)
end
def test_us_ascii
ec = Encoding::Converter.new("UTF-8", "US-ASCII")
- ec.primitive_convert(src="\u{3042}", dst="")
+ ec.primitive_convert("\u{3042}", "")
err = ec.last_error
assert_kind_of(Encoding::UndefinedConversionError, err)
assert_equal("\u{3042}", err.error_char)
@@ -726,7 +726,7 @@ def test_us_ascii
def test_88591
ec = Encoding::Converter.new("UTF-8", "ISO-8859-1")
- ec.primitive_convert(src="\u{3042}", dst="")
+ ec.primitive_convert("\u{3042}", "")
err = ec.last_error
assert_kind_of(Encoding::UndefinedConversionError, err)
assert_equal("\u{3042}", err.error_char)
View
8 test/test_securerandom.rb
@@ -87,7 +87,13 @@ def test_s_random_bytes_without_openssl
f << 'raise LoadError'
}
$LOAD_PATH.unshift(dir)
- require 'securerandom'
+ v = $VERBOSE
+ begin
+ $VERBOSE = false
+ require 'securerandom'
+ ensure
+ $VERBOSE = v
+ end
test_s_random_bytes
end
ensure
View
4 tool/compile_prelude.rb
@@ -75,7 +75,7 @@ def translate(filename, sub = false)
end
def emit(outfile)
- init_name = outfile[/\w+(?=_prelude.c\b)/] || 'prelude'
+ @init_name = outfile[/\w+(?=_prelude.c\b)/] || 'prelude'
erb = ERB.new(<<'EOS', nil, '%')
/* -*-c-*-
THIS FILE WAS AUTOGENERATED BY tool/compile_prelude.rb. DO NOT EDIT.
@@ -152,7 +152,7 @@ def emit(outfile)
% end
void
-Init_<%=init_name%>(void)
+Init_<%=@init_name%>(void)
{
% if @have_sublib or @need_ruby_prefix
struct prelude_env memo;
View
8 vm_exec.c
@@ -14,10 +14,10 @@
#if VMDEBUG > 0
#define DECL_SC_REG(type, r, reg) register type reg_##r
-#elif __GNUC__ && __x86_64__
+#elif defined(__GNUC__) && defined(_x86_64__)
#define DECL_SC_REG(type, r, reg) register type reg_##r __asm__("r" reg)
-#elif __GNUC__ && __i386__
+#elif defined(__GNUC__) && defined(__i386__)
#define DECL_SC_REG(type, r, reg) register type reg_##r __asm__("e" reg)
#else
@@ -41,12 +41,12 @@ vm_exec_core(rb_thread_t *th, VALUE initial)
#endif
#endif
-#if __GNUC__ && __i386__
+#if defined(__GNUC__) && defined(__i386__)
DECL_SC_REG(VALUE *, pc, "di");
DECL_SC_REG(rb_control_frame_t *, cfp, "si");
#define USE_MACHINE_REGS 1
-#elif __GNUC__ && __x86_64__
+#elif defined(__GNUC__) && defined(__x86_64__)
DECL_SC_REG(VALUE *, pc, "14");
DECL_SC_REG(rb_control_frame_t *, cfp, "15");
#define USE_MACHINE_REGS 1
View
4 vm_exec.h
@@ -60,7 +60,7 @@ typedef rb_iseq_t *ISEQ;
/* #define throwdebug printf */
/************************************************/
-#if DISPATCH_XXX
+#if defined(DISPATCH_XXX)
error !
/************************************************/
#elif OPT_CALL_THREADED_CODE
@@ -95,7 +95,7 @@ error !
INSN_ENTRY_SIG(insn); \
/* dispather */
-#if __GNUC__ && (__i386__ || __x86_64__) && __GNUC__ == 3
+#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && __GNUC__ == 3
#define DISPATCH_ARCH_DEPEND_WAY(addr) \
asm volatile("jmp *%0;\t# -- inseted by vm.h\t[length = 2]" : : "r" (addr))
Please sign in to comment.
Something went wrong with that request. Please try again.