зеркало из https://github.com/github/ruby.git
RARRAY_EMBED_LEN/RSTRING_EMBED_LEN: add RUBY3_CAST
RUBY3_CAST is a macro to suppress g++/clang++ warnings about C-style casts. Though Ruby core don't have to bother C++ situations, extension libraries can benefit from this.
This commit is contained in:
Родитель
ec1b3464da
Коммит
dd04b8034b
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
Загрузка…
Ссылка в новой задаче