mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* random.c (random_load): use RARRAY_RAWPTR() instead of
RARRAY_PTR() because there is no new reference. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7a23eb1c41
commit
8741a39777
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Wed Aug 7 13:20:12 2013 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* random.c (random_load): use RARRAY_RAWPTR() instead of
|
||||||
|
RARRAY_PTR() because there is no new reference.
|
||||||
|
|
||||||
Wed Aug 7 12:58:23 2013 Koichi Sasada <ko1@atdot.net>
|
Wed Aug 7 12:58:23 2013 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* thread.c (thread_start_func_2): use RARRAY_RAWPTR() instead of
|
* thread.c (thread_start_func_2): use RARRAY_RAWPTR() instead of
|
||||||
|
|
4
random.c
4
random.c
|
@ -627,12 +627,12 @@ random_load(VALUE obj, VALUE dump)
|
||||||
rb_random_t *rnd = get_rnd(obj);
|
rb_random_t *rnd = get_rnd(obj);
|
||||||
struct MT *mt = &rnd->mt;
|
struct MT *mt = &rnd->mt;
|
||||||
VALUE state, left = INT2FIX(1), seed = INT2FIX(0);
|
VALUE state, left = INT2FIX(1), seed = INT2FIX(0);
|
||||||
VALUE *ary;
|
const VALUE *ary;
|
||||||
unsigned long x;
|
unsigned long x;
|
||||||
|
|
||||||
rb_check_copyable(obj, dump);
|
rb_check_copyable(obj, dump);
|
||||||
Check_Type(dump, T_ARRAY);
|
Check_Type(dump, T_ARRAY);
|
||||||
ary = RARRAY_PTR(dump);
|
ary = RARRAY_RAWPTR(dump);
|
||||||
switch (RARRAY_LEN(dump)) {
|
switch (RARRAY_LEN(dump)) {
|
||||||
case 3:
|
case 3:
|
||||||
seed = ary[2];
|
seed = ary[2];
|
||||||
|
|
Loading…
Reference in a new issue