summaryrefslogtreecommitdiff
path: root/ext/-test-/bignum/div.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-08 19:07:16 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-09 22:38:06 +0900
commit590dc06e3840cc7b00d80ccaac9fbf42573428f8 (patch)
treee5f6aa316246401b8d89e7419ddf0976238c04b5 /ext/-test-/bignum/div.c
parent161a20df28dd09ff35a32a7e2b7ce6cab7079707 (diff)
Get rid of defining methods for tests in core classes
Not to interfere in other tests.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4043
Diffstat (limited to 'ext/-test-/bignum/div.c')
-rw-r--r--ext/-test-/bignum/div.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/-test-/bignum/div.c b/ext/-test-/bignum/div.c
index 2be0d2d..85ee067 100644
--- a/ext/-test-/bignum/div.c
+++ b/ext/-test-/bignum/div.c
@@ -12,14 +12,14 @@ big(VALUE x)
}
static VALUE
-divrem_normal(VALUE x, VALUE y)
+divrem_normal(VALUE klass, VALUE x, VALUE y)
{
return rb_big_norm(rb_big_divrem_normal(big(x), big(y)));
}
#if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H)
static VALUE
-divrem_gmp(VALUE x, VALUE y)
+divrem_gmp(VALUE klass, VALUE x, VALUE y)
{
return rb_big_norm(rb_big_divrem_gmp(big(x), big(y)));
}
@@ -30,6 +30,6 @@ divrem_gmp(VALUE x, VALUE y)
void
Init_div(VALUE klass)
{
- rb_define_method(rb_cInteger, "big_divrem_normal", divrem_normal, 1);
- rb_define_method(rb_cInteger, "big_divrem_gmp", divrem_gmp, 1);
+ rb_define_singleton_method(klass, "big_divrem_normal", divrem_normal, 2);
+ rb_define_singleton_method(klass, "big_divrem_gmp", divrem_gmp, 2);
}