summaryrefslogtreecommitdiff
path: root/ext/-test-/num2int
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-01 21:49:55 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-01 21:49:55 +0000
commitd40335aa36a0acbe85dde987deaeac6eb0a27e40 (patch)
treee0ac7b76169d571da765e45652d413d2767e825f /ext/-test-/num2int
parent7d3db3cc8187e57ab8801051189f81cb8ff9d3c3 (diff)
* ext/-test-/num2int/num2int.c: Rename utility methods
to global functions to ease manual experiments. * test/-ext-/num2int/test_num2int.rb: Follow the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/-test-/num2int')
-rw-r--r--ext/-test-/num2int/num2int.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/ext/-test-/num2int/num2int.c b/ext/-test-/num2int/num2int.c
index a64082d..be4c265 100644
--- a/ext/-test-/num2int/num2int.c
+++ b/ext/-test-/num2int/num2int.c
@@ -109,28 +109,26 @@ test_fix2ulong(VALUE obj, VALUE num)
void
Init_num2int(void)
{
- VALUE cNum2int = rb_path2class("TestNum2int::Num2int");
+ rb_define_global_function("NUM2SHORT", test_num2short, 1);
+ rb_define_global_function("NUM2USHORT", test_num2ushort, 1);
- rb_define_singleton_method(cNum2int, "rb_num2short", test_num2short, 1);
- rb_define_singleton_method(cNum2int, "rb_num2ushort", test_num2ushort, 1);
+ rb_define_global_function("NUM2INT", test_num2int, 1);
+ rb_define_global_function("NUM2UINT", test_num2uint, 1);
- rb_define_singleton_method(cNum2int, "rb_num2int", test_num2int, 1);
- rb_define_singleton_method(cNum2int, "rb_num2uint", test_num2uint, 1);
-
- rb_define_singleton_method(cNum2int, "rb_num2long", test_num2long, 1);
- rb_define_singleton_method(cNum2int, "rb_num2ulong", test_num2ulong, 1);
+ rb_define_global_function("NUM2LONG", test_num2long, 1);
+ rb_define_global_function("NUM2ULONG", test_num2ulong, 1);
#ifdef HAVE_LONG_LONG
- rb_define_singleton_method(cNum2int, "rb_num2ll", test_num2ll, 1);
- rb_define_singleton_method(cNum2int, "rb_num2ull", test_num2ull, 1);
+ rb_define_global_function("NUM2LL", test_num2ll, 1);
+ rb_define_global_function("NUM2ULL", test_num2ull, 1);
#endif
- rb_define_singleton_method(cNum2int, "rb_fix2short", test_fix2short, 1);
+ rb_define_global_function("FIX2SHORT", test_fix2short, 1);
- rb_define_singleton_method(cNum2int, "rb_fix2int", test_fix2int, 1);
- rb_define_singleton_method(cNum2int, "rb_fix2uint", test_fix2uint, 1);
+ rb_define_global_function("FIX2INT", test_fix2int, 1);
+ rb_define_global_function("FIX2UINT", test_fix2uint, 1);
- rb_define_singleton_method(cNum2int, "rb_fix2long", test_fix2long, 1);
- rb_define_singleton_method(cNum2int, "rb_fix2ulong", test_fix2ulong, 1);
+ rb_define_global_function("FIX2LONG", test_fix2long, 1);
+ rb_define_global_function("FIX2ULONG", test_fix2ulong, 1);
}