aboutsummaryrefslogtreecommitdiffstats
path: root/array.c
Commit message (Collapse)AuthorAgeFilesLines
* * include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]marcandre2012-03-141-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * array.c: Use rb_check_arity / rb_error_arity * class.c: ditto * enumerator.c: ditto * eval.c: ditto * file.c: ditto * hash.c: ditto * numeric.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * re.c: ditto * signal.c: ditto * string.c: ditto * struct.c: ditto * transcode.c: ditto * vm_eval.c: ditto * vm_insnhelper.c: ditto & implementation of rb_error_arity * test/ruby/test_arity.rb: tests for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_cat): new function to concat objects into array.nobu2012-03-081-5/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Fix rdoc for Array#select!marcandre2012-02-101-2/+2
| | | | | | patched by b t [ruby-core:42478] [Bug #5998] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix typoayumin2012-01-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sample): add examples for Array#sample.ayumin2012-01-041-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_reject_bang, rb_ary_delete_if): update rdoc.nobu2011-12-151-0/+4
| | | | | | | | documentation from Thomas Leitner <t_leitner AT gmx.at> in [ruby-core:41616]. [Bug #5752] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_initialize): Improve explanation of Array.newdrbrain2011-10-101-42/+69
| | | | | | | | | | | parameters. Patch by Alvaro Pereyra Rabanal. [Ruby 1.9 - Bug #5425] * array.c (rb_ary_s_try_convert): Fix typo (try => tries) * array.c (rb_ary_rindex): Add spacing for block. * array.c (rb_ary_uniq_bang): Describe block * array.c (rb_ary_uniq): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Add a description to Array, minor cleanups. Patch bydrbrain2011-10-101-16/+243
| | | | | | | Andrea Singh. [Ruby 1.9 - Bug #5412] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Use + for arguments described in documentation to allowdrbrain2011-10-061-96/+91
| | | | | | | | rdoc -C2 to work better. Remove <code> from method references to allow cross-references in HTML documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_initalize): Make Array.new description matchdrbrain2011-10-031-3/+3
| | | | | | | call-seq. Patch by Henry Maddocks. [Ruby 1.9 - Bug #5344] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_initialize): Add output for examples. Patch bydrbrain2011-10-031-10/+11
| | | | | | | Jonathan Mukai. [Ruby 1.9 - Bug #5216] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_s_create): Add example results for Array::[]. Patchdrbrain2011-10-031-7/+6
| | | | | | | by Jonathan Mukai. [Ruby 1.9 - Bug #5215] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_join_1): should not copy the encoding of non-stringnobu2011-09-291-0/+1
| | | | | | element after string element. [ruby-core:39776] [Bug #5379] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * use RB_TYPE_P which is optimized for constant types, instead ofnobu2011-09-291-4/+4
| | | | | | comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_set_len): new function to set array length.nobu2011-07-291-0/+15
| | | | | | | * vm_eval.c (method_missing): set the length of argv array, to mark arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Fix typo. https://github.com/ruby/ruby/pull/36shyouhei2011-07-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_delete_at_m): use simple array literal in rdoc.naruse2011-07-211-1/+1
| | | | | | patched by samuel tonini. [ruby-core:38310] [Bug #5066] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_reject_bang): should not remove elements which arenobu2011-07-031-21/+13
| | | | | | | not yielded. [Bug #2545] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_reject_bang, rb_ary_delete_if): rejectednobu2011-07-011-20/+49
| | | | | | | elements should be removed. fixed [Bug #2545] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (cont_capture): add volatile.naruse2011-06-221-1/+2
| | | | | | | | | | | | | | On clang -O, it is needed to avoid the optimization. With this and llvm/clang's recent fix, clang 3.0 can build ruby-trunk with -O option. * cont.c (cont_capture): use for-loop. * array.c (rb_ary_each): add volatile and use it. * vm_insnhelper.c (vm_call_cfunc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, hash.c, load.c, proc.c, range.c, thread.c, time.c: don'takr2011-06-181-0/+1
| | | | | | | | | | | | | | | declare internal functions. * internal.h, vm_core.h: declare internal functions. * array.c: include internal.h. * common.mk: update dependency for array.o. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_drop): Improve documentation. Patch by Caley Woods.drbrain2011-06-161-2/+2
| | | | | | | [Ruby 1.9 - Bug #4858] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sort_bang): fix rdoc.naruse2011-04-221-2/+2
| | | | | | patched by burningTyger. https://github.com/ruby/ruby/pull/11 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_join_1): fix array size.akr2011-02-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (array_join): copy the encoding of the first element asnaruse2011-02-151-4/+16
| | | | | | | | | | | | | | | an initial encoding. * array.c (array_join_0): ditto. * array.c (array_join_1): ditto. * array.c (inspect_ary): ditto. * array.c (array_join_1): add an argument to check the appending is first one or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (inspect_ary): don't taint the inspected result of anaruse2011-02-151-1/+1
| | | | | | recursive array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: documentation clarification in rotate, rotate!,kosaki2011-02-091-8/+8
| | | | | | | | index, and rindex. [ruby-core:35144] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Additional fix for r30736naruse2011-01-301-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_uniq_bang): call ARY_SET_LEN(ary, 0) beforenaruse2011-01-301-1/+4
| | | | | | | | | rb_resize_capa because rb_resize_capa expects resized length is smaller than current array length. call rb_ary_unshare before rb_resize_capa because rb_resize_capa losts the reference to original shared array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_join): [].join.encoding must be US-ASCII.naruse2011-01-291-1/+1
| | | | | | [ruby-list:47790] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_times): less MEMCPY calls.akr2011-01-171-3/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typoskazu2011-01-111-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_resize): should care of embeded array when extendingusa2011-01-111-1/+2
| | | | | | | | | | | the array. * array.c (rb_ary_resize): need to set capa when changing the real size of the array. these are latent bugs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_modify): export.nobu2011-01-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_resize): new utility function. [ruby-dev:42912]nobu2011-01-051-0/+45
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_dup): should copy contents only. no instancematz2010-12-091-14/+6
| | | | | | | | | | | | variable, no class would be copied. it would affect methods #sort, #reject, #transpose, #uniq, #compact, and #shuffle. [ruby-core:33640] * array.c (rb_ary_reverse_m): ditto. * array.c (rb_ary_rotate_m): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: parenthesize macro arguments.akr2010-12-011-24/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, gc.c, hash.c, object.c, string.c, struct.c,nobu2010-10-241-1/+1
| | | | | | | | transcode.c, variable.c, vm.c, vm_insnhelper.c, vm_method.c: replace calls to rb_error_frozen() with rb_check_frozen(). a patch from Run Paint Run Run at [ruby-core:32014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Commit miss.nobu2010-10-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_sprintf.rb: fix ML ref. [ruby-core:32848]nobu2010-10-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_and, rb_ary_or), class.c (rb_mod_init_copy),nobu2010-10-131-9/+10
| | | | | | | gc.c (undefine_final), time.c (time_mload): get rid of type-punning casts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_rotate_m): fix typo of rdoc.naruse2010-09-011-1/+1
| | | | | | patched by Andrei Kulakov [ruby-core:31975] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sample): removed unused variable.nobu2010-08-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_shuffle_bang): bail out from modification duringnobu2010-08-261-18/+46
| | | | | | | | shuffle. * array.c (rb_ary_sample): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_shuffle): rdoc fix. argument name was missing.nobu2010-08-261-1/+1
| | | | | | a patch from Run Paint Run Run at [ruby-core:31848]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_shuffle_bang): check number of argument.nobu2010-08-261-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_{shuffle_bang,sample}): use Random class object.nobu2010-08-251-2/+2
| | | | | | | | | * random.c (try_get_rnd): use default_rand for Random as same as singleton methods. * random.c (rb_random_real): check the range of result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* reverted to r29091; r29092 breaks test-allshyouhei2010-08-251-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_{shuffle_bang,sample}): use Random class object.nobu2010-08-251-2/+2
| | | | | | | * random.c (try_get_rnd): use default_rand for Random as same as singleton methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sample): use frozen shared array to get rid ofnobu2010-08-251-1/+1
| | | | | | reallocation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e