summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-16 04:08:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-16 04:08:52 +0000
commit16294913f71b8a38526096cf6458340b19b45f9f (patch)
tree7ea6d536085fb2ebeee6556ad66dbd2e7338559f /ext
parent745737e769cd882c533e39a24254dcbe54e44a37 (diff)
use rb_funcallv
* use rb_funcallv() for no arguments call instead of variadic rb_funcall(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/openssl/ossl_pkey.c6
-rw-r--r--ext/socket/socket.c2
-rw-r--r--ext/tk/tcltklib.c34
-rw-r--r--ext/tk/tkutil/tkutil.c48
4 files changed, 45 insertions, 45 deletions
diff --git a/ext/openssl/ossl_pkey.c b/ext/openssl/ossl_pkey.c
index aa9b046..f781677 100644
--- a/ext/openssl/ossl_pkey.c
+++ b/ext/openssl/ossl_pkey.c
@@ -199,7 +199,7 @@ GetPrivPKeyPtr(VALUE obj)
{
EVP_PKEY *pkey;
- if (rb_funcall(obj, id_private_q, 0, NULL) != Qtrue) {
+ if (rb_funcallv(obj, id_private_q, 0, NULL) != Qtrue) {
ossl_raise(rb_eArgError, "Private key is needed.");
}
SafeGetPKey(obj, pkey);
@@ -223,7 +223,7 @@ DupPrivPKeyPtr(VALUE obj)
{
EVP_PKEY *pkey;
- if (rb_funcall(obj, id_private_q, 0, NULL) != Qtrue) {
+ if (rb_funcallv(obj, id_private_q, 0, NULL) != Qtrue) {
ossl_raise(rb_eArgError, "Private key is needed.");
}
SafeGetPKey(obj, pkey);
@@ -290,7 +290,7 @@ ossl_pkey_sign(VALUE self, VALUE digest, VALUE data)
unsigned int buf_len;
VALUE str;
- if (rb_funcall(self, id_private_q, 0, NULL) != Qtrue) {
+ if (rb_funcallv(self, id_private_q, 0, NULL) != Qtrue) {
ossl_raise(rb_eArgError, "Private key is needed.");
}
GetPKey(self, pkey);
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index bbf50a5..eeee571 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -150,7 +150,7 @@ sock_initialize(int argc, VALUE *argv, VALUE sock)
static VALUE
io_call_close(VALUE io)
{
- return rb_funcall(io, rb_intern("close"), 0, 0);
+ return rb_funcallv(io, rb_intern("close"), 0, 0);
}
static VALUE
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index 4615907..4a1d3b8 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -1894,7 +1894,7 @@ set_max_block_time(self, time)
default:
{
- VALUE tmp = rb_funcall(time, ID_inspect, 0, 0);
+ VALUE tmp = rb_funcallv(time, ID_inspect, 0, 0);
rb_raise(rb_eArgError, "invalid value for time: '%s'",
StringValuePtr(tmp));
}
@@ -3109,7 +3109,7 @@ ip_set_exc_message(interp, exc)
thr_crit_bup = rb_thread_critical;
rb_thread_critical = Qtrue;
- msg = rb_funcall(exc, ID_message, 0, 0);
+ msg = rb_funcallv(exc, ID_message, 0, 0);
StringValue(msg);
#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION > 0)
@@ -3123,7 +3123,7 @@ ip_set_exc_message(interp, exc)
/* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(enc)); */
encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, RSTRING_PTR(enc));
} else {
- enc = rb_funcall(enc, ID_to_s, 0, 0);
+ enc = rb_funcallv(enc, ID_to_s, 0, 0);
/* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(enc)); */
encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, RSTRING_PTR(enc));
}
@@ -3176,11 +3176,11 @@ TkStringValue(obj)
default:
if (rb_respond_to(obj, ID_to_s)) {
- return rb_funcall(obj, ID_to_s, 0, 0);
+ return rb_funcallv(obj, ID_to_s, 0, 0);
}
}
- return rb_funcall(obj, ID_inspect, 0, 0);
+ return rb_funcallv(obj, ID_inspect, 0, 0);
}
static int
@@ -3298,7 +3298,7 @@ tcl_protect_core(interp, proc, data) /* should not raise exception */
rb_thread_critical = Qtrue;
DUMP1("set backtrace");
- if (!NIL_P(backtrace = rb_funcall(exc, ID_backtrace, 0, 0))) {
+ if (!NIL_P(backtrace = rb_funcallv(exc, ID_backtrace, 0, 0))) {
backtrace = rb_ary_join(backtrace, rb_str_new2("\n"));
Tcl_AddErrorInfo(interp, StringValuePtr(backtrace));
}
@@ -7245,7 +7245,7 @@ tk_funcall(func, argc, argv, obj)
DUMP1("raise exception");
/* rb_exc_raise(ret); */
rb_exc_raise(rb_exc_new3(rb_obj_class(ret),
- rb_funcall(ret, ID_to_s, 0, 0)));
+ rb_funcallv(ret, ID_to_s, 0, 0)));
}
DUMP1("exit tk_funcall");
@@ -7722,7 +7722,7 @@ ip_eval(self, str)
DUMP1("raise exception");
/* rb_exc_raise(ret); */
rb_exc_raise(rb_exc_new3(rb_obj_class(ret),
- rb_funcall(ret, ID_to_s, 0, 0)));
+ rb_funcallv(ret, ID_to_s, 0, 0)));
}
return ret;
@@ -7949,7 +7949,7 @@ lib_toUTF8_core(ip_obj, src, encodename)
volatile VALUE enc;
#ifdef HAVE_RUBY_ENCODING_H
- enc = rb_funcall(rb_obj_encoding(str), ID_to_s, 0, 0);
+ enc = rb_funcallv(rb_obj_encoding(str), ID_to_s, 0, 0);
#else
enc = rb_attr_get(str, ID_at_enc);
#endif
@@ -7962,7 +7962,7 @@ lib_toUTF8_core(ip_obj, src, encodename)
encoding = (Tcl_Encoding)NULL;
} else {
/* StringValue(enc); */
- enc = rb_funcall(enc, ID_to_s, 0, 0);
+ enc = rb_funcallv(enc, ID_to_s, 0, 0);
/* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(enc)); */
if (!RSTRING_LEN(enc)) {
encoding = (Tcl_Encoding)NULL;
@@ -8153,7 +8153,7 @@ lib_fromUTF8_core(ip_obj, src, encodename)
encoding = (Tcl_Encoding)NULL;
} else {
/* StringValue(enc); */
- enc = rb_funcall(enc, ID_to_s, 0, 0);
+ enc = rb_funcallv(enc, ID_to_s, 0, 0);
/* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(enc)); */
if (!RSTRING_LEN(enc)) {
encoding = (Tcl_Encoding)NULL;
@@ -8408,7 +8408,7 @@ lib_set_system_encoding(self, enc_name)
return lib_get_system_encoding(self);
}
- enc_name = rb_funcall(enc_name, ID_to_s, 0, 0);
+ enc_name = rb_funcallv(enc_name, ID_to_s, 0, 0);
if (Tcl_SetSystemEncoding((Tcl_Interp *)NULL,
StringValuePtr(enc_name)) != TCL_OK) {
rb_raise(rb_eArgError, "unknown encoding name '%s'",
@@ -9218,7 +9218,7 @@ ip_invoke_with_position(argc, argv, obj, position)
DUMP1("raise exception");
/* rb_exc_raise(ret); */
rb_exc_raise(rb_exc_new3(rb_obj_class(ret),
- rb_funcall(ret, ID_to_s, 0, 0)));
+ rb_funcallv(ret, ID_to_s, 0, 0)));
}
DUMP1("exit ip_invoke");
@@ -10187,7 +10187,7 @@ encoding_table_get_name_core(table, enc_arg, error_mode)
/* 1st: default encoding setting of interp */
if (ptr && NIL_P(enc)) {
if (rb_respond_to(interp, ID_encoding_name)) {
- enc = rb_funcall(interp, ID_encoding_name, 0, 0);
+ enc = rb_funcallv(interp, ID_encoding_name, 0, 0);
}
}
/* 2nd: Encoding.default_internal */
@@ -10230,7 +10230,7 @@ encoding_table_get_name_core(table, enc_arg, error_mode)
} else {
/* String or Symbol? */
- name = rb_funcall(enc, ID_to_s, 0, 0);
+ name = rb_funcallv(enc, ID_to_s, 0, 0);
if (!NIL_P(rb_hash_lookup(table, name))) {
/* find */
@@ -10264,7 +10264,7 @@ encoding_table_get_name_core(table, enc_arg, error_mode)
}
if (RTEST(error_mode)) {
- enc = rb_funcall(enc_arg, ID_to_s, 0, 0);
+ enc = rb_funcallv(enc_arg, ID_to_s, 0, 0);
rb_raise(rb_eArgError, "unsupported Tk encoding '%s'", RSTRING_PTR(enc));
}
return Qnil;
@@ -10342,7 +10342,7 @@ encoding_table_get_name_core(table, enc, error_mode)
{
volatile VALUE name = Qnil;
- enc = rb_funcall(enc, ID_to_s, 0, 0);
+ enc = rb_funcallv(enc, ID_to_s, 0, 0);
name = rb_hash_lookup(table, enc);
if (!NIL_P(name)) {
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c
index d2c447c..26ae957 100644
--- a/ext/tk/tkutil/tkutil.c
+++ b/ext/tk/tkutil/tkutil.c
@@ -172,7 +172,7 @@ tk_install_cmd_core(cmd)
volatile VALUE id_num;
id_num = ULONG2NUM(CALLBACK_ID_NUM++);
- id_num = rb_funcall(id_num, ID_to_s, 0, 0);
+ id_num = rb_funcallv(id_num, ID_to_s, 0, 0);
id_num = rb_str_append(rb_str_new2(cmd_id_prefix), id_num);
rb_hash_aset(CALLBACK_TABLE, id_num, cmd);
return rb_str_append(rb_str_new2(cmd_id_head), id_num);
@@ -269,7 +269,7 @@ to_strkey(key, value, hash)
VALUE value;
VALUE hash;
{
- rb_hash_aset(hash, rb_funcall(key, ID_to_s, 0, 0), value);
+ rb_hash_aset(hash, rb_funcallv(key, ID_to_s, 0, 0), value);
return ST_CHECK;
}
@@ -306,10 +306,10 @@ ary2list(ary, enc_flag, self)
volatile VALUE dst;
volatile VALUE sys_enc, dst_enc, str_enc;
- sys_enc = rb_funcall(cTclTkLib, ID_encoding, 0, 0);
+ sys_enc = rb_funcallv(cTclTkLib, ID_encoding, 0, 0);
if (NIL_P(sys_enc)) {
- sys_enc = rb_funcall(cTclTkLib, ID_encoding_system, 0, 0);
- sys_enc = rb_funcall(sys_enc, ID_to_s, 0, 0);
+ sys_enc = rb_funcallv(cTclTkLib, ID_encoding_system, 0, 0);
+ sys_enc = rb_funcallv(sys_enc, ID_to_s, 0, 0);
}
if (NIL_P(enc_flag)) {
@@ -319,7 +319,7 @@ ary2list(ary, enc_flag, self)
dst_enc = enc_flag;
req_chk_flag = 0;
} else {
- dst_enc = rb_funcall(enc_flag, ID_to_s, 0, 0);
+ dst_enc = rb_funcallv(enc_flag, ID_to_s, 0, 0);
req_chk_flag = 0;
}
@@ -345,7 +345,7 @@ ary2list(ary, enc_flag, self)
if (req_chk_flag) {
str_enc = rb_ivar_get(str_val, ID_at_enc);
if (!NIL_P(str_enc)) {
- str_enc = rb_funcall(str_enc, ID_to_s, 0, 0);
+ str_enc = rb_funcallv(str_enc, ID_to_s, 0, 0);
} else {
str_enc = sys_enc;
}
@@ -392,7 +392,7 @@ ary2list(ary, enc_flag, self)
if (req_chk_flag) {
str_enc = rb_ivar_get(str_val, ID_at_enc);
if (!NIL_P(str_enc)) {
- str_enc = rb_funcall(str_enc, ID_to_s, 0, 0);
+ str_enc = rb_funcallv(str_enc, ID_to_s, 0, 0);
} else {
str_enc = sys_enc;
}
@@ -412,7 +412,7 @@ ary2list(ary, enc_flag, self)
if (req_chk_flag) {
str_enc = rb_ivar_get(str_val, ID_at_enc);
if (!NIL_P(str_enc)) {
- str_enc = rb_funcall(str_enc, ID_to_s, 0, 0);
+ str_enc = rb_funcallv(str_enc, ID_to_s, 0, 0);
} else {
str_enc = sys_enc;
}
@@ -460,10 +460,10 @@ ary2list2(ary, enc_flag, self)
volatile VALUE dst;
volatile VALUE sys_enc, dst_enc, str_enc;
- sys_enc = rb_funcall(cTclTkLib, ID_encoding, 0, 0);
+ sys_enc = rb_funcallv(cTclTkLib, ID_encoding, 0, 0);
if (NIL_P(sys_enc)) {
- sys_enc = rb_funcall(cTclTkLib, ID_encoding_system, 0, 0);
- sys_enc = rb_funcall(sys_enc, ID_to_s, 0, 0);
+ sys_enc = rb_funcallv(cTclTkLib, ID_encoding_system, 0, 0);
+ sys_enc = rb_funcallv(sys_enc, ID_to_s, 0, 0);
}
if (NIL_P(enc_flag)) {
@@ -473,7 +473,7 @@ ary2list2(ary, enc_flag, self)
dst_enc = enc_flag;
req_chk_flag = 0;
} else {
- dst_enc = rb_funcall(enc_flag, ID_to_s, 0, 0);
+ dst_enc = rb_funcallv(enc_flag, ID_to_s, 0, 0);
req_chk_flag = 0;
}
@@ -507,7 +507,7 @@ ary2list2(ary, enc_flag, self)
if (req_chk_flag) {
str_enc = rb_ivar_get(str_val, ID_at_enc);
if (!NIL_P(str_enc)) {
- str_enc = rb_funcall(str_enc, ID_to_s, 0, 0);
+ str_enc = rb_funcallv(str_enc, ID_to_s, 0, 0);
} else {
str_enc = sys_enc;
}
@@ -546,7 +546,7 @@ static VALUE
key2keyname(key)
VALUE key;
{
- return rb_str_append(rb_str_new2("-"), rb_funcall(key, ID_to_s, 0, 0));
+ return rb_str_append(rb_str_new2("-"), rb_funcallv(key, ID_to_s, 0, 0));
}
static VALUE
@@ -817,7 +817,7 @@ get_eval_string_core(obj, enc_flag, self)
case T_FLOAT:
case T_FIXNUM:
case T_BIGNUM:
- return rb_funcall(obj, ID_to_s, 0, 0);
+ return rb_funcallv(obj, ID_to_s, 0, 0);
case T_STRING:
if (RTEST(enc_flag)) {
@@ -866,12 +866,12 @@ get_eval_string_core(obj, enc_flag, self)
return rb_str_new2("");
case T_REGEXP:
- return rb_funcall(obj, ID_source, 0, 0);
+ return rb_funcallv(obj, ID_source, 0, 0);
default:
if (rb_obj_is_kind_of(obj, cTkObject)) {
- /* return rb_str_new3(rb_funcall(obj, ID_path, 0, 0)); */
- return get_eval_string_core(rb_funcall(obj, ID_path, 0, 0),
+ /* return rb_str_new3(rb_funcallv(obj, ID_path, 0, 0)); */
+ return get_eval_string_core(rb_funcallv(obj, ID_path, 0, 0),
enc_flag, self);
}
@@ -888,15 +888,15 @@ get_eval_string_core(obj, enc_flag, self)
if (obj == TK_None) return Qnil;
if (rb_obj_respond_to(obj, ID_to_eval, Qtrue)) {
- /* return rb_funcall(obj, ID_to_eval, 0, 0); */
- return get_eval_string_core(rb_funcall(obj, ID_to_eval, 0, 0),
+ /* return rb_funcallv(obj, ID_to_eval, 0, 0); */
+ return get_eval_string_core(rb_funcallv(obj, ID_to_eval, 0, 0),
enc_flag, self);
} else if (rb_obj_respond_to(obj, ID_path, Qtrue)) {
- /* return rb_funcall(obj, ID_path, 0, 0); */
- return get_eval_string_core(rb_funcall(obj, ID_path, 0, 0),
+ /* return rb_funcallv(obj, ID_path, 0, 0); */
+ return get_eval_string_core(rb_funcallv(obj, ID_path, 0, 0),
enc_flag, self);
} else if (rb_obj_respond_to(obj, ID_to_s, Qtrue)) {
- return rb_funcall(obj, ID_to_s, 0, 0);
+ return rb_funcallv(obj, ID_to_s, 0, 0);
}
}