[前][次][番号順一覧][スレッド一覧]

ruby-changes:45532

From: nobu <ko1@a...>
Date: Sun, 12 Feb 2017 11:48:35 +0900 (JST)
Subject: [ruby-changes:45532] nobu:r57605 (trunk): symbol/init.c: ID value

nobu	2017-02-12 11:48:28 +0900 (Sun, 12 Feb 2017)

  New Revision: 57605

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57605

  Log:
    symbol/init.c: ID value
    
    * ext/-test-/symbol/init.c (sym_pinneddown_p): return ID value or
      nil for debugging.

  Modified files:
    trunk/ext/-test-/symbol/init.c
Index: ext/-test-/symbol/init.c
===================================================================
--- ext/-test-/symbol/init.c	(revision 57604)
+++ ext/-test-/symbol/init.c	(revision 57605)
@@ -11,7 +11,13 @@ sym_find(VALUE dummy, VALUE sym) https://github.com/ruby/ruby/blob/trunk/ext/-test-/symbol/init.c#L11
 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]