Suggested fixes from clang-tidy.

This commit is contained in:
Stephen Anthony 2022-10-08 20:33:59 -02:30
parent 6fb5903fcc
commit 1001fdae14
3 changed files with 9 additions and 9 deletions

View File

@ -2342,7 +2342,7 @@ void DebuggerParser::executeTimer()
for(uInt32 i = 0; i < argCount; ++i)
{
if(static_cast<uInt32>(args[i]) >= std::max(0x80u, romBankCount - 1))
if(static_cast<uInt32>(args[i]) >= std::max(0x80U, romBankCount - 1))
{
if(numAddrs == 2)
{
@ -2367,7 +2367,7 @@ void DebuggerParser::executeTimer()
}
}
uInt32 idx;
uInt32 idx = 0;
if(numAddrs < 2)
{
idx = debugger.m6502().addTimer(addr[0], bank[0], mirrors, anyBank);

View File

@ -84,8 +84,8 @@ uInt32 TimerMap::add(uInt16 addr, uInt8 bank, bool mirrors, bool anyBank)
// complete a partial timer:
Timer& tmPartial = myList[idx];
TimerPoint tpFrom = tmPartial.from;
bool oldMirrors = tmPartial.mirrors;
bool oldAnyBank = tmPartial.anyBank;
const bool oldMirrors = tmPartial.mirrors;
const bool oldAnyBank = tmPartial.anyBank;
tmPartial.setTo(tp, mirrors, anyBank);
toKey(tp, tmPartial.mirrors, tmPartial.anyBank);
@ -153,8 +153,8 @@ void TimerMap::clear()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TimerMap::reset()
{
for(auto it = myList.begin(); it != myList.end(); ++it)
it->reset();
for(auto& it: myList)
it.reset();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -163,7 +163,7 @@ void TimerMap::update(uInt16 addr, uInt8 bank, const uInt64 cycles)
if((addr & ADDRESS_MASK) != addr)
{
// 13 bit timerpoint
TimerPoint tp(addr & ADDRESS_MASK, bank);
const TimerPoint tp(addr & ADDRESS_MASK, bank);
// Find address in from and to maps
const auto from = myFromMap.equal_range(tp);
@ -178,7 +178,7 @@ void TimerMap::update(uInt16 addr, uInt8 bank, const uInt64 cycles)
}
// 16 bit timerpoint
TimerPoint tp(addr, bank);
const TimerPoint tp(addr, bank);
// Find address in from and to maps
const auto from = myFromMap.equal_range(tp);

View File

@ -207,7 +207,7 @@ class TimerMap
const uInt64 cycles);
private:
void toKey(TimerPoint& tp, bool mirrors, bool anyBank);
static void toKey(TimerPoint& tp, bool mirrors, bool anyBank);
private:
using TimerList = std::deque<Timer>; // makes sure that the element pointers do NOT change