Warnings eliminated.
Variables initialized. Variables removed with small changes in the code accordingly. Some warnings suppressed with __attribute__((unused)).
This commit is contained in:
@@ -41,7 +41,7 @@ std::string phaseNameToString(tlm::tlm_phase phase)
|
||||
|
||||
unsigned int queryUIntParameter(XMLElement* node, string name)
|
||||
{
|
||||
int result;
|
||||
int result = 0;
|
||||
XMLElement* element;
|
||||
for (element = node->FirstChildElement("parameter"); element != NULL;
|
||||
element = element->NextSiblingElement("parameter"))
|
||||
@@ -49,8 +49,7 @@ unsigned int queryUIntParameter(XMLElement* node, string name)
|
||||
if (element->Attribute("id") == name)
|
||||
{
|
||||
sc_assert(!strcmp(element->Attribute("type"), "uint"));
|
||||
XMLError error = element->QueryIntAttribute("value", &result);
|
||||
sc_assert(!error);
|
||||
sc_assert(element->QueryIntAttribute("value", &result) == XML_NO_ERROR);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -75,7 +74,7 @@ bool parameterExists(tinyxml2::XMLElement* node, std::string name)
|
||||
|
||||
double queryDoubleParameter(XMLElement* node, string name)
|
||||
{
|
||||
double result;
|
||||
double result = 0;
|
||||
XMLElement* element;
|
||||
for (element = node->FirstChildElement("parameter"); element != NULL;
|
||||
element = element->NextSiblingElement("parameter"))
|
||||
@@ -83,8 +82,7 @@ double queryDoubleParameter(XMLElement* node, string name)
|
||||
if (element->Attribute("id") == name)
|
||||
{
|
||||
sc_assert(!strcmp(element->Attribute("type"), "double"));
|
||||
XMLError error = element->QueryDoubleAttribute("value", &result);
|
||||
sc_assert(!error);
|
||||
sc_assert(element->QueryDoubleAttribute("value", &result) == XML_NO_ERROR);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -95,7 +93,7 @@ double queryDoubleParameter(XMLElement* node, string name)
|
||||
|
||||
bool queryBoolParameter(XMLElement* node, string name)
|
||||
{
|
||||
bool result;
|
||||
bool result = false;
|
||||
XMLElement* element;// = node->FirstChildElement("parameter");
|
||||
for (element = node->FirstChildElement("parameter"); element != NULL;
|
||||
element = element->NextSiblingElement("parameter"))
|
||||
@@ -103,8 +101,7 @@ bool queryBoolParameter(XMLElement* node, string name)
|
||||
if (element->Attribute("id") == name)
|
||||
{
|
||||
sc_assert(!strcmp(element->Attribute("type"), "bool"));
|
||||
XMLError error = element->QueryBoolAttribute("value", &result);
|
||||
sc_assert(!error);
|
||||
sc_assert(element->QueryBoolAttribute("value", &result) == XML_NO_ERROR);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -151,7 +148,7 @@ string errorToString(XMLError error)
|
||||
case XML_ERROR_PARSING: return "ERROR_PARSING";
|
||||
case XML_CAN_NOT_CONVERT_TEXT: return "CAN_NOT_CONVERT_TEXT";
|
||||
case XML_NO_TEXT_NODE: return "NO_TEXT_NODE";
|
||||
default: "";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ bool RefreshManager::hasCollision(const ScheduledCommand& command)
|
||||
return command.getStart() < controllerCore.state.getLastCommand(Command::AutoRefresh).getEnd() || command.getEnd() > nextPlannedRefresh;
|
||||
}
|
||||
|
||||
void RefreshManager::scheduleRefresh(tlm::tlm_generic_payload& payload, sc_time time)
|
||||
void RefreshManager::scheduleRefresh(tlm::tlm_generic_payload& payload __attribute((unused)), sc_time time)
|
||||
{
|
||||
sc_assert(!isInvalidated(payload, time));
|
||||
|
||||
@@ -78,7 +78,7 @@ void RefreshManager::reInitialize(Bank /*bank*/, sc_time time)
|
||||
planNextRefresh();
|
||||
}
|
||||
|
||||
bool RefreshManager::isInvalidated(tlm::tlm_generic_payload& payload, sc_time time)
|
||||
bool RefreshManager::isInvalidated(tlm::tlm_generic_payload& payload __attribute((unused)), sc_time time)
|
||||
{
|
||||
return nextPlannedRefresh > time;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ sc_time WriteChecker::writeToWrite(ScheduledCommand& firstWrite, ScheduledComman
|
||||
return max(tCCD, getWriteAccessTime());
|
||||
}
|
||||
|
||||
sc_time WriteChecker::readToWrite(ScheduledCommand& read, ScheduledCommand& write)
|
||||
sc_time WriteChecker::readToWrite(ScheduledCommand& read __attribute__((unused)), ScheduledCommand& write __attribute__((unused)))
|
||||
{
|
||||
sc_assert(read.getCommand() == Command::Read || read.getCommand() == Command::ReadA);
|
||||
sc_assert(write.getCommand() == Command::Write || write.getCommand() == Command::WriteA);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
Simulation::Simulation(sc_module_name __attribute__((__unused__)) name, string pathToResources, string traceName, DramSetup setup,
|
||||
Simulation::Simulation(sc_module_name __attribute__((unused)) name, string pathToResources, string traceName, DramSetup setup,
|
||||
std::vector<Device> devices) :
|
||||
traceName(traceName), dramSetup(setup)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user