Fix finalize of WeakRef

* gc.c (wmap_final_func): remove WeakRef object reference from the
  array.

* gc.c (wmap_finalize): remove recycled object references from weak
  map hash properly. How to get object reference from object id was
  wrong. st_delete() doesn't work properly if key and value arguments
  are same. The key of obj2wmap is referenced object and the value of
  obj2wmap is WeakRef array.

* gc.c (wmap_aset): obj2wmap should contain WeakRef array in the
  definition.

* test/test_weakref.rb
  (TestWeakRef#test_not_reference_different_object): add a test for
  above.
  [ruby-core:49044] [Bug #7304]

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
wmap_finalize: refactoring to rename variables

* gc.c (wmap_final_func): rename variables to clarify the meaning.
  In wmap2obj the key is WeakRef and the value is referenced object.
  In obj2wmap the key is referenced object and the value is an array
  of WeakRef.

* gc.c (wmap_finalize): ditto.
  [ruby-core:49044] [Bug #7304]

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Fix Segmentation fault at TestArray#test_aref

* array.c (rb_ary_aref): fix Segmentation fault at TestArray#test_aref
  on x64 mingw. Variable argument of rb_scan_args() should be a pointer
  (VALUE *), but 0 of variable argument seems not equal to null pointer
  on x64 mingw.

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Fix TestProcess#test_setsid

* test/ruby/test_process.rb (TestProcess#test_setsid): "./ruby-trunk"
  doesn't work on all environments. EnvUtil.rubybin would be suitable.

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_trace.c (rb_tracepoint_attr_raised_exception): should not check
  value before event checking.
* vm_trace.c (rb_tracepoint_attr_return_value): ditto.
* test/ruby/test_settracefunc.rb: add tests for TracePoint#return_value
  and TracePoint#raised_exception.



git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Rvert r37827 and r37828

Revert "Fix finalize of WeakRef"
This causes segv on rubyspec.
http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20121124T050101Z.log.html.gz

you can reproduce by
 make test-rubyspec MSPECOPT='-V library/weakref'

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
	* test/ruby/test_rubyoptions.rb (test_usage, test_usage_long):
	  reduced, renamed.


git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/nkf/nkf-utf8/nkf.c (unicode_iconv_combine): returning flags are
  nkf_char.

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Fix WeakRef finalize

* array.c (rb_ary_delete_same_obj): new function for WeakRef.
  This deletes same objects as item argument in the array.

* internal.h (rb_ary_delete_same_obj): add a declaration.

* gc.c (wmap_final_func): remove WeakRef object reference from the
  array. rb_ary_delete() is not usable because it uses rb_equal() to
  compare object references.

* gc.c (wmap_finalize): remove recycled object references from weak
  map hash properly. How to get object reference from object id was
  wrong. st_delete() doesn't work properly if key and value arguments
  are same. The key of obj2wmap is referenced object and the value of
  obj2wmap is WeakRef array.

* gc.c (wmap_aset): obj2wmap should contain WeakRef array in the
  definition.

* test/test_weakref.rb
  (TestWeakRef#test_not_reference_different_object,
   TestWeakRef#test_weakref_finalize): add tests for above.
  [ruby-core:49044] [Bug #7304]

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
gc.c: refactoring to rename variables

* gc.c (wmap_final_func): rename variables to clarify the meaning.
  In wmap2obj the key is WeakRef and the value is referenced object.
  In obj2wmap the key is referenced object and the value is an array
  of WeakRef.

* gc.c (wmap_finalize): ditto.
  [ruby-core:49044] [Bug #7304]

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Fix tests of rb_warning().

* test/ruby/envutil.rb (Test::Unit::Assertions#assert_warning)
  (Test::Unit::Assertions#assert_warn), test/ruby/envutil.rb,
  test/ruby/test_enumerator.rb, test/ruby/test_io_m17n.rb,
  test/ruby/test_regexp.rb, test/ruby/test_syntax.rb:
  assert_warn() and assert_warning() are reversed.

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 2012-11-25

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
String#{lines,chars,codepoints,bytes} now return an array.

* string.c (rb_str_each_line, rb_str_lines): String#lines now
  returns an array instead of an enumerator.  Passing a block is
  deprecated but still supported for backwards compatibility.
  Based on the patch by yhara. [Feature #6670]

* string.c (rb_str_each_char, rb_str_chars): Ditto for
  String#chars.

* string.c (rb_str_each_codepoint, rb_str_codepoints): Ditto for
  String#codepoints.

* string.c (rb_str_each_byte, rb_str_bytes): Ditto for
  String#bytes.

* NEWS: Add notes for the above changes.

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Move tests embedded in lib/set.rb to test/test_set.rb.

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Fix test to follow r37838

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* NEWS: add a news about iconv.

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c: fixes for the updated documentation in r35858:
  Typos and #take/#drop accept to take/drop 0 elements.

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
array.c: refactoring of rb_ary_delete_same()

* array.c (ary_resize_smaller): new function to resize array.

* array.c (rb_ary_delete): refactoring to extract a function.

* array.c (rb_ary_delete_same): refactoring.
  It renames function, reduces duplicated code and removes unused
  code.

* gc.c (wmap_final_func): follow the above change.

* internal.h (rb_ary_delete_same): ditto.

git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@37843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e