summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-16 07:53:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-16 07:53:18 +0000
commitbeb2d4c5a532ac7b31980f9c71df4466e0351d43 (patch)
treeca1edf839a92f58ce718c7e0ae2a9e9d127b5148 /ext
parent71430123d3cc7d5b261313213f17787f6e6f384d (diff)
bigdecimal.c: refine macros
* ext/bigdecimal/bigdecimal.c (PUSH, SAVE): remove extra semicolons. * ext/bigdecimal/bigdecimal.c (GUARD_OBJ): add parentheses and make an expression instead of a statement. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/bigdecimal/bigdecimal.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index de1a422..c25f3e7 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -72,9 +72,9 @@ static ID id_eq;
/* MACRO's to guard objects from GC by keeping them in stack */
#define ENTER(n) volatile VALUE RB_UNUSED_VAR(vStack[n]);int iStack=0
-#define PUSH(x) vStack[iStack++] = (VALUE)(x);
-#define SAVE(p) PUSH(p->obj);
-#define GUARD_OBJ(p,y) {p=y;SAVE(p);}
+#define PUSH(x) (vStack[iStack++] = (VALUE)(x))
+#define SAVE(p) PUSH((p)->obj)
+#define GUARD_OBJ(p,y) ((p)=(y), SAVE(p))
#define BASE_FIG RMPD_COMPONENT_FIGURES
#define BASE RMPD_BASE