summaryrefslogtreecommitdiffhomepage
path: root/src/opcode.h
diff options
context:
space:
mode:
authorMasaki Muranaka <[email protected]>2013-03-22 17:50:01 +0900
committerYukihiro Matz Matsumoto <[email protected]>2013-03-24 00:12:53 +0900
commit1756e8fc839fb734bf107cd1aa23fb8a39142642 (patch)
tree8651784b7410f6499f8e7e1baa61669ecb36ad97 /src/opcode.h
parentf5748e28c65ac3ff90cd164d7480b9d52628b933 (diff)
downloadmruby-1756e8fc839fb734bf107cd1aa23fb8a39142642.tar.gz
mruby-1756e8fc839fb734bf107cd1aa23fb8a39142642.zip
Add brances to macro parameter. It may be refactored as GET_UNPACK_{b,c} are used only by GETARG_{b,c}.
Diffstat (limited to 'src/opcode.h')
-rw-r--r--src/opcode.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/opcode.h b/src/opcode.h
index 8678ef73d..bebc27d5a 100644
--- a/src/opcode.h
+++ b/src/opcode.h
@@ -24,8 +24,8 @@
#define GETARG_Bx(i) ((int)((((mrb_code)(i)) >> 7) & 0xffff))
#define GETARG_sBx(i) ((int)(GETARG_Bx(i)-MAXARG_sBx))
#define GETARG_Ax(i) ((int32_t)((((mrb_code)(i)) >> 7) & 0x1ffffff))
-#define GETARG_UNPACK_b(i,n1,n2) ((int)((((mrb_code)(i)) >> (7+n2)) & (((1<<n1)-1))))
-#define GETARG_UNPACK_c(i,n1,n2) ((int)((((mrb_code)(i)) >> 7) & (((1<<n2)-1))))
+#define GETARG_UNPACK_b(i,n1,n2) ((int)((((mrb_code)(i)) >> (7+(n2))) & (((1<<(n1))-1))))
+#define GETARG_UNPACK_c(i,n1,n2) ((int)((((mrb_code)(i)) >> 7) & (((1<<(n2))-1))))
#define GETARG_b(i) GETARG_UNPACK_b(i,14,2)
#define GETARG_c(i) GETARG_UNPACK_c(i,14,2)