summaryrefslogtreecommitdiff
path: root/include/ruby/internal/special_consts.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby/internal/special_consts.h')
-rw-r--r--include/ruby/internal/special_consts.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/ruby/internal/special_consts.h b/include/ruby/internal/special_consts.h
index dc0a6b41d6..1e2636da48 100644
--- a/include/ruby/internal/special_consts.h
+++ b/include/ruby/internal/special_consts.h
@@ -156,7 +156,7 @@ RB_TEST(VALUE obj)
*
* RTEST(v) can be 0 if and only if (v == Qfalse || v == Qnil).
*/
- return obj & ~RUBY_Qnil;
+ return obj & RBIMPL_CAST((VALUE)~RUBY_Qnil);
}
RBIMPL_ATTR_CONST()
@@ -226,7 +226,7 @@ RB_NIL_OR_UNDEF_P(VALUE obj)
*
* NIL_OR_UNDEF_P(v) can be true only when v is Qundef or Qnil.
*/
- const VALUE mask = ~(RUBY_Qundef ^ RUBY_Qnil);
+ const VALUE mask = RBIMPL_CAST((VALUE)~(RUBY_Qundef ^ RUBY_Qnil));
const VALUE common_bits = RUBY_Qundef & RUBY_Qnil;
return (obj & mask) == common_bits;
}
@@ -326,7 +326,7 @@ RBIMPL_ATTR_ARTIFICIAL()
static inline bool
RB_SPECIAL_CONST_P(VALUE obj)
{
- return RB_IMMEDIATE_P(obj) || obj == RUBY_Qfalse;
+ return (obj == RUBY_Qfalse) || RB_IMMEDIATE_P(obj);
}
RBIMPL_ATTR_CONST()
@@ -346,7 +346,7 @@ RBIMPL_ATTR_CONSTEXPR(CXX11)
static inline VALUE
rb_special_const_p(VALUE obj)
{
- return RB_SPECIAL_CONST_P(obj) * RUBY_Qtrue;
+ return (unsigned int)RB_SPECIAL_CONST_P(obj) * RUBY_Qtrue;
}
/**