From 3458da8445b4ab46a4fa0885c5fd255a531b99be Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Fri, 30 Dec 2022 18:34:12 -0330 Subject: [PATCH] Remove FIXME for string_view conversion. --- src/emucore/Cart.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/emucore/Cart.cxx b/src/emucore/Cart.cxx index 1a0c87c35..31906fa1a 100644 --- a/src/emucore/Cart.cxx +++ b/src/emucore/Cart.cxx @@ -30,12 +30,10 @@ Cartridge::Cartridge(const Settings& settings, string_view md5) : mySettings{settings} { - const auto to_uInt32 = [](string_view s, uInt32 pos) { - return static_cast(std::stoul(string{s.substr(pos, 8)}, nullptr, 16)); - }; // FIXME: convert to string_view by replacing std::stoul + const uInt32 seed = + BSPF::stoi<16>(md5.substr(0, 8)) ^ BSPF::stoi<16>(md5.substr(8, 8)) ^ + BSPF::stoi<16>(md5.substr(16, 8)) ^ BSPF::stoi<16>(md5.substr(24, 8)); - const uInt32 seed = to_uInt32(md5, 0) ^ to_uInt32(md5, 8) ^ - to_uInt32(md5, 16) ^ to_uInt32(md5, 24); const Random rand(seed); for(uInt32 i = 0; i < 256; ++i) myRWPRandomValues[i] = rand.next();