ruby-changes:18467
From: akr <ko1@a...>
Date: Sat, 8 Jan 2011 19:29:25 +0900 (JST)
Subject: [ruby-changes:18467] Ruby:r30490 (trunk): * thread.c: parenthesize macro arguments.
akr 2011-01-08 19:29:15 +0900 (Sat, 08 Jan 2011) New Revision: 30490 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30490 Log: * thread.c: parenthesize macro arguments. Modified files: trunk/ChangeLog trunk/thread.c Index: ChangeLog =================================================================== --- ChangeLog (revision 30489) +++ ChangeLog (revision 30490) @@ -1,3 +1,7 @@ +Sat Jan 8 19:28:55 2011 Tanaka Akira <akr@f...> + + * thread.c: parenthesize macro arguments. + Fri Jan 7 23:07:40 2011 Nobuyoshi Nakada <nobu@r...> * lib/mkmf.rb (configuration): backref needs to capture. Index: thread.c =================================================================== --- thread.c (revision 30489) +++ thread.c (revision 30490) @@ -131,7 +131,7 @@ #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 @@ #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 @@ #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 @@ */ #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 @@ 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/