* bignum.c: use SIZEOF_LONG instead of SIZEOF_ULONG which is not
defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
910b0709ed
commit
c0d197423d
@ -1,3 +1,8 @@
|
|||||||
|
Sun Sep 30 04:30:55 2007 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* bignum.c: use SIZEOF_LONG instead of SIZEOF_ULONG which is not
|
||||||
|
defined.
|
||||||
|
|
||||||
Sun Sep 30 04:03:43 2007 Tanaka Akira <akr@fsij.org>
|
Sun Sep 30 04:03:43 2007 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* re.c (Init_Regexp): test DEFAULT_KCODE in C code because
|
* re.c (Init_Regexp): test DEFAULT_KCODE in C code because
|
||||||
|
8
bignum.c
8
bignum.c
@ -657,7 +657,7 @@ static void bigdivmod(VALUE x, VALUE y, VALUE *divp, VALUE *modp);
|
|||||||
static inline int
|
static inline int
|
||||||
ones(register unsigned long x)
|
ones(register unsigned long x)
|
||||||
{
|
{
|
||||||
#if SIZEOF_ULONG == 8
|
#if SIZEOF_LONG == 8
|
||||||
# define MASK_55 0x5555555555555555UL
|
# define MASK_55 0x5555555555555555UL
|
||||||
# define MASK_33 0x3333333333333333UL
|
# define MASK_33 0x3333333333333333UL
|
||||||
# define MASK_0f 0x0f0f0f0f0f0f0f0fUL
|
# define MASK_0f 0x0f0f0f0f0f0f0f0fUL
|
||||||
@ -671,7 +671,7 @@ ones(register unsigned long x)
|
|||||||
x = ((x >> 4) + x) & MASK_0f;
|
x = ((x >> 4) + x) & MASK_0f;
|
||||||
x += (x >> 8);
|
x += (x >> 8);
|
||||||
x += (x >> 16);
|
x += (x >> 16);
|
||||||
#if SIZEOF_ULONG == 8
|
#if SIZEOF_LONG == 8
|
||||||
x += (x >> 32);
|
x += (x >> 32);
|
||||||
#endif
|
#endif
|
||||||
return (int)(x & 0x7f);
|
return (int)(x & 0x7f);
|
||||||
@ -688,7 +688,7 @@ next_pow2(register unsigned long x)
|
|||||||
x |= x >> 4;
|
x |= x >> 4;
|
||||||
x |= x >> 8;
|
x |= x >> 8;
|
||||||
x |= x >> 16;
|
x |= x >> 16;
|
||||||
#if SIZEOF_ULONG == 8
|
#if SIZEOF_LONG == 8
|
||||||
x |= x >> 32;
|
x |= x >> 32;
|
||||||
#endif
|
#endif
|
||||||
return x + 1;
|
return x + 1;
|
||||||
@ -702,7 +702,7 @@ floor_log2(register unsigned long x)
|
|||||||
x |= x >> 4;
|
x |= x >> 4;
|
||||||
x |= x >> 8;
|
x |= x >> 8;
|
||||||
x |= x >> 16;
|
x |= x >> 16;
|
||||||
#if SIZEOF_ULONG == 8
|
#if SIZEOF_LONG == 8
|
||||||
x |= x >> 32;
|
x |= x >> 32;
|
||||||
#endif
|
#endif
|
||||||
return (int)ones(x) - 1;
|
return (int)ones(x) - 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user