mirror of https://github.com/stella-emu/stella.git
Remove workarounds in pre-C++17 code.
This commit is contained in:
parent
bd2ead8d13
commit
c4354aeeea
|
@ -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<uInt32>(
|
||||
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<uInt32>(
|
||||
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)
|
||||
|
|
|
@ -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<uInt8[]>(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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue