summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-08-28 18:19:11 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-08-29 18:34:09 +0900
commit7bcfd9189a6a0b2ad58fed988faaf795a4987893 (patch)
tree219f0c172e038ea6be1e103db11f7457dc703328 /ruby.c
parent7b6fde4258e700c0e0292bb091aa84a5e473342e (diff)
drop-in type check for rb_define_global_function
We can check the function pointer passed to rb_define_global_function like we do so in rb_define_method. It turns out that almost anybody is misunderstanding the API.
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ruby.c b/ruby.c
index 57c95fa..32fcecf 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1484,7 +1484,7 @@ uscore_get(void)
*/
static VALUE
-rb_f_sub(int argc, VALUE *argv)
+rb_f_sub(int argc, VALUE *argv, VALUE _)
{
VALUE str = rb_funcall_passing_block(uscore_get(), rb_intern("sub"), argc, argv);
rb_lastline_set(str);
@@ -1503,7 +1503,7 @@ rb_f_sub(int argc, VALUE *argv)
*/
static VALUE
-rb_f_gsub(int argc, VALUE *argv)
+rb_f_gsub(int argc, VALUE *argv, VALUE _)
{
VALUE str = rb_funcall_passing_block(uscore_get(), rb_intern("gsub"), argc, argv);
rb_lastline_set(str);
@@ -1521,7 +1521,7 @@ rb_f_gsub(int argc, VALUE *argv)
*/
static VALUE
-rb_f_chop(void)
+rb_f_chop(VALUE _)
{
VALUE str = rb_funcall_passing_block(uscore_get(), rb_intern("chop"), 0, 0);
rb_lastline_set(str);
@@ -1541,7 +1541,7 @@ rb_f_chop(void)
*/
static VALUE
-rb_f_chomp(int argc, VALUE *argv)
+rb_f_chomp(int argc, VALUE *argv, VALUE _)
{
VALUE str = rb_funcall_passing_block(uscore_get(), rb_intern("chomp"), argc, argv);
rb_lastline_set(str);