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

ruby-changes:41814

From: nobu <ko1@a...>
Date: Mon, 22 Feb 2016 16:15:23 +0900 (JST)
Subject: [ruby-changes:41814] nobu:r53888 (trunk): vm_core.h: CoreDataFromValue

nobu	2016-02-22 16:15:57 +0900 (Mon, 22 Feb 2016)

  New Revision: 53888

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

  Log:
    vm_core.h: CoreDataFromValue
    
    * vm_core.h (CoreDataFromValue): split as an expression from
      GetCoreDataFromValue, which can be a statement only.

  Modified files:
    trunk/vm_core.h
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 53887)
+++ vm_core.h	(revision 53888)
@@ -250,12 +250,11 @@ struct rb_call_cache { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L250
 };
 
 #if 1
-#define GetCoreDataFromValue(obj, type, ptr) do { \
-    (ptr) = (type*)DATA_PTR(obj); \
-} while (0)
+#define CoreDataFromValue(obj, type) (type*)DATA_PTR(obj)
 #else
-#define GetCoreDataFromValue(obj, type, ptr) Data_Get_Struct((obj), type, (ptr))
+#define CoreDataFromValue(obj, type) (type*)rb_data_object_get(obj)
 #endif
+#define GetCoreDataFromValue(obj, type, ptr) ((ptr) = CoreDataFromValue((obj), type))
 
 typedef struct rb_iseq_location_struct {
     VALUE path;

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

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