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

ruby-changes:18567

From: akr <ko1@a...>
Date: Tue, 18 Jan 2011 07:54:38 +0900 (JST)
Subject: [ruby-changes:18567] Ruby:r30590 (trunk): * eval_intern.h: parenthesize macro arguments.

akr	2011-01-18 07:54:29 +0900 (Tue, 18 Jan 2011)

  New Revision: 30590

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

  Log:
    * eval_intern.h: parenthesize macro arguments.

  Modified files:
    trunk/ChangeLog
    trunk/eval_intern.h

Index: eval_intern.h
===================================================================
--- eval_intern.h	(revision 30589)
+++ eval_intern.h	(revision 30590)
@@ -65,7 +65,7 @@
 #endif
 
 #define ruby_setjmp(env) RUBY_SETJMP(env)
-#define ruby_longjmp(env,val) RUBY_LONGJMP(env,val)
+#define ruby_longjmp(env,val) RUBY_LONGJMP((env),(val))
 #ifdef __CYGWIN__
 # ifndef _setjmp
 int _setjmp(jmp_buf);
@@ -90,7 +90,7 @@
   So following definition is required to use select_large_fdset.
 */
 #ifdef HAVE_SELECT_LARGE_FDSET
-#define select(n, r, w, e, t) select_large_fdset(n, r, w, e, t)
+#define select(n, r, w, e, t) select_large_fdset((n), (r), (w), (e), (t))
 #endif
 
 #ifdef HAVE_SYS_PARAM_H
@@ -108,7 +108,7 @@
   } while (0)
 
 #define TH_PUSH_TAG(th) do { \
-  rb_thread_t * const _th = th; \
+  rb_thread_t * const _th = (th); \
   struct rb_vm_tag _tag; \
   _tag.tag = 0; \
   _tag.prev = _th->tag; \
@@ -130,10 +130,10 @@
   TH_EXEC_TAG()
 
 #define TH_JUMP_TAG(th, st) do { \
-  ruby_longjmp(th->tag->buf,(st)); \
+  ruby_longjmp((th)->tag->buf,(st)); \
 } while (0)
 
-#define JUMP_TAG(st) TH_JUMP_TAG(GET_THREAD(), st)
+#define JUMP_TAG(st) TH_JUMP_TAG(GET_THREAD(), (st))
 
 enum ruby_tag_type {
     RUBY_TAG_RETURN	= 0x1,
@@ -172,7 +172,7 @@
 #define SCOPE_SET(f)   (rb_vm_cref()->nd_visi = (f))
 
 #define CHECK_STACK_OVERFLOW(cfp, margin) do \
-  if ((VALUE *)((char *)(((VALUE *)(cfp)->sp) + (margin)) + sizeof(rb_control_frame_t)) >= ((VALUE *)cfp)) { \
+  if ((VALUE *)((char *)(((VALUE *)(cfp)->sp) + (margin)) + sizeof(rb_control_frame_t)) >= ((VALUE *)(cfp))) { \
       rb_exc_raise(sysstack_error); \
   } \
 while (0)
@@ -213,7 +213,7 @@
 void rb_trap_restore_mask(void);
 
 #ifndef CharNext		/* defined as CharNext[AW] on Windows. */
-#define CharNext(p) ((p) + mblen(p, RUBY_MBCHAR_MAXSIZE))
+#define CharNext(p) ((p) + mblen((p), RUBY_MBCHAR_MAXSIZE))
 #endif
 
 #if defined DOSISH || defined __CYGWIN__
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30589)
+++ ChangeLog	(revision 30590)
@@ -1,3 +1,7 @@
+Tue Jan 18 07:53:52 2011  Tanaka Akira  <akr@f...>
+
+	* eval_intern.h: parenthesize macro arguments.
+
 Tue Jan 18 06:49:38 2011  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/rubygems/source_index.rb (Gem#load_specification): read in

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

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