diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-08-29 11:47:20 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-08-29 18:34:09 +0900 |
commit | 3df37259d81d9fc71f8b4f0b8d45dc9d0af81ab4 (patch) | |
tree | 961d975a0191b8385417c8107149a9610aa1f6dc /ext | |
parent | bfe5d22f89a871b6c1cb556c0115145ade9fe286 (diff) | |
download | ruby-3df37259d81d9fc71f8b4f0b8d45dc9d0af81ab4.tar.gz |
drop-in type check for rb_define_singleton_method
We can check the function pointer passed to
rb_define_singleton_method like how we do so in rb_define_method.
Doing so revealed many arity mismatches.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/readline/readline.c | 10 | ||||
-rw-r--r-- | ext/socket/basicsocket.c | 2 | ||||
-rw-r--r-- | ext/socket/socket.c | 10 |
3 files changed, 11 insertions, 11 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c index ad0bd4e0c0..b686f99645 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -1382,7 +1382,7 @@ readline_s_set_basic_word_break_characters(VALUE self, VALUE str) * Raises NotImplementedError if the using readline library does not support. */ static VALUE -readline_s_get_basic_word_break_characters(VALUE self, VALUE str) +readline_s_get_basic_word_break_characters(VALUE self) { if (rl_basic_word_break_characters == NULL) return Qnil; @@ -1437,7 +1437,7 @@ readline_s_set_completer_word_break_characters(VALUE self, VALUE str) * Raises NotImplementedError if the using readline library does not support. */ static VALUE -readline_s_get_completer_word_break_characters(VALUE self, VALUE str) +readline_s_get_completer_word_break_characters(VALUE self) { if (rl_completer_word_break_characters == NULL) return Qnil; @@ -1552,7 +1552,7 @@ readline_s_set_basic_quote_characters(VALUE self, VALUE str) * Raises NotImplementedError if the using readline library does not support. */ static VALUE -readline_s_get_basic_quote_characters(VALUE self, VALUE str) +readline_s_get_basic_quote_characters(VALUE self) { if (rl_basic_quote_characters == NULL) return Qnil; @@ -1608,7 +1608,7 @@ readline_s_set_completer_quote_characters(VALUE self, VALUE str) * Raises NotImplementedError if the using readline library does not support. */ static VALUE -readline_s_get_completer_quote_characters(VALUE self, VALUE str) +readline_s_get_completer_quote_characters(VALUE self) { if (rl_completer_quote_characters == NULL) return Qnil; @@ -1662,7 +1662,7 @@ readline_s_set_filename_quote_characters(VALUE self, VALUE str) * Raises NotImplementedError if the using readline library does not support. */ static VALUE -readline_s_get_filename_quote_characters(VALUE self, VALUE str) +readline_s_get_filename_quote_characters(VALUE self) { if (rl_filename_quote_characters == NULL) return Qnil; diff --git a/ext/socket/basicsocket.c b/ext/socket/basicsocket.c index 1371672850..fb5beed81a 100644 --- a/ext/socket/basicsocket.c +++ b/ext/socket/basicsocket.c @@ -672,7 +672,7 @@ bsock_recv_nonblock(VALUE sock, VALUE len, VALUE flg, VALUE str, VALUE ex) * BasicSocket.do_not_reverse_lookup #=> false */ static VALUE -bsock_do_not_rev_lookup(void) +bsock_do_not_rev_lookup(VALUE _) { return rsock_do_not_reverse_lookup?Qtrue:Qfalse; } diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 0059595e1b..f1017910ce 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -1042,7 +1042,7 @@ sock_s_gethostbyname(VALUE obj, VALUE host) * */ static VALUE -sock_s_gethostbyaddr(int argc, VALUE *argv) +sock_s_gethostbyaddr(int argc, VALUE *argv, VALUE _) { VALUE addr, family; struct hostent *h; @@ -1104,7 +1104,7 @@ sock_s_gethostbyaddr(int argc, VALUE *argv) * Socket.getservbyname("syslog", "udp") #=> 514 */ static VALUE -sock_s_getservbyname(int argc, VALUE *argv) +sock_s_getservbyname(int argc, VALUE *argv, VALUE _) { VALUE service, proto; struct servent *sp; @@ -1145,7 +1145,7 @@ sock_s_getservbyname(int argc, VALUE *argv) * */ static VALUE -sock_s_getservbyport(int argc, VALUE *argv) +sock_s_getservbyport(int argc, VALUE *argv, VALUE _) { VALUE port, proto; struct servent *sp; @@ -1203,7 +1203,7 @@ sock_s_getservbyport(int argc, VALUE *argv) * If Addrinfo object is preferred, use Addrinfo.getaddrinfo. */ static VALUE -sock_s_getaddrinfo(int argc, VALUE *argv) +sock_s_getaddrinfo(int argc, VALUE *argv, VALUE _) { VALUE host, port, family, socktype, protocol, flags, ret, revlookup; struct addrinfo hints; @@ -1257,7 +1257,7 @@ sock_s_getaddrinfo(int argc, VALUE *argv) * If Addrinfo object is preferred, use Addrinfo#getnameinfo. */ static VALUE -sock_s_getnameinfo(int argc, VALUE *argv) +sock_s_getnameinfo(int argc, VALUE *argv, VALUE _) { VALUE sa, af = Qnil, host = Qnil, port = Qnil, flags, tmp; char *hptr, *pptr; |