diff options
| author | KOBAYASHI Shuji <[email protected]> | 2020-11-16 16:04:05 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2020-11-16 16:04:05 +0900 |
| commit | 8a019106c0e57715377f991a510b5f0bca07d464 (patch) | |
| tree | 03904edbab910d09461f92ac0bf36f19b2021efe /include | |
| parent | 8a6614d30e4d1d55f06de2ff77c528dfc6729ab5 (diff) | |
| download | mruby-8a019106c0e57715377f991a510b5f0bca07d464.tar.gz mruby-8a019106c0e57715377f991a510b5f0bca07d464.zip | |
Use `uintptr_t` instead of `unsigned long` in `include/mruby/boxing_word.h`
`mrb_bool` on LLP64 environment seems to become false if, for example,
`mrb_value` is a pointer whose lower 32 bits are 0.
Diffstat (limited to 'include')
| -rw-r--r-- | include/mruby/boxing_word.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/mruby/boxing_word.h b/include/mruby/boxing_word.h index 120c4f476..c0005dffe 100644 --- a/include/mruby/boxing_word.h +++ b/include/mruby/boxing_word.h @@ -131,7 +131,7 @@ mrb_integer_func(mrb_value o) { #else #define mrb_symbol(o) BOXWORD_SHIFT_VALUE(o, SYMBOL, mrb_sym) #endif -#define mrb_bool(o) (((o).w & ~(unsigned long)MRB_Qfalse) != 0) +#define mrb_bool(o) (((o).w & ~(uintptr_t)MRB_Qfalse) != 0) #define mrb_fixnum_p(o) BOXWORD_SHIFT_VALUE_P(o, FIXNUM) #define mrb_integer_p(o) (BOXWORD_SHIFT_VALUE_P(o, FIXNUM)||BOXWORD_OBJ_TYPE_P(o, INTEGER)) |
