diff --git a/src/common/RewindManager.cxx b/src/common/RewindManager.cxx index 044bc57e9..d6d277995 100644 --- a/src/common/RewindManager.cxx +++ b/src/common/RewindManager.cxx @@ -41,18 +41,15 @@ void RewindManager::setup() const string& prefix = myOSystem.settings().getBool("dev.settings") ? "dev." : "plr."; - // Work around a bug in XCode 11.2 with -O0 and -O1 - const uInt32 maxBufSize = MAX_BUF_SIZE; - // TODO - Add proper bounds checking (define constexpr variables for this) // Use those bounds in DeveloperDialog too mySize = std::min( - myOSystem.settings().getInt(prefix + "tm.size"), maxBufSize); + myOSystem.settings().getInt(prefix + "tm.size"), MAX_BUF_SIZE); if(mySize != myStateList.capacity()) resize(mySize); myUncompressed = std::min( - myOSystem.settings().getInt(prefix + "tm.uncompressed"), maxBufSize); + myOSystem.settings().getInt(prefix + "tm.uncompressed"), MAX_BUF_SIZE); myInterval = INTERVAL_CYCLES[0]; for(int i = 0; i < NUM_INTERVALS; ++i) diff --git a/src/emucore/MT24LC256.cxx b/src/emucore/MT24LC256.cxx index ba6d2348b..53004b804 100644 --- a/src/emucore/MT24LC256.cxx +++ b/src/emucore/MT24LC256.cxx @@ -64,11 +64,8 @@ MT24LC256::MT24LC256(const FilesystemNode& eepromfile, const System& system, if(!fileValid) { - // Work around a bug in XCode 11.2 with -O0 and -O1 - const uInt8 initialValue = INITIAL_VALUE; - myData = make_unique(FLASH_SIZE); - std::fill_n(myData.get(), FLASH_SIZE, initialValue); + std::fill_n(myData.get(), FLASH_SIZE, INITIAL_VALUE); myDataChanged = true; } @@ -142,24 +139,18 @@ void MT24LC256::systemReset() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void MT24LC256::eraseAll() { - // Work around a bug in XCode 11.2 with -O0 and -O1 - const uInt8 initialValue = INITIAL_VALUE; - - std::fill_n(myData.get(), FLASH_SIZE, initialValue); + std::fill_n(myData.get(), FLASH_SIZE, INITIAL_VALUE); myDataChanged = true; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void MT24LC256::eraseCurrent() { - // Work around a bug in XCode 11.2 with -O0 and -O1 - const uInt8 initialValue = INITIAL_VALUE; - for(uInt32 page = 0; page < PAGE_NUM; ++page) { if(myPageHit[page]) { - std::fill_n(myData.get() + page * PAGE_SIZE, PAGE_SIZE, initialValue); + std::fill_n(myData.get() + page * PAGE_SIZE, PAGE_SIZE, INITIAL_VALUE); myDataChanged = true; } }