mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* bignum.c (LSHIFTABLE): extract from LSHIFTX().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1457ee2ce4
commit
86b65861cd
1 changed files with 2 additions and 1 deletions
3
bignum.c
3
bignum.c
|
@ -40,7 +40,8 @@ static VALUE big_three = Qnil;
|
|||
#endif
|
||||
#define ALIGNOF(type) ((int)offsetof(struct { char f1; type f2; }, f2))
|
||||
/* (sizeof(d) * CHAR_BIT <= (n) ? 0 : (n)) is same as n but suppress a warning, C4293, by Visual Studio. */
|
||||
#define LSHIFTX(d, n) (sizeof(d) * CHAR_BIT <= (n) ? 0 : ((d) << (sizeof(d) * CHAR_BIT <= (n) ? 0 : (n))))
|
||||
#define LSHIFTABLE(d, n) ((n) < sizeof(d) * CHAR_BIT)
|
||||
#define LSHIFTX(d, n) (!LSHIFTABLE(d, n) ? 0 : ((d) << (!LSHIFTABLE(d, n) ? 0 : (n))))
|
||||
#define CLEAR_LOWBITS(d, numbits) ((d) & LSHIFTX(~((d)*0), (numbits)))
|
||||
#define FILL_LOWBITS(d, numbits) ((d) | (LSHIFTX(((d)*0+1), (numbits))-1))
|
||||
#define POW2_P(x) (((x)&((x)-1))==0)
|
||||
|
|
Loading…
Add table
Reference in a new issue