Apply clang-tidy modernize-use-* fixes

This commit is contained in:
2023-05-15 10:56:42 +02:00
parent 77decb70ec
commit 79a54f11f6
10 changed files with 15 additions and 16 deletions

View File

@@ -75,7 +75,7 @@ void DebugManager::openDebugFile(const std::string &filename)
}
DebugManager::DebugManager()
: debugEnabled(false), writeToConsole(false), writeToFile(false)
{
}

View File

@@ -73,9 +73,9 @@ public:
void openDebugFile(const std::string &filename);
private:
bool debugEnabled;
bool writeToConsole;
bool writeToFile;
bool debugEnabled = false;
bool writeToConsole = false;
bool writeToFile = false;
std::ofstream debugFile;
};

View File

@@ -53,7 +53,7 @@ namespace DRAMSys
{
TlmRecorder::TlmRecorder(const std::string& name, const Configuration& config, const std::string& dbName) :
name(name), config(config), memSpec(*config.memSpec), totalNumTransactions(0),
name(name), config(config), memSpec(*config.memSpec),
simulationTimeCoveredByRecording(SC_ZERO_TIME)
{
currentDataBuffer = &recordingDataBuffer[0];

View File

@@ -162,7 +162,7 @@ private:
std::unordered_map<tlm::tlm_generic_payload*, Transaction> currentTransactionsInSystem;
uint64_t totalNumTransactions;
uint64_t totalNumTransactions = 0;
sc_core::sc_time simulationTimeCoveredByRecording;
sqlite3 *db = nullptr;

View File

@@ -75,8 +75,8 @@ MemSpec::MemSpec(const DRAMSys::Config::MemSpec& memSpec,
tCK(sc_time(1.0 / fCKMHz, SC_US)),
memoryId(memSpec.memoryId),
memoryType(memoryType),
burstDuration(tCK* (static_cast<double>(defaultBurstLength) / dataRate)),
memorySizeBytes(0)
burstDuration(tCK* (static_cast<double>(defaultBurstLength) / dataRate))
{
commandLengthInCycles = std::vector<double>(Command::numberOfCommands(), 1);
}

View File

@@ -118,7 +118,7 @@ protected:
// Command lengths in cycles on bus, usually one clock cycle
std::vector<double> commandLengthInCycles;
sc_core::sc_time burstDuration;
uint64_t memorySizeBytes;
uint64_t memorySizeBytes = 0;
};
} // namespace DRAMSys

View File

@@ -65,7 +65,7 @@ RefreshManagerSameBank::RefreshManagerSameBank(const Configuration& config,
}
// allBankMachines: ((0-4-8-12-16-20-24-28), (1-5-9-13-17-21-25-29), ...)
std::list<std::vector<BankMachine *>>::iterator it = allBankMachines.begin();
auto it = allBankMachines.begin();
for (unsigned bankID = 0; bankID < memSpec.banksPerGroup; bankID++)
{
for (unsigned groupID = 0; groupID < memSpec.groupsPerRank; groupID++)

View File

@@ -56,8 +56,7 @@ public:
tlm_utils::simple_target_socket<ReorderBuffer> tSocket;
SC_CTOR(ReorderBuffer) :
payloadEventQueue(this, &ReorderBuffer::peqCallback),
responseIsPendingInInitator(false)
payloadEventQueue(this, &ReorderBuffer::peqCallback)
{
iSocket.register_nb_transport_bw(this, &ReorderBuffer::nb_transport_bw);
tSocket.register_nb_transport_fw(this, &ReorderBuffer::nb_transport_fw);
@@ -68,7 +67,7 @@ private:
std::deque<tlm::tlm_generic_payload*> pendingRequestsInOrder;
std::set<tlm::tlm_generic_payload*> receivedResponses;
bool responseIsPendingInInitator;
bool responseIsPendingInInitator = false;
// Initiated by dram side

View File

@@ -41,7 +41,7 @@
using namespace tlm;
MemoryManager::MemoryManager(bool storageEnabled)
: numberOfAllocations(0), numberOfFrees(0), storageEnabled(storageEnabled)
: storageEnabled(storageEnabled)
{}
MemoryManager::~MemoryManager()

View File

@@ -50,8 +50,8 @@ public:
void free(tlm::tlm_generic_payload* payload) override;
private:
uint64_t numberOfAllocations;
uint64_t numberOfFrees;
uint64_t numberOfAllocations = 0;
uint64_t numberOfFrees = 0;
std::unordered_map<unsigned, std::stack<tlm::tlm_generic_payload*>> freePayloads;
bool storageEnabled = false;
};