mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Use roomof
macro
The masking is not only unnecessary but works only when the masking value is a power of 2. Also suppress unary minus operator to unsigned type warnings.
This commit is contained in:
parent
4a2662ae8b
commit
9958ed61bc
Notes:
git
2022-07-08 17:27:44 +09:00
1 changed files with 1 additions and 1 deletions
2
iseq.h
2
iseq.h
|
@ -21,7 +21,7 @@ RUBY_EXTERN const int ruby_api_version[];
|
|||
#define ISEQ_MBITS_BITLENGTH (ISEQ_MBITS_SIZE * CHAR_BIT)
|
||||
#define ISEQ_MBITS_SET(buf, i) (buf[(i) / ISEQ_MBITS_BITLENGTH] |= ((iseq_bits_t)1 << ((i) % ISEQ_MBITS_BITLENGTH)))
|
||||
#define ISEQ_MBITS_SET_P(buf, i) ((buf[(i) / ISEQ_MBITS_BITLENGTH] >> ((i) % ISEQ_MBITS_BITLENGTH)) & 0x1)
|
||||
#define ISEQ_MBITS_BUFLEN(size) (((size + (ISEQ_MBITS_BITLENGTH - 1)) & -ISEQ_MBITS_BITLENGTH) / ISEQ_MBITS_BITLENGTH)
|
||||
#define ISEQ_MBITS_BUFLEN(size) roomof(size, ISEQ_MBITS_BITLENGTH)
|
||||
|
||||
#ifndef USE_ISEQ_NODE_ID
|
||||
#define USE_ISEQ_NODE_ID 1
|
||||
|
|
Loading…
Add table
Reference in a new issue