[teagba] Fix type conversions
This commit is contained in:
parent
f5b1da09b5
commit
ae3f0bb5db
6
deps/teagba/include/teagba/registers.hpp
vendored
6
deps/teagba/include/teagba/registers.hpp
vendored
@ -9,7 +9,7 @@
|
||||
namespace teagba {
|
||||
|
||||
inline auto bgSetSbb(volatile BgCtl *bgCtl, unsigned sbb) noexcept {
|
||||
*bgCtl = (*bgCtl & ~0b11111'0000'0000u) | (sbb << 8);
|
||||
*bgCtl = static_cast<BgCtl>(*bgCtl & ~0b11111'0000'0000u) | static_cast<BgCtl>(sbb << 8);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
@ -24,7 +24,7 @@ inline auto bgPri(const volatile BgCtl *bgCtl) noexcept {
|
||||
|
||||
inline auto bgSetPri(volatile BgCtl *bgCtl, unsigned pri) noexcept {
|
||||
pri = pri & 0b1;
|
||||
*bgCtl = (*bgCtl & ~0b1u) | (pri << 0);
|
||||
*bgCtl = static_cast<BgCtl>(*bgCtl & ~0b1u) | static_cast<BgCtl>(pri << 0);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
@ -58,7 +58,7 @@ inline auto bgCbb(const volatile BgCtl *bgCtl) noexcept {
|
||||
|
||||
inline auto bgSetCbb(volatile BgCtl *bgCtl, unsigned cbb) noexcept {
|
||||
cbb = cbb & 0b11;
|
||||
*bgCtl = (*bgCtl & ~0b1100u) | (cbb << 2);
|
||||
*bgCtl = static_cast<BgCtl>(*bgCtl & ~0b1100u) | static_cast<BgCtl>(cbb << 2);
|
||||
}
|
||||
|
||||
constexpr void iterateBgCtl(auto cb) noexcept {
|
||||
|
7
deps/teagba/src/CMakeLists.txt
vendored
7
deps/teagba/src/CMakeLists.txt
vendored
@ -10,6 +10,11 @@ add_library(
|
||||
gfx.cpp
|
||||
)
|
||||
|
||||
if(NOT MSVC)
|
||||
target_compile_options(TeaGBA PRIVATE -Wsign-conversion)
|
||||
target_compile_options(TeaGBA PRIVATE -Wconversion)
|
||||
endif()
|
||||
|
||||
target_include_directories(
|
||||
TeaGBA PUBLIC
|
||||
../include
|
||||
@ -26,4 +31,4 @@ install(
|
||||
DESTINATION
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user