summaryrefslogtreecommitdiff
path: root/vm_insnhelper.h
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-24 12:51:13 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-24 12:51:13 +0000
commitc11a4d8f3f56fd53f969b1b5c63336bd1dae1bd3 (patch)
tree17c723c68c9a99ba09c823ef1475782eb1d15846 /vm_insnhelper.h
parent2ec31553eabe374a1f8c1b8edf0d2bb4c548949f (diff)
* vm_insnhelper.h: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.h')
-rw-r--r--vm_insnhelper.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/vm_insnhelper.h b/vm_insnhelper.h
index 095b417..979c342 100644
--- a/vm_insnhelper.h
+++ b/vm_insnhelper.h
@@ -93,14 +93,14 @@ extern VALUE ruby_vm_const_missing_count;
#ifdef COLLECT_USAGE_ANALYSIS
#define USAGE_ANALYSIS_REGISTER_HELPER(a, b, v) \
- (USAGE_ANALYSIS_REGISTER(a, b), (v))
+ (USAGE_ANALYSIS_REGISTER((a), (b)), (v))
#else
#define USAGE_ANALYSIS_REGISTER_HELPER(a, b, v) (v)
#endif
/* PC */
#define GET_PC() (USAGE_ANALYSIS_REGISTER_HELPER(0, 0, REG_PC))
-#define SET_PC(x) (REG_PC = (USAGE_ANALYSIS_REGISTER_HELPER(0, 1, x)))
+#define SET_PC(x) (REG_PC = (USAGE_ANALYSIS_REGISTER_HELPER(0, 1, (x))))
#define GET_CURRENT_INSN() (*GET_PC())
#define GET_OPERAND(n) (GET_PC()[(n)])
#define ADD_PC(n) (SET_PC(REG_PC + (n)))
@@ -134,8 +134,8 @@ extern VALUE ruby_vm_const_missing_count;
#define GET_PREV_DFP(dfp) ((VALUE *)((dfp)[0] & ~0x03))
-#define GET_GLOBAL(entry) rb_gvar_get((struct rb_global_entry*)entry)
-#define SET_GLOBAL(entry, val) rb_gvar_set((struct rb_global_entry*)entry, val)
+#define GET_GLOBAL(entry) rb_gvar_get((struct rb_global_entry*)(entry))
+#define SET_GLOBAL(entry, val) rb_gvar_set((struct rb_global_entry*)(entry), (val))
#define GET_CONST_INLINE_CACHE(dst) ((IC) * (GET_PC() + (dst) + 2))
@@ -151,13 +151,13 @@ extern VALUE ruby_vm_const_missing_count;
#define COPY_CREF(c1, c2) do { \
NODE *__tmp_c2 = (c2); \
- c1->nd_clss = __tmp_c2->nd_clss; \
- c1->nd_visi = __tmp_c2->nd_visi;\
- c1->nd_next = __tmp_c2->nd_next; \
+ (c1)->nd_clss = __tmp_c2->nd_clss; \
+ (c1)->nd_visi = __tmp_c2->nd_visi;\
+ (c1)->nd_next = __tmp_c2->nd_next; \
} while (0)
#define CALL_METHOD(num, blockptr, flag, id, me, recv) do { \
- VALUE v = vm_call_method(th, GET_CFP(), num, blockptr, flag, id, me, recv); \
+ VALUE v = vm_call_method(th, GET_CFP(), (num), (blockptr), (flag), (id), (me), (recv)); \
if (v == Qundef) { \
RESTORE_REGS(); \
NEXT_INSN(); \
@@ -182,7 +182,7 @@ extern VALUE ruby_vm_const_missing_count;
/* optimize insn */
#define FIXNUM_2_P(a, b) ((a) & (b) & 1)
-#define BASIC_OP_UNREDEFINED_P(op) (LIKELY(ruby_vm_redefined_flag[op] == 0))
+#define BASIC_OP_UNREDEFINED_P(op) (LIKELY(ruby_vm_redefined_flag[(op)] == 0))
#define HEAP_CLASS_OF(obj) RBASIC(obj)->klass
#ifndef USE_IC_FOR_SPECIALIZED_METHOD
@@ -193,14 +193,14 @@ extern VALUE ruby_vm_const_missing_count;
#define CALL_SIMPLE_METHOD(num, id, recv) do { \
VALUE klass = CLASS_OF(recv); \
- CALL_METHOD(num, 0, 0, id, vm_method_search(id, klass, ic), recv); \
+ CALL_METHOD((num), 0, 0, (id), vm_method_search((id), klass, ic), (recv)); \
} while (0)
#else
#define CALL_SIMPLE_METHOD(num, id, recv) do { \
VALUE klass = CLASS_OF(recv); \
- CALL_METHOD(num, 0, 0, id, rb_method_entry(klass, id), recv); \
+ CALL_METHOD((num), 0, 0, (id), rb_method_entry(klass, (id)), (recv)); \
} while (0)
#endif