From a558933e3d7ed91b302c1b3399ec9d6dc6f688dc Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Wed, 26 Jan 2022 00:16:18 +0500 Subject: [PATCH] Ruby: convert IDs to VALUEs --- pkgs/ruby/ext/default/assert.c | 2 +- pkgs/ruby/ext/default/cmdline.c | 4 ++-- pkgs/ruby/ext/default/ntoa.c | 8 +++++--- pkgs/ruby/ext/default/printf.c | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/ruby/ext/default/assert.c b/pkgs/ruby/ext/default/assert.c index 5dc0c1f..c114230 100644 --- a/pkgs/ruby/ext/default/assert.c +++ b/pkgs/ruby/ext/default/assert.c @@ -13,7 +13,7 @@ static VALUE rb_KernAux = Qnil; void init_assert() { - rb_gc_register_mark_object(rb_intern_call = rb_intern("call")); + rb_gc_register_mark_object(ID2SYM(rb_intern_call = rb_intern("call"))); rb_gc_register_mark_object(rb_KernAux = rb_define_module("KernAux")); kernaux_assert_cb = assert_cb; diff --git a/pkgs/ruby/ext/default/cmdline.c b/pkgs/ruby/ext/default/cmdline.c index 6c42c57..0e85ad4 100644 --- a/pkgs/ruby/ext/default/cmdline.c +++ b/pkgs/ruby/ext/default/cmdline.c @@ -39,8 +39,8 @@ static VALUE rb_ANON_Data = Qnil; void init_cmdline() { - rb_gc_register_mark_object(rb_intern_freeze = rb_intern("freeze")); - rb_gc_register_mark_object(rb_intern_new = rb_intern("new")); + rb_gc_register_mark_object(ID2SYM(rb_intern_freeze = rb_intern("freeze"))); + rb_gc_register_mark_object(ID2SYM(rb_intern_new = rb_intern("new"))); rb_gc_register_mark_object(rb_KernAux = rb_define_module("KernAux")); rb_gc_register_mark_object(rb_KernAux_Error = diff --git a/pkgs/ruby/ext/default/ntoa.c b/pkgs/ruby/ext/default/ntoa.c index b73dd1c..adf42ae 100644 --- a/pkgs/ruby/ext/default/ntoa.c +++ b/pkgs/ruby/ext/default/ntoa.c @@ -16,13 +16,15 @@ static VALUE rb_KernAux_itoa16(VALUE self, VALUE number); static ID rb_intern_LESS = Qnil; static ID rb_intern_freeze = Qnil; + static VALUE rb_KernAux = Qnil; void init_ntoa() { - rb_gc_register_mark_object(rb_intern_LESS = rb_intern("<")); - rb_gc_register_mark_object(rb_intern_freeze = rb_intern("freeze")); - rb_gc_register_mark_object(rb_KernAux = rb_define_module("KernAux")); + rb_gc_register_mark_object(ID2SYM(rb_intern_LESS = rb_intern("<"))); + rb_gc_register_mark_object(ID2SYM(rb_intern_freeze = rb_intern("freeze"))); + + rb_gc_register_mark_object(rb_KernAux = rb_define_module("KernAux")); #ifdef HAVE_KERNAUX_UTOA10 rb_define_singleton_method(rb_KernAux, "utoa10", rb_KernAux_utoa10, 1); diff --git a/pkgs/ruby/ext/default/printf.c b/pkgs/ruby/ext/default/printf.c index 213914e..5a893bc 100644 --- a/pkgs/ruby/ext/default/printf.c +++ b/pkgs/ruby/ext/default/printf.c @@ -10,7 +10,7 @@ static VALUE rb_KernAux = Qnil; void init_printf() { - rb_gc_register_mark_object(rb_intern_freeze = rb_intern("freeze")); + rb_gc_register_mark_object(ID2SYM(rb_intern_freeze = rb_intern("freeze"))); rb_gc_register_mark_object(rb_KernAux = rb_define_module("KernAux")); rb_define_singleton_method(rb_KernAux, "snprintf1",