Explorar o código

arm_test_common: Get rid of truncation warnings

Explicitly cast the value to a u8 to show that this is intentional.
Lioncash %!s(int64=8) %!d(string=hai) anos
pai
achega
48733744bb
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      src/tests/core/arm/arm_test_common.cpp

+ 5 - 2
src/tests/core/arm/arm_test_common.cpp

@@ -65,10 +65,13 @@ boost::optional<bool> TestEnvironment::TestMemory::IsValidAddress(VAddr addr) {
 }
 
 boost::optional<u8> TestEnvironment::TestMemory::Read8(VAddr addr) {
-    auto iter = data.find(addr);
+    const auto iter = data.find(addr);
+
     if (iter == data.end()) {
-        return addr; // Some arbitrary data
+        // Some arbitrary data
+        return static_cast<u8>(addr);
     }
+
     return iter->second;
 }