summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-19 10:15:57 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-19 10:15:57 +0000
commit9035b0e7590ea93f3081582097c6503498996d60 (patch)
tree5a47b6b78bc345437e6690f92407e38e8ceb2ad1 /marshal.c
parent7d0e6734df331acf7017562bcef215303367308d (diff)
* marshal.c: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/marshal.c b/marshal.c
index 0df199adb6..2a61b78448 100644
--- a/marshal.c
+++ b/marshal.c
@@ -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_bytes(const char *s, long n, struct dump_arg *arg)
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 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
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 @@ static const rb_data_type_t load_arg_data = {
{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);