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

ruby-changes:36389

From: nobu <ko1@a...>
Date: Tue, 18 Nov 2014 03:20:41 +0900 (JST)
Subject: [ruby-changes:36389] nobu:r48470 (trunk): symbol.c: symbol type predicate functions

nobu	2014-11-18 03:20:22 +0900 (Tue, 18 Nov 2014)

  New Revision: 48470

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

  Log:
    symbol.c: symbol type predicate functions
    
    * symbol.h (is_{local,global,instance,attrset,const,class,junk}_sym):
      fix ID type names.

  Modified files:
    trunk/ChangeLog
    trunk/internal.h
    trunk/symbol.c
    trunk/symbol.h
Index: symbol.c
===================================================================
--- symbol.c	(revision 48469)
+++ symbol.c	(revision 48470)
@@ -889,6 +889,48 @@ rb_is_junk_id(ID id) https://github.com/ruby/ruby/blob/trunk/symbol.c#L889
     return is_junk_id(id);
 }
 
+int
+rb_is_const_sym(VALUE sym)
+{
+    return is_const_sym(sym);
+}
+
+int
+rb_is_class_sym(VALUE sym)
+{
+    return is_class_sym(sym);
+}
+
+int
+rb_is_global_sym(VALUE sym)
+{
+    return is_global_sym(sym);
+}
+
+int
+rb_is_instance_sym(VALUE sym)
+{
+    return is_instance_sym(sym);
+}
+
+int
+rb_is_attrset_sym(VALUE sym)
+{
+    return is_attrset_sym(sym);
+}
+
+int
+rb_is_local_sym(VALUE sym)
+{
+    return is_local_sym(sym);
+}
+
+int
+rb_is_junk_sym(VALUE sym)
+{
+    return is_junk_sym(sym);
+}
+
 /**
  * Returns ID for the given name if it is interned already, or 0.
  *
Index: symbol.h
===================================================================
--- symbol.h	(revision 48469)
+++ symbol.h	(revision 48470)
@@ -65,13 +65,13 @@ sym_type(VALUE sym) https://github.com/ruby/ruby/blob/trunk/symbol.h#L65
     return (int)(id&ID_SCOPE_MASK);
 }
 
-#define is_local_sym(sym) (sym_type(sym)==SYM_LOCAL)
-#define is_global_sym(sym) (sym_type(sym)==SYM_GLOBAL)
-#define is_instance_sym(sym) (sym_type(sym)==SYM_INSTANCE)
-#define is_attrset_sym(sym) (sym_type(sym)==SYM_ATTRSET)
-#define is_const_sym(sym) (sym_type(sym)==SYM_CONST)
-#define is_class_sym(sym) (sym_type(sym)==SYM_CLASS)
-#define is_junk_sym(sym) (sym_type(sym)==SYM_JUNK)
+#define is_local_sym(sym) (sym_type(sym)==ID_LOCAL)
+#define is_global_sym(sym) (sym_type(sym)==ID_GLOBAL)
+#define is_instance_sym(sym) (sym_type(sym)==ID_INSTANCE)
+#define is_attrset_sym(sym) (sym_type(sym)==ID_ATTRSET)
+#define is_const_sym(sym) (sym_type(sym)==ID_CONST)
+#define is_class_sym(sym) (sym_type(sym)==ID_CLASS)
+#define is_junk_sym(sym) (sym_type(sym)==ID_JUNK)
 
 RUBY_FUNC_EXPORTED const unsigned int ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32];
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48469)
+++ ChangeLog	(revision 48470)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Nov 18 03:20:19 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* symbol.h (is_{local,global,instance,attrset,const,class,junk}_sym):
+	  fix ID type names.
+
 Mon Nov 17 20:17:59 2014  Masaki Suketa <masaki.suketa@n...>
 
 	* ext/win32ole/win32ole_event.c: use typed data.
Index: internal.h
===================================================================
--- internal.h	(revision 48469)
+++ internal.h	(revision 48470)
@@ -827,6 +827,14 @@ int rb_is_attrset_name(VALUE name); https://github.com/ruby/ruby/blob/trunk/internal.h#L827
 int rb_is_local_name(VALUE name);
 int rb_is_method_name(VALUE name);
 int rb_is_junk_name(VALUE name);
+int rb_is_const_sym(VALUE sym);
+int rb_is_class_sym(VALUE sym);
+int rb_is_global_sym(VALUE sym);
+int rb_is_instance_sym(VALUE sym);
+int rb_is_attrset_sym(VALUE sym);
+int rb_is_local_sym(VALUE sym);
+int rb_is_method_sym(VALUE sym);
+int rb_is_junk_sym(VALUE sym);
 ID rb_make_internal_id(void);
 void rb_gc_free_dsymbol(VALUE);
 ID rb_id_attrget(ID id);

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

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