From c36ad781ef177e1d3e44b662951dc6b399438e0d Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 8 Jan 2011 10:29:15 +0000 Subject: [PATCH] * thread.c: parenthesize macro arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ thread.c | 18 +++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 50c26c33dd..596eafa775 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Jan 8 19:28:55 2011 Tanaka Akira + + * thread.c: parenthesize macro arguments. + Fri Jan 7 23:07:40 2011 Nobuyoshi Nakada * lib/mkmf.rb (configuration): backref needs to capture. diff --git a/thread.c b/thread.c index 9173833f2f..69fc299fcd 100644 --- a/thread.c +++ b/thread.c @@ -131,7 +131,7 @@ static inline void blocking_region_end(rb_thread_t *th, struct rb_blocking_regio #define BLOCKING_REGION(exec, ubf, ubfarg) do { \ rb_thread_t *__th = GET_THREAD(); \ struct rb_blocking_region_buffer __region; \ - blocking_region_begin(__th, &__region, ubf, ubfarg); \ + blocking_region_begin(__th, &__region, (ubf), (ubfarg)); \ exec; \ blocking_region_end(__th, &__region); \ RUBY_VM_CHECK_INTS(); \ @@ -2368,9 +2368,9 @@ rb_fd_select(int n, rb_fdset_t *readfds, rb_fdset_t *writefds, rb_fdset_t *excep #undef FD_ISSET #define FD_ZERO(f) rb_fd_zero(f) -#define FD_SET(i, f) rb_fd_set(i, f) -#define FD_CLR(i, f) rb_fd_clr(i, f) -#define FD_ISSET(i, f) rb_fd_isset(i, f) +#define FD_SET(i, f) rb_fd_set((i), (f)) +#define FD_CLR(i, f) rb_fd_clr((i), (f)) +#define FD_ISSET(i, f) rb_fd_isset((i), (f)) #elif defined(_WIN32) @@ -2414,9 +2414,9 @@ rb_fd_set(int fd, rb_fdset_t *set) #undef FD_ISSET #define FD_ZERO(f) rb_fd_zero(f) -#define FD_SET(i, f) rb_fd_set(i, f) -#define FD_CLR(i, f) rb_fd_clr(i, f) -#define FD_ISSET(i, f) rb_fd_isset(i, f) +#define FD_SET(i, f) rb_fd_set((i), (f)) +#define FD_CLR(i, f) rb_fd_clr((i), (f)) +#define FD_ISSET(i, f) rb_fd_isset((i), (f)) #endif @@ -3045,7 +3045,7 @@ thgroup_add(VALUE group, VALUE thread) */ #define GetMutexPtr(obj, tobj) \ - TypedData_Get_Struct(obj, mutex_t, &mutex_data_type, tobj) + TypedData_Get_Struct((obj), mutex_t, &mutex_data_type, (tobj)) static const char *mutex_unlock(mutex_t *mutex, rb_thread_t volatile *th); @@ -3455,7 +3455,7 @@ barrier_alloc(VALUE klass) return TypedData_Wrap_Struct(klass, &barrier_data_type, (void *)mutex_alloc(0)); } -#define GetBarrierPtr(obj) (VALUE)rb_check_typeddata(obj, &barrier_data_type) +#define GetBarrierPtr(obj) ((VALUE)rb_check_typeddata((obj), &barrier_data_type)) VALUE rb_barrier_new(void)