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

ruby-changes:27809

From: nobu <ko1@a...>
Date: Thu, 21 Mar 2013 23:16:11 +0900 (JST)
Subject: [ruby-changes:27809] nobu:r39861 (trunk): ruby.h: RB_UNUSED_VAR from UNINITIALIZED_VAR

nobu	2013-03-21 23:14:19 +0900 (Thu, 21 Mar 2013)

  New Revision: 39861

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

  Log:
    ruby.h: RB_UNUSED_VAR from UNINITIALIZED_VAR
    
    * include/ruby/ruby.h (RB_UNUSED_VAR): move code from
      UNINITIALIZED_VAR() in vm_core.h.
    * vm_core.h (UNINITIALIZED_VAR): use RB_UNUSED_VAR().

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/ruby.h
    trunk/vm_core.h

Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 39860)
+++ include/ruby/ruby.h	(revision 39861)
@@ -529,8 +529,10 @@ static inline volatile VALUE *rb_gc_guar https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L529
 #endif
 #define RB_GC_GUARD(v) (*RB_GC_GUARD_PTR(&(v)))
 
-#ifdef __GNUC__
-#define RB_UNUSED_VAR(x) x __attribute__ ((unused)) 
+#if (defined(__clang__) && (__clang_major__ == 4 && __clang_minor__ == 2))
+#define RB_UNUSED_VAR(x) x __attribute__ ((unused))
+#elif defined(__GNUC__) && __GNUC__ >= 3
+#define RB_UNUSED_VAR(x) x = x
 #else
 #define RB_UNUSED_VAR(x) x
 #endif
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39860)
+++ ChangeLog	(revision 39861)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Mar 21 23:14:15 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* include/ruby/ruby.h (RB_UNUSED_VAR): move code from
+	  UNINITIALIZED_VAR() in vm_core.h.
+
+	* vm_core.h (UNINITIALIZED_VAR): use RB_UNUSED_VAR().
+
 Thu Mar 21 22:39:46 2013  Naohisa Goto  <ngotogenome@g...>
 
 	* marshal.c (marshal_dump, marshal_load): workaround for segv on
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 39860)
+++ vm_core.h	(revision 39861)
@@ -115,13 +115,7 @@ https://github.com/ruby/ruby/blob/trunk/vm_core.h#L115
 #define UNLIKELY(x) (x)
 #endif /* __GNUC__ >= 3 */
 
-#if (defined(__clang__) && (__clang_major__ == 4 && __clang_minor__ == 2))
-#define UNINITIALIZED_VAR(x) x __attribute__((unused))
-#elif defined(__GNUC__) && __GNUC__ >= 3
-#define UNINITIALIZED_VAR(x) x = x
-#else
-#define UNINITIALIZED_VAR(x) x
-#endif
+#define UNINITIALIZED_VAR(x) RB_UNUSED_VAR(x)
 
 typedef unsigned long rb_num_t;
 

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

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