summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--bignum.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index bd0a74c1d8..b1eb0db2b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Dec 2 17:00:44 2010 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: parenthesize macro arguments.
+
Thu Dec 2 15:31:14 2010 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (rb_w32_read): more fix. [ruby-core:33513]
diff --git a/bignum.c b/bignum.c
index 152018e981..2f804db5df 100644
--- a/bignum.c
+++ b/bignum.c
@@ -34,7 +34,7 @@ VALUE rb_cBignum;
# define DIGSPERLL (SIZEOF_LONG_LONG/SIZEOF_BDIGITS)
#endif
#define BIGUP(x) ((BDIGIT_DBL)(x) << BITSPERDIG)
-#define BIGDN(x) RSHIFT(x,BITSPERDIG)
+#define BIGDN(x) RSHIFT((x),BITSPERDIG)
#define BIGLO(x) ((BDIGIT)((x) & (BIGRAD-1)))
#define BDIGMAX ((BDIGIT)-1)
@@ -148,7 +148,7 @@ bignew_1(VALUE klass, long len, int sign)
return (VALUE)big;
}
-#define bignew(len,sign) bignew_1(rb_cBignum,len,sign)
+#define bignew(len,sign) bignew_1(rb_cBignum,(len),(sign))
VALUE
rb_big_new(long len, int sign)
@@ -511,7 +511,7 @@ rb_quad_pack(char *buf, VALUE val)
}
}
-#define BNEG(b) (RSHIFT(((BDIGIT*)b)[QUAD_SIZE/SIZEOF_BDIGITS-1],BITSPERDIG-1) != 0)
+#define BNEG(b) (RSHIFT(((BDIGIT*)(b))[QUAD_SIZE/SIZEOF_BDIGITS-1],BITSPERDIG-1) != 0)
VALUE
rb_quad_unpack(const char *buf, int sign)