summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-29 11:57:14 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-29 11:57:14 (GMT)
commitc463366dfd75056885028a95e8e2fc6e135d9194 (patch)
tree684f70d3ecfe562d0a3c48d29c69309f7ac92748 /random.c
parent26de0b131e57952d29664de4453e2f04ec3df2bc (diff)
rb_funcallv
* *.c: rename rb_funcall2 to rb_funcallv, except for extensions which are/will be/may be gems. [Fix GH-1406] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/random.c b/random.c
index bc6474f..ee91c53 100644
--- a/random.c
+++ b/random.c
@@ -957,7 +957,7 @@ rb_random_real(VALUE obj)
{
rb_random_t *rnd = try_get_rnd(obj);
if (!rnd) {
- VALUE v = rb_funcall2(obj, id_rand, 0, 0);
+ VALUE v = rb_funcallv(obj, id_rand, 0, 0);
double d = NUM2DBL(v);
if (d < 0.0) {
rb_raise(rb_eRangeError, "random number too small %g", d);
@@ -1018,7 +1018,7 @@ rb_random_ulong_limited(VALUE obj, unsigned long limit)
rb_random_t *rnd = try_get_rnd(obj);
if (!rnd) {
VALUE lim = ulong_to_num_plus_1(limit);
- VALUE v = rb_to_int(rb_funcall2(obj, id_rand, 1, &lim));
+ VALUE v = rb_to_int(rb_funcallv(obj, id_rand, 1, &lim));
unsigned long r = NUM2ULONG(v);
if (rb_num_negative_p(v)) {
rb_raise(rb_eRangeError, "random number too small %ld", r);
@@ -1121,7 +1121,7 @@ range_values(VALUE vmax, VALUE *begp, VALUE *endp, int *exclp)
if (!rb_range_values(vmax, begp, &end, exclp)) return Qfalse;
if (endp) *endp = end;
if (!rb_respond_to(end, id_minus)) return Qfalse;
- r = rb_funcall2(end, id_minus, 1, begp);
+ r = rb_funcallv(end, id_minus, 1, begp);
if (NIL_P(r)) return Qfalse;
return r;
}
@@ -1270,7 +1270,7 @@ rand_range(VALUE obj, rb_random_t* rnd, VALUE range)
}
}
default:
- return rb_funcall2(beg, id_plus, 1, &v);
+ return rb_funcallv(beg, id_plus, 1, &v);
}
return v;