summaryrefslogtreecommitdiff
path: root/ext/-test-/symbol
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-12 02:48:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-12 02:48:28 +0000
commit01134984ef51c4dfc7aebf4f3a371de9c8ddcce5 (patch)
treecf539c309beca91d4065fc5c546a3b9225595fc0 /ext/-test-/symbol
parent6d0f7c3c7d2476d99d57d988162c6cb897e243d3 (diff)
symbol/init.c: ID value
* ext/-test-/symbol/init.c (sym_pinneddown_p): return ID value or nil for debugging. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/-test-/symbol')
-rw-r--r--ext/-test-/symbol/init.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/-test-/symbol/init.c b/ext/-test-/symbol/init.c
index 9e42e1a..20cf2fa 100644
--- a/ext/-test-/symbol/init.c
+++ b/ext/-test-/symbol/init.c
@@ -11,7 +11,13 @@ sym_find(VALUE dummy, VALUE sym)
static VALUE
sym_pinneddown_p(VALUE dummy, VALUE sym)
{
- return rb_check_id(&sym) ? Qtrue : Qfalse;
+ ID id = rb_check_id(&sym);
+ if (!id) return Qnil;
+#ifdef ULL2NUM
+ return ULL2NUM(id);
+#else
+ return ULONG2NUM(id);
+#endif
}
void