1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Suppress possible loss of data warnings

This commit is contained in:
Nobuyoshi Nakada 2022-01-14 00:41:22 +09:00
parent 6dc4c942a3
commit 9fa9cf4006
Notes: git 2022-01-14 13:46:41 +09:00

View file

@ -426,13 +426,14 @@ RSTRING_EMBED_LEN(VALUE str)
RBIMPL_ASSERT_OR_ASSUME(! RB_FL_ANY_RAW(str, RSTRING_NOEMBED));
#if USE_RVARGC
short f = RSTRING(str)->as.embed.len;
long f = RSTRING(str)->as.embed.len;
return f;
#else
VALUE f = RBASIC(str)->flags;
f &= RSTRING_EMBED_LEN_MASK;
f >>= RSTRING_EMBED_LEN_SHIFT;
#endif
return RBIMPL_CAST((long)f);
#endif
}
RBIMPL_WARNING_PUSH()