Skip to content

Commit 3095333

Browse files
committed
* bignum.c (big_lshift): make shift offset long type.
(big_rshift): ditto. (rb_big_lshift): ditto. (big_rshift): ditto. [ruby-dev:31434] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent cb0bb99 commit 3095333

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

bignum.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,8 +1544,8 @@ rb_big_remainder(x, y)
15441544
return bignorm(z);
15451545
}
15461546

1547-
static VALUE big_lshift _((VALUE, unsigned int));
1548-
static VALUE big_rshift _((VALUE, unsigned int));
1547+
static VALUE big_lshift _((VALUE, unsigned long));
1548+
static VALUE big_rshift _((VALUE, unsigned long));
15491549

15501550
static VALUE big_shift(x, n)
15511551
VALUE x;
@@ -1884,11 +1884,12 @@ VALUE
18841884
rb_big_lshift(x, y)
18851885
VALUE x, y;
18861886
{
1887-
int shift, neg = 0;
1887+
long shift;
1888+
int neg = 0;
18881889

18891890
for (;;) {
18901891
if (FIXNUM_P(y)) {
1891-
shift = FIX2INT(y);
1892+
shift = FIX2LONG(y);
18921893
if (shift < 0) {
18931894
neg = 1;
18941895
shift = -shift;
@@ -1914,10 +1915,10 @@ rb_big_lshift(x, y)
19141915
static VALUE
19151916
big_lshift(x, shift)
19161917
VALUE x;
1917-
unsigned int shift;
1918+
unsigned long shift;
19181919
{
19191920
BDIGIT *xds, *zds;
1920-
int s1 = shift/BITSPERDIG;
1921+
long s1 = shift/BITSPERDIG;
19211922
int s2 = shift%BITSPERDIG;
19221923
VALUE z;
19231924
BDIGIT_DBL num = 0;
@@ -1950,12 +1951,12 @@ VALUE
19501951
rb_big_rshift(x, y)
19511952
VALUE x, y;
19521953
{
1953-
int shift;
1954+
long shift;
19541955
int neg = 0;
19551956

19561957
for (;;) {
19571958
if (FIXNUM_P(y)) {
1958-
shift = FIX2INT(y);
1959+
shift = FIX2LONG(y);
19591960
if (shift < 0) {
19601961
neg = 1;
19611962
shift = -shift;
@@ -1983,11 +1984,11 @@ rb_big_rshift(x, y)
19831984
static VALUE
19841985
big_rshift(x, shift)
19851986
VALUE x;
1986-
unsigned int shift;
1987+
unsigned long shift;
19871988
{
19881989
BDIGIT *xds, *zds;
19891990
long s1 = shift/BITSPERDIG;
1990-
long s2 = shift%BITSPERDIG;
1991+
int s2 = shift%BITSPERDIG;
19911992
VALUE z;
19921993
BDIGIT_DBL num = 0;
19931994
long i, j;

version.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#define RUBY_VERSION "1.8.6"
2-
#define RUBY_RELEASE_DATE "2007-08-22"
2+
#define RUBY_RELEASE_DATE "2007-09-07"
33
#define RUBY_VERSION_CODE 186
4-
#define RUBY_RELEASE_CODE 20070822
5-
#define RUBY_PATCHLEVEL 89
4+
#define RUBY_RELEASE_CODE 20070907
5+
#define RUBY_PATCHLEVEL 90
66

77
#define RUBY_VERSION_MAJOR 1
88
#define RUBY_VERSION_MINOR 8
99
#define RUBY_VERSION_TEENY 6
1010
#define RUBY_RELEASE_YEAR 2007
11-
#define RUBY_RELEASE_MONTH 8
12-
#define RUBY_RELEASE_DAY 22
11+
#define RUBY_RELEASE_MONTH 9
12+
#define RUBY_RELEASE_DAY 7
1313

1414
#ifdef RUBY_EXTERN
1515
RUBY_EXTERN const char ruby_version[];

0 commit comments

Comments
 (0)