mirror of https://github.com/stella-emu/stella.git
Remove workarounds in pre-C++17 code.
This commit is contained in:
parent
8b1a0e47aa
commit
0716ccc56e
|
@ -41,18 +41,15 @@ void RewindManager::setup()
|
||||||
|
|
||||||
const string& prefix = myOSystem.settings().getBool("dev.settings") ? "dev." : "plr.";
|
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)
|
// 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"), maxBufSize);
|
myOSystem.settings().getInt(prefix + "tm.size"), MAX_BUF_SIZE);
|
||||||
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"), maxBufSize);
|
myOSystem.settings().getInt(prefix + "tm.uncompressed"), MAX_BUF_SIZE);
|
||||||
|
|
||||||
myInterval = INTERVAL_CYCLES[0];
|
myInterval = INTERVAL_CYCLES[0];
|
||||||
for(int i = 0; i < NUM_INTERVALS; ++i)
|
for(int i = 0; i < NUM_INTERVALS; ++i)
|
||||||
|
|
|
@ -64,11 +64,8 @@ MT24LC256::MT24LC256(const FilesystemNode& eepromfile, const System& system,
|
||||||
|
|
||||||
if(!fileValid)
|
if(!fileValid)
|
||||||
{
|
{
|
||||||
// Work around a bug in XCode 11.2 with -O0 and -O1
|
|
||||||
const uInt8 initialValue = INITIAL_VALUE;
|
|
||||||
|
|
||||||
myData = make_unique<uInt8[]>(FLASH_SIZE);
|
myData = make_unique<uInt8[]>(FLASH_SIZE);
|
||||||
std::fill_n(myData.get(), FLASH_SIZE, initialValue);
|
std::fill_n(myData.get(), FLASH_SIZE, INITIAL_VALUE);
|
||||||
myDataChanged = true;
|
myDataChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,24 +139,18 @@ void MT24LC256::systemReset()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void MT24LC256::eraseAll()
|
void MT24LC256::eraseAll()
|
||||||
{
|
{
|
||||||
// Work around a bug in XCode 11.2 with -O0 and -O1
|
std::fill_n(myData.get(), FLASH_SIZE, INITIAL_VALUE);
|
||||||
const uInt8 initialValue = INITIAL_VALUE;
|
|
||||||
|
|
||||||
std::fill_n(myData.get(), FLASH_SIZE, initialValue);
|
|
||||||
myDataChanged = true;
|
myDataChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void MT24LC256::eraseCurrent()
|
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)
|
for(uInt32 page = 0; page < PAGE_NUM; ++page)
|
||||||
{
|
{
|
||||||
if(myPageHit[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;
|
myDataChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue