ruby-changes:18570
From: akr <ko1@a...>
Date: Tue, 18 Jan 2011 23:05:30 +0900 (JST)
Subject: [ruby-changes:18570] Ruby:r30593 (trunk): * gc.h: parenthesize macro arguments.
akr 2011-01-18 23:05:20 +0900 (Tue, 18 Jan 2011) New Revision: 30593 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30593 Log: * gc.h: parenthesize macro arguments. Modified files: trunk/ChangeLog trunk/gc.h Index: ChangeLog =================================================================== --- ChangeLog (revision 30592) +++ ChangeLog (revision 30593) @@ -1,3 +1,7 @@ +Tue Jan 18 23:04:51 2011 Tanaka Akira <akr@f...> + + * gc.h: parenthesize macro arguments. + Tue Jan 18 18:31:14 2011 Keiju Ishitsuka <keiju@i...> * lib/irb/comletion.rb: Irb tab completion support for XX::method forms. Index: gc.h =================================================================== --- gc.h (revision 30592) +++ gc.h (revision 30593) @@ -3,9 +3,9 @@ #define RUBY_GC_H 1 #if defined(__x86_64__) && defined(__GNUC__) -#define SET_MACHINE_STACK_END(p) __asm__("movq\t%%rsp, %0" : "=r" (*p)) +#define SET_MACHINE_STACK_END(p) __asm__("movq\t%%rsp, %0" : "=r" (*(p))) #elif defined(__i386) && defined(__GNUC__) -#define SET_MACHINE_STACK_END(p) __asm__("movl\t%%esp, %0" : "=r" (*p)) +#define SET_MACHINE_STACK_END(p) __asm__("movl\t%%esp, %0" : "=r" (*(p))) #else NOINLINE(void rb_gc_set_stack_end(VALUE **stack_end_p)); #define SET_MACHINE_STACK_END(p) rb_gc_set_stack_end(p) @@ -43,10 +43,10 @@ fflush(stdout); } -#define RUBY_MARK_ENTER(msg) rb_gc_debug_body("mark", msg, 1, ptr) -#define RUBY_MARK_LEAVE(msg) rb_gc_debug_body("mark", msg, 0, ptr) -#define RUBY_FREE_ENTER(msg) rb_gc_debug_body("free", msg, 1, ptr) -#define RUBY_FREE_LEAVE(msg) rb_gc_debug_body("free", msg, 0, ptr) +#define RUBY_MARK_ENTER(msg) rb_gc_debug_body("mark", (msg), 1, ptr) +#define RUBY_MARK_LEAVE(msg) rb_gc_debug_body("mark", (msg), 0, ptr) +#define RUBY_FREE_ENTER(msg) rb_gc_debug_body("free", (msg), 1, ptr) +#define RUBY_FREE_LEAVE(msg) rb_gc_debug_body("free", (msg), 0, ptr) #define RUBY_GC_INFO rb_gc_debug_indent(); printf #else @@ -61,9 +61,9 @@ #define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);} #if STACK_GROW_DIRECTION > 0 -# define STACK_UPPER(x, a, b) a +# define STACK_UPPER(x, a, b) (a) #elif STACK_GROW_DIRECTION < 0 -# define STACK_UPPER(x, a, b) b +# define STACK_UPPER(x, a, b) (b) #else RUBY_EXTERN int ruby_stack_grow_direction; int ruby_get_stack_grow_direction(volatile VALUE *addr); @@ -71,15 +71,15 @@ (ruby_stack_grow_direction ? \ ruby_stack_grow_direction : \ ruby_get_stack_grow_direction(x)) > 0) -# define STACK_UPPER(x, a, b) (stack_growup_p(x) ? a : b) +# define STACK_UPPER(x, a, b) (stack_growup_p(x) ? (a) : (b)) #endif #if STACK_GROW_DIRECTION #define STACK_GROW_DIR_DETECTION -#define STACK_DIR_UPPER(a,b) STACK_UPPER(0, a, b) +#define STACK_DIR_UPPER(a,b) STACK_UPPER(0, (a), (b)) #else #define STACK_GROW_DIR_DETECTION VALUE stack_grow_dir_detection -#define STACK_DIR_UPPER(a,b) STACK_UPPER(&stack_grow_dir_detection, a, b) +#define STACK_DIR_UPPER(a,b) STACK_UPPER(&stack_grow_dir_detection, (a), (b)) #endif #if defined __GNUC__ && __GNUC__ >= 4 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/