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

ruby-changes:34976

From: nobu <ko1@a...>
Date: Mon, 4 Aug 2014 10:05:17 +0900 (JST)
Subject: [ruby-changes:34976] nobu:r47058 (trunk): symbol.c: move macros

nobu	2014-08-04 10:05:09 +0900 (Mon, 04 Aug 2014)

  New Revision: 47058

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

  Log:
    symbol.c: move macros
    
    * symbol.c (SYMBOL_PINNED, SYMBOL_PINNED_P, ID_DYNAMIC_SYM_P),
      (STATIC_SYM2ID, STATIC_ID2SYM): move from symbol.h as these
      macros are used only in symbol.c.

  Modified files:
    trunk/symbol.c
    trunk/symbol.h
Index: symbol.c
===================================================================
--- symbol.c	(revision 47057)
+++ symbol.c	(revision 47058)
@@ -18,6 +18,13 @@ https://github.com/ruby/ruby/blob/trunk/symbol.c#L18
 #include "gc.h"
 #include "probes.h"
 
+#define SYMBOL_PINNED        FL_USER1
+#define SYMBOL_PINNED_P(sym) FL_TEST((sym), SYMBOL_PINNED)
+
+#define ID_DYNAMIC_SYM_P(id) (!(id&ID_STATIC_SYM)&&id>tLAST_OP_ID)
+#define STATIC_SYM2ID(sym) RSHIFT((unsigned long)(sym), RUBY_SPECIAL_SHIFT)
+#define STATIC_ID2SYM(id)  (((VALUE)(id)<<RUBY_SPECIAL_SHIFT)|SYMBOL_FLAG)
+
 static ID register_static_symid(ID, const char *, long, rb_encoding *);
 static ID register_static_symid_str(ID, VALUE);
 #define REGISTER_SYMID(id, name) register_static_symid((id), (name), strlen(name), enc)
Index: symbol.h
===================================================================
--- symbol.h	(revision 47057)
+++ symbol.h	(revision 47058)
@@ -15,12 +15,6 @@ https://github.com/ruby/ruby/blob/trunk/symbol.h#L15
 #include "id.h"
 
 #define RSYMBOL(obj) (R_CAST(RSymbol)(obj))
-#define SYMBOL_PINNED        FL_USER1
-#define SYMBOL_PINNED_P(sym) FL_TEST((sym), SYMBOL_PINNED)
-
-#define ID_DYNAMIC_SYM_P(id) (!(id&ID_STATIC_SYM)&&id>tLAST_OP_ID)
-#define STATIC_SYM2ID(sym) RSHIFT((unsigned long)(sym), RUBY_SPECIAL_SHIFT)
-#define STATIC_ID2SYM(id)  (((VALUE)(id)<<RUBY_SPECIAL_SHIFT)|SYMBOL_FLAG)
 
 static inline int
 id_type(ID id)

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

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