From d55cf83561fd32a05bf230aee65ebdab5c3367e7 Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 6 Apr 2011 12:08:46 +0000 Subject: * include/ruby/intern.h: parenthesize macro arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/intern.h | 76 +++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) (limited to 'include/ruby/intern.h') diff --git a/include/ruby/intern.h b/include/ruby/intern.h index 9c736821a3..37210e1a5a 100644 --- a/include/ruby/intern.h +++ b/include/ruby/intern.h @@ -137,25 +137,25 @@ VALUE rb_big_lshift(VALUE, VALUE); VALUE rb_big_rshift(VALUE, VALUE); /* rational.c */ VALUE rb_rational_raw(VALUE, VALUE); -#define rb_rational_raw1(x) rb_rational_raw(x, INT2FIX(1)) -#define rb_rational_raw2(x,y) rb_rational_raw(x, y) +#define rb_rational_raw1(x) rb_rational_raw((x), INT2FIX(1)) +#define rb_rational_raw2(x,y) rb_rational_raw((x), (y)) VALUE rb_rational_new(VALUE, VALUE); -#define rb_rational_new1(x) rb_rational_new(x, INT2FIX(1)) -#define rb_rational_new2(x,y) rb_rational_new(x, y) +#define rb_rational_new1(x) rb_rational_new((x), INT2FIX(1)) +#define rb_rational_new2(x,y) rb_rational_new((x), (y)) VALUE rb_Rational(VALUE, VALUE); -#define rb_Rational1(x) rb_Rational(x, INT2FIX(1)) -#define rb_Rational2(x,y) rb_Rational(x, y) +#define rb_Rational1(x) rb_Rational((x), INT2FIX(1)) +#define rb_Rational2(x,y) rb_Rational((x), (y)) /* complex.c */ VALUE rb_complex_raw(VALUE, VALUE); -#define rb_complex_raw1(x) rb_complex_raw(x, INT2FIX(0)) -#define rb_complex_raw2(x,y) rb_complex_raw(x, y) +#define rb_complex_raw1(x) rb_complex_raw((x), INT2FIX(0)) +#define rb_complex_raw2(x,y) rb_complex_raw((x), (y)) VALUE rb_complex_new(VALUE, VALUE); -#define rb_complex_new1(x) rb_complex_new(x, INT2FIX(0)) -#define rb_complex_new2(x,y) rb_complex_new(x, y) +#define rb_complex_new1(x) rb_complex_new((x), INT2FIX(0)) +#define rb_complex_new2(x,y) rb_complex_new((x), (y)) VALUE rb_complex_polar(VALUE, VALUE); VALUE rb_Complex(VALUE, VALUE); -#define rb_Complex1(x) rb_Complex(x, INT2FIX(0)) -#define rb_Complex2(x,y) rb_Complex(x, y) +#define rb_Complex1(x) rb_Complex((x), INT2FIX(0)) +#define rb_Complex2(x,y) rb_Complex((x), (y)) /* class.c */ VALUE rb_class_boot(VALUE); VALUE rb_class_new(VALUE); @@ -200,8 +200,8 @@ VALUE rb_fiber_alive_p(VALUE); VALUE rb_enumeratorize(VALUE, VALUE, int, VALUE *); #define RETURN_ENUMERATOR(obj, argc, argv) do { \ if (!rb_block_given_p()) \ - return rb_enumeratorize(obj, ID2SYM(rb_frame_this_func()), \ - argc, argv); \ + return rb_enumeratorize((obj), ID2SYM(rb_frame_this_func()),\ + (argc), (argv)); \ } while (0) /* error.c */ VALUE rb_exc_new(VALUE, const char*, long); @@ -267,10 +267,10 @@ void rb_fd_init(volatile rb_fdset_t *); void rb_fd_term(rb_fdset_t *); #define rb_fd_zero(f) ((f)->fdset->fd_count = 0) void rb_fd_set(int, rb_fdset_t *); -#define rb_fd_clr(n, f) rb_w32_fdclr(n, (f)->fdset) -#define rb_fd_isset(n, f) rb_w32_fdisset(n, (f)->fdset) -#define rb_fd_select(n, rfds, wfds, efds, timeout) rb_w32_select(n, (rfds) ? ((rb_fdset_t*)rfds)->fdset : NULL, (wfds) ? ((rb_fdset_t*)wfds)->fdset : NULL, (efds) ? ((rb_fdset_t*)efds)->fdset: NULL, timeout) -#define rb_fd_resize(n, f) (void)(f) +#define rb_fd_clr(n, f) rb_w32_fdclr((n), (f)->fdset) +#define rb_fd_isset(n, f) rb_w32_fdisset((n), (f)->fdset) +#define rb_fd_select(n, rfds, wfds, efds, timeout) rb_w32_select((n), (rfds) ? ((rb_fdset_t*)(rfds))->fdset : NULL, (wfds) ? ((rb_fdset_t*)(wfds))->fdset : NULL, (efds) ? ((rb_fdset_t*)(efds))->fdset: NULL, (timeout)) +#define rb_fd_resize(n, f) ((void)(f)) #define rb_fd_ptr(f) ((f)->fdset) #define rb_fd_max(f) ((f)->fdset->fd_count) @@ -279,16 +279,16 @@ void rb_fd_set(int, rb_fdset_t *); typedef fd_set rb_fdset_t; #define rb_fd_zero(f) FD_ZERO(f) -#define rb_fd_set(n, f) FD_SET(n, f) -#define rb_fd_clr(n, f) FD_CLR(n, f) -#define rb_fd_isset(n, f) FD_ISSET(n, f) +#define rb_fd_set(n, f) FD_SET((n), (f)) +#define rb_fd_clr(n, f) FD_CLR((n), (f)) +#define rb_fd_isset(n, f) FD_ISSET((n), (f)) #define rb_fd_copy(d, s, n) (*(d) = *(s)) -#define rb_fd_resize(n, f) (void)(f) +#define rb_fd_resize(n, f) ((void)(f)) #define rb_fd_ptr(f) (f) #define rb_fd_init(f) FD_ZERO(f) -#define rb_fd_term(f) (void)(f) +#define rb_fd_term(f) ((void)(f)) #define rb_fd_max(f) FD_SETSIZE -#define rb_fd_select(n, rfds, wfds, efds, timeout) select(n, rfds, wfds, efds, timeout) +#define rb_fd_select(n, rfds, wfds, efds, timeout) select((n), (rfds), (wfds), (efds), (timeout)) #endif @@ -691,8 +691,8 @@ st_index_t rb_hash_start(st_index_t); st_index_t rb_hash_uint32(st_index_t, uint32_t); st_index_t rb_hash_uint(st_index_t, st_index_t); st_index_t rb_hash_end(st_index_t); -#define rb_hash_uint32(h, i) st_hash_uint32(h, i) -#define rb_hash_uint(h, i) st_hash_uint(h, i) +#define rb_hash_uint32(h, i) st_hash_uint32((h), (i)) +#define rb_hash_uint(h, i) st_hash_uint((h), (i)) #define rb_hash_end(h) st_hash_end(h) st_index_t rb_str_hash(VALUE); int rb_str_hash_cmp(VALUE,VALUE); @@ -719,57 +719,57 @@ VALUE rb_str_ellipsize(VALUE, long); #define rb_str_new_cstr(str) __extension__ ( \ { \ (__builtin_constant_p(str)) ? \ - rb_str_new(str, (long)strlen(str)) : \ + rb_str_new((str), (long)strlen(str)) : \ rb_str_new_cstr(str); \ }) #define rb_tainted_str_new_cstr(str) __extension__ ( \ { \ (__builtin_constant_p(str)) ? \ - rb_tainted_str_new(str, (long)strlen(str)) : \ + rb_tainted_str_new((str), (long)strlen(str)) : \ rb_tainted_str_new_cstr(str); \ }) #define rb_usascii_str_new_cstr(str) __extension__ ( \ { \ (__builtin_constant_p(str)) ? \ - rb_usascii_str_new(str, (long)strlen(str)) : \ + rb_usascii_str_new((str), (long)strlen(str)) : \ rb_usascii_str_new_cstr(str); \ }) #define rb_external_str_new_cstr(str) __extension__ ( \ { \ (__builtin_constant_p(str)) ? \ - rb_external_str_new(str, (long)strlen(str)) : \ + rb_external_str_new((str), (long)strlen(str)) : \ rb_external_str_new_cstr(str); \ }) #define rb_locale_str_new_cstr(str) __extension__ ( \ { \ (__builtin_constant_p(str)) ? \ - rb_locale_str_new(str, (long)strlen(str)) : \ + rb_locale_str_new((str), (long)strlen(str)) : \ rb_locale_str_new_cstr(str); \ }) #define rb_str_buf_new_cstr(str) __extension__ ( \ { \ (__builtin_constant_p(str)) ? \ rb_str_buf_cat(rb_str_buf_new((long)strlen(str)), \ - str, (long)strlen(str)) : \ + (str), (long)strlen(str)) : \ rb_str_buf_new_cstr(str); \ }) #define rb_str_buf_cat2(str, ptr) __extension__ ( \ { \ (__builtin_constant_p(ptr)) ? \ - rb_str_buf_cat(str, ptr, (long)strlen(ptr)) : \ - rb_str_buf_cat2(str, ptr); \ + rb_str_buf_cat((str), (ptr), (long)strlen(ptr)) : \ + rb_str_buf_cat2((str), (ptr)); \ }) #define rb_str_cat2(str, ptr) __extension__ ( \ { \ (__builtin_constant_p(ptr)) ? \ - rb_str_cat(str, ptr, (long)strlen(ptr)) : \ - rb_str_cat2(str, ptr); \ + rb_str_cat((str), (ptr), (long)strlen(ptr)) : \ + rb_str_cat2((str), (ptr)); \ }) #define rb_exc_new2(klass, ptr) __extension__ ( \ { \ (__builtin_constant_p(ptr)) ? \ - rb_exc_new(klass, ptr, (long)strlen(ptr)) : \ - rb_exc_new2(klass, ptr); \ + rb_exc_new((klass), (ptr), (long)strlen(ptr)) : \ + rb_exc_new2((klass), (ptr)); \ }) #endif #define rb_str_new2 rb_str_new_cstr -- cgit v1.2.3