[ox/std] Fix implicit sign conversion
This commit is contained in:
parent
a74cd1c926
commit
8b74920270
2
deps/ox/src/ox/std/CMakeLists.txt
vendored
2
deps/ox/src/ox/std/CMakeLists.txt
vendored
@ -13,6 +13,8 @@ add_library(
|
||||
trace.cpp
|
||||
)
|
||||
|
||||
target_compile_options(OxStd PRIVATE -Wsign-conversion)
|
||||
|
||||
if(NOT OX_BARE_METAL)
|
||||
set_property(
|
||||
TARGET
|
||||
|
2
deps/ox/src/ox/std/bit.hpp
vendored
2
deps/ox/src/ox/std/bit.hpp
vendored
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user