Work around what looks like a bug in XCode 11.2 in -O0 and -O1.

This commit is contained in:
Christian Speckner 2019-12-08 20:52:22 +01:00
parent 8d68aaece1
commit 34e0b4bcc7
2 changed files with 12 additions and 5 deletions

View File

@ -40,16 +40,17 @@ void RewindManager::setup()
myLastTimeMachineAdd = false; myLastTimeMachineAdd = false;
const string& prefix = myOSystem.settings().getBool("dev.settings") ? "dev." : "plr."; const string& prefix = myOSystem.settings().getBool("dev.settings") ? "dev." : "plr.";
const uInt32 maxBufSize = MAX_BUF_SIZE;
// TODO - Add proper bounds checking (define constexpr variables for this) // TODO - Add proper bounds checking (define constexpr variables for this)
// Use those bounds in DeveloperDialog too // Use those bounds in DeveloperDialog too
mySize = std::min<uInt32>( mySize = std::min<uInt32>(
myOSystem.settings().getInt(prefix + "tm.size"), MAX_BUF_SIZE); myOSystem.settings().getInt(prefix + "tm.size"), maxBufSize);
if(mySize != myStateList.capacity()) if(mySize != myStateList.capacity())
resize(mySize); resize(mySize);
myUncompressed = std::min<uInt32>( myUncompressed = std::min<uInt32>(
myOSystem.settings().getInt(prefix + "tm.uncompressed"), MAX_BUF_SIZE); myOSystem.settings().getInt(prefix + "tm.uncompressed"), maxBufSize);
myInterval = INTERVAL_CYCLES[0]; myInterval = INTERVAL_CYCLES[0];
for(int i = 0; i < NUM_INTERVALS; ++i) for(int i = 0; i < NUM_INTERVALS; ++i)

View File

@ -156,18 +156,22 @@ void MT24LC256::systemReset()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void MT24LC256::eraseAll() void MT24LC256::eraseAll()
{ {
myData.fill(INITIAL_VALUE); const uInt8 initialValue = INITIAL_VALUE;
myData.fill(initialValue);
myDataChanged = true; myDataChanged = true;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void MT24LC256::eraseCurrent() void MT24LC256::eraseCurrent()
{ {
const uInt8 initialValue = INITIAL_VALUE;
for(uInt32 page = 0; page < PAGE_NUM; ++page) for(uInt32 page = 0; page < PAGE_NUM; ++page)
{ {
if(myPageHit[page]) if(myPageHit[page])
{ {
std::fill_n(myData.begin() + page * PAGE_SIZE, PAGE_SIZE, INITIAL_VALUE); std::fill_n(myData.begin() + page * PAGE_SIZE, PAGE_SIZE, initialValue);
myDataChanged = true; myDataChanged = true;
} }
} }
@ -185,6 +189,8 @@ bool MT24LC256::isPageUsed(uInt32 page) const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void MT24LC256::jpee_init() void MT24LC256::jpee_init()
{ {
const uInt8 initialValue = INITIAL_VALUE;
jpee_sdat = 1; jpee_sdat = 1;
jpee_address = 0; jpee_address = 0;
jpee_state=0; jpee_state=0;
@ -193,7 +199,7 @@ void MT24LC256::jpee_init()
jpee_smallmode = 0; jpee_smallmode = 0;
jpee_logmode = -1; jpee_logmode = -1;
if(!myDataFileExists) if(!myDataFileExists)
myData.fill(INITIAL_VALUE); myData.fill(initialValue);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -