mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* bignum.c (LSHIFTX): Defined to suppress a warning.
(RSHIFTX): Ditto. (CLEAR_LOWBITS): Use LSHIFTX and RSHIFTX. (FILL_LOWBITS): Use LSHIFTX. Reported by ko1 via IRC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c816f90e76
commit
afb03d1646
2 changed files with 12 additions and 2 deletions
|
@ -1,3 +1,11 @@
|
|||
Sat Jun 22 09:55:13 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* bignum.c (LSHIFTX): Defined to suppress a warning.
|
||||
(RSHIFTX): Ditto.
|
||||
(CLEAR_LOWBITS): Use LSHIFTX and RSHIFTX.
|
||||
(FILL_LOWBITS): Use LSHIFTX.
|
||||
Reported by ko1 via IRC.
|
||||
|
||||
Sat Jun 22 09:11:33 2013 Ryan Davis <ryand-ruby@zenspider.com>
|
||||
|
||||
* lib/minitest/*: Imported minitest 4.7.5 (r8724)
|
||||
|
|
6
bignum.c
6
bignum.c
|
@ -39,8 +39,10 @@ static VALUE big_three = Qnil;
|
|||
# define HOST_BIGENDIAN_P 0
|
||||
#endif
|
||||
#define ALIGNOF(type) ((int)offsetof(struct { char f1; type f2; }, f2))
|
||||
#define CLEAR_LOWBITS(d, numbits) (sizeof(d) * CHAR_BIT <= (numbits) ? 0 : ((d) >> (numbits)) << (numbits))
|
||||
#define FILL_LOWBITS(d, numbits) (sizeof(d) * CHAR_BIT <= (numbits) ? ~((d)*0) : (d) | ((((d)*0+1) << (numbits))-1))
|
||||
#define LSHIFTX(d, n) (sizeof(d) * CHAR_BIT <= (n) ? 0 : ((d) << (sizeof(d) * CHAR_BIT <= (n) ? 0 : (n))))
|
||||
#define RSHIFTX(d, n) (sizeof(d) * CHAR_BIT <= (n) ? ~((d)*0) : RSHIFT((d), (sizeof(d) * CHAR_BIT <= (n) ? 0 : (n))))
|
||||
#define CLEAR_LOWBITS(d, numbits) LSHIFTX(RSHIFTX((d), (numbits)), (numbits))
|
||||
#define FILL_LOWBITS(d, numbits) ((d) | (LSHIFTX(((d)*0+1), (numbits))-1))
|
||||
|
||||
#define BDIGITS(x) (RBIGNUM_DIGITS(x))
|
||||
#define BITSPERDIG (SIZEOF_BDIGITS*CHAR_BIT)
|
||||
|
|
Loading…
Reference in a new issue