1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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_5@13355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shyouhei 2007-09-07 04:53:13 +00:00
parent 69a3a92be9
commit c7a84b8c11
3 changed files with 24 additions and 15 deletions

View file

@ -1,3 +1,11 @@
Fri Sep 7 13:52:36 2007 Tanaka Akira <akr@fsij.org>
* bignum.c (big_lshift): make shift offset long type.
(big_rshift): ditto.
(rb_big_lshift): ditto.
(big_rshift): ditto.
[ruby-dev:31434]
Thu Aug 16 08:44:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* hash.c (rb_hash_delete_key): delete the entry without calling block.

View file

@ -1509,8 +1509,8 @@ rb_big_remainder(x, y)
return bignorm(z);
}
static VALUE big_lshift _((VALUE, unsigned int));
static VALUE big_rshift _((VALUE, unsigned int));
static VALUE big_lshift _((VALUE, unsigned long));
static VALUE big_rshift _((VALUE, unsigned long));
static VALUE big_shift(x, n)
VALUE x;
@ -1847,11 +1847,12 @@ VALUE
rb_big_lshift(x, y)
VALUE x, y;
{
int shift, neg = 0;
long shift;
int neg = 0;
for (;;) {
if (FIXNUM_P(y)) {
shift = FIX2INT(y);
shift = FIX2LONG(y);
if (shift < 0) {
neg = 1;
shift = -shift;
@ -1877,10 +1878,10 @@ rb_big_lshift(x, y)
static VALUE
big_lshift(x, shift)
VALUE x;
unsigned int shift;
unsigned long shift;
{
BDIGIT *xds, *zds;
int s1 = shift/BITSPERDIG;
long s1 = shift/BITSPERDIG;
int s2 = shift%BITSPERDIG;
VALUE z;
BDIGIT_DBL num = 0;
@ -1913,12 +1914,12 @@ VALUE
rb_big_rshift(x, y)
VALUE x, y;
{
int shift;
long shift;
int neg = 0;
for (;;) {
if (FIXNUM_P(y)) {
shift = FIX2INT(y);
shift = FIX2LONG(y);
if (shift < 0) {
neg = 1;
shift = -shift;
@ -1946,11 +1947,11 @@ rb_big_rshift(x, y)
static VALUE
big_rshift(x, shift)
VALUE x;
unsigned int shift;
unsigned long shift;
{
BDIGIT *xds, *zds;
long s1 = shift/BITSPERDIG;
long s2 = shift%BITSPERDIG;
int s2 = shift%BITSPERDIG;
VALUE z;
BDIGIT_DBL num = 0;
long i, j;

View file

@ -1,15 +1,15 @@
#define RUBY_VERSION "1.8.5"
#define RUBY_RELEASE_DATE "2007-08-16"
#define RUBY_RELEASE_DATE "2007-09-07"
#define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20070816
#define RUBY_PATCHLEVEL 97
#define RUBY_RELEASE_CODE 20070907
#define RUBY_PATCHLEVEL 98
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
#define RUBY_VERSION_TEENY 5
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 8
#define RUBY_RELEASE_DAY 16
#define RUBY_RELEASE_MONTH 9
#define RUBY_RELEASE_DAY 7
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];