diff --git a/include/ruby/3/core/rarray.h b/include/ruby/3/core/rarray.h index f4f6809874..cd8767a8a8 100644 --- a/include/ruby/3/core/rarray.h +++ b/include/ruby/3/core/rarray.h @@ -123,7 +123,7 @@ RARRAY_EMBED_LEN(VALUE ary) VALUE f = RBASIC(ary)->flags; f &= RARRAY_EMBED_LEN_MASK; f >>= RARRAY_EMBED_LEN_SHIFT; - return (long)f; + return RUBY3_CAST((long)f); } RUBY3_ATTR_PURE_ON_NDEBUG() diff --git a/include/ruby/3/core/rstring.h b/include/ruby/3/core/rstring.h index 3d40f850bc..80e997b494 100644 --- a/include/ruby/3/core/rstring.h +++ b/include/ruby/3/core/rstring.h @@ -108,7 +108,7 @@ RSTRING_EMBED_LEN(VALUE str) VALUE f = RBASIC(str)->flags; f &= RSTRING_EMBED_LEN_MASK; f >>= RSTRING_EMBED_LEN_SHIFT; - return (long)f; + return RUBY3_CAST((long)f); } RUBY3_ATTR_PURE_ON_NDEBUG()