[ox/std] Fix implicit sign conversion

This commit is contained in:
Gary Talent 2020-04-05 19:48:17 -05:00
parent a74cd1c926
commit 8b74920270
2 changed files with 3 additions and 1 deletions

View File

@ -13,6 +13,8 @@ add_library(
trace.cpp
)
target_compile_options(OxStd PRIVATE -Wsign-conversion)
if(NOT OX_BARE_METAL)
set_property(
TARGET

View File

@ -24,7 +24,7 @@ typename enable_if<sizeof(To) == sizeof(From), To>::type bit_cast(From src) noex
template<typename T>
[[nodiscard]] constexpr T rotl(T i, int shift) noexcept {
constexpr auto bits = sizeof(i) * 8;
return (i << shift) | (i >> (bits - shift));
return (i << static_cast<T>(shift)) | (i >> (bits - static_cast<T>(shift)));
}
template<typename T>