ruby-changes:18224
From: akr <ko1@a...>
Date: Sun, 19 Dec 2010 19:16:02 +0900 (JST)
Subject: [ruby-changes:18224] Ruby:r30245 (trunk): * marshal.c: parenthesize macro arguments.
akr 2010-12-19 19:15:57 +0900 (Sun, 19 Dec 2010) New Revision: 30245 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30245 Log: * marshal.c: parenthesize macro arguments. Modified files: trunk/ChangeLog trunk/marshal.c Index: ChangeLog =================================================================== --- ChangeLog (revision 30244) +++ ChangeLog (revision 30245) @@ -1,3 +1,7 @@ +Sun Dec 19 19:15:23 2010 Tanaka Akira <akr@f...> + + * marshal.c: parenthesize macro arguments. + Sat Dec 18 21:52:37 2010 Kazuhiro NISHIYAMA <zn@m...> * vsnprintf.c (BSD_vfprintf): suppress warning: "_WIN32" is not Index: marshal.c =================================================================== --- marshal.c (revision 30244) +++ marshal.c (revision 30245) @@ -25,7 +25,7 @@ #define BITSPERSHORT (2*CHAR_BIT) #define SHORTMASK ((1<<BITSPERSHORT)-1) -#define SHORTDN(x) RSHIFT(x,BITSPERSHORT) +#define SHORTDN(x) RSHIFT((x),BITSPERSHORT) #if SIZEOF_SHORT == SIZEOF_BDIGITS #define SHORTLEN(x) (x) @@ -246,7 +246,7 @@ w_nbyte(s, n, arg); } -#define w_cstr(s, arg) w_bytes(s, strlen(s), arg) +#define w_cstr(s, arg) w_bytes((s), strlen(s), (arg)) static void w_short(int x, struct dump_arg *arg) @@ -590,7 +590,7 @@ st_table *ivtbl = 0; st_data_t num; int hasiv = 0; -#define has_ivars(obj, ivtbl) ((ivtbl = rb_generic_ivar_table(obj)) != 0 || \ +#define has_ivars(obj, ivtbl) (((ivtbl) = rb_generic_ivar_table(obj)) != 0 || \ (!SPECIAL_CONST_P(obj) && !ENCODING_IS_ASCII8BIT(obj))) if (limit == 0) { @@ -1002,7 +1002,7 @@ {mark_load_arg, free_load_arg, memsize_load_arg,}, }; -#define r_entry(v, arg) r_entry0(v, (arg)->data->num_entries, arg) +#define r_entry(v, arg) r_entry0((v), (arg)->data->num_entries, (arg)) static VALUE r_entry0(VALUE v, st_index_t num, struct load_arg *arg); static VALUE r_object(struct load_arg *arg); static ID r_symbol(struct load_arg *arg); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/