diff --git a/deps/teagba/include/teagba/registers.hpp b/deps/teagba/include/teagba/registers.hpp index e19c5ec7..02d5dbba 100644 --- a/deps/teagba/include/teagba/registers.hpp +++ b/deps/teagba/include/teagba/registers.hpp @@ -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 & ~0b11111'0000'0000u) | static_cast(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 & ~0b1u) | static_cast(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 & ~0b1100u) | static_cast(cbb << 2); } constexpr void iterateBgCtl(auto cb) noexcept { diff --git a/deps/teagba/src/CMakeLists.txt b/deps/teagba/src/CMakeLists.txt index 92fa730a..05477b5a 100644 --- a/deps/teagba/src/CMakeLists.txt +++ b/deps/teagba/src/CMakeLists.txt @@ -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 -) \ No newline at end of file +)