summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-05-25 09:42:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-05-25 09:42:47 +0000
commit8b1e7e34403977058d412931e31577df719fd2e4 (patch)
tree7743656749f91b601f3d025ea357e8a8043424d8 /bignum.c
parent45c61f40b23b14e97428206e1b813eb813526e6f (diff)
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bignum.c b/bignum.c
index 4667db88c4..7bbe95b254 100644
--- a/bignum.c
+++ b/bignum.c
@@ -21,7 +21,7 @@ typedef unsigned short USHORT;
#define BIGRAD (1L << BITSPERDIG)
#define DIGSPERINT ((unsigned int)(sizeof(long)/sizeof(short)))
#define BIGUP(x) ((unsigned int)(x) << BITSPERDIG)
-#define BIGDN(x) ((x) >> BITSPERDIG)
+#define BIGDN(x) RSHIFT((x),BITSPERDIG)
#define BIGLO(x) ((x) & (BIGRAD-1))
static VALUE
@@ -347,11 +347,11 @@ unsigned long
big2ulong(x)
VALUE x;
{
- unsigned int num;
+ unsigned long num;
unsigned int len = RBIGNUM(x)->len;
USHORT *ds;
- if (len > sizeof(long)/sizeof(short))
+ if (len > sizeof(long)/sizeof(USHORT))
ArgError("bignum too big to convert into `uint'");
ds = BDIGITS(x);
num = 0;