Commit 8a019106 authored by KOBAYASHI Shuji's avatar KOBAYASHI Shuji

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.
parent 8a6614d3
...@@ -131,7 +131,7 @@ mrb_integer_func(mrb_value o) { ...@@ -131,7 +131,7 @@ mrb_integer_func(mrb_value o) {
#else #else
#define mrb_symbol(o) BOXWORD_SHIFT_VALUE(o, SYMBOL, mrb_sym) #define mrb_symbol(o) BOXWORD_SHIFT_VALUE(o, SYMBOL, mrb_sym)
#endif #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_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)) #define mrb_integer_p(o) (BOXWORD_SHIFT_VALUE_P(o, FIXNUM)||BOXWORD_OBJ_TYPE_P(o, INTEGER))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment