forked from qt-creator/qt-creator
Callgrind: Use member initializers and nullptr
Change-Id: I5e873e79a36a7bcd88260a3e42d3f66622f69cb4 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
a69ae41fbe
commit
bc9de45213
@@ -45,12 +45,7 @@ class ParseData::Private {
|
||||
Q_DECLARE_TR_FUNCTIONS(Valgrind::Callgrind::ParseData)
|
||||
public:
|
||||
Private(ParseData *q)
|
||||
: m_pid(0)
|
||||
, m_lineNumberPositionIndex(-1)
|
||||
, m_part(0)
|
||||
, m_version(0)
|
||||
, m_cycleCacheValid(false)
|
||||
, m_q(q)
|
||||
: m_q(q)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -61,11 +56,11 @@ public:
|
||||
QVector<quint64> m_totalCosts;
|
||||
QVector<const Function *> m_functions;
|
||||
QString m_command;
|
||||
quint64 m_pid;
|
||||
int m_lineNumberPositionIndex;
|
||||
uint m_part;
|
||||
int m_version;
|
||||
bool m_cycleCacheValid;
|
||||
quint64 m_pid = 0;
|
||||
int m_lineNumberPositionIndex = -1;
|
||||
uint m_part = 0;
|
||||
int m_version = 0;
|
||||
bool m_cycleCacheValid = false;
|
||||
QStringList m_descriptions;
|
||||
QString m_creator;
|
||||
|
||||
|
||||
@@ -139,16 +139,7 @@ class Parser::Private
|
||||
public:
|
||||
|
||||
explicit Private(Parser *qq)
|
||||
: q(qq),
|
||||
addressValuesCount(0),
|
||||
costValuesCount(0),
|
||||
data(0),
|
||||
currentFunction(0),
|
||||
lastObject(-1),
|
||||
lastFile(-1),
|
||||
currentDifferingFile(-1),
|
||||
isParsingFunctionCall(false),
|
||||
callsCount(0)
|
||||
: q(qq)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -174,30 +165,22 @@ public:
|
||||
void parseCalledSourceFile(const char *begin, const char *end);
|
||||
void parseCalledObjectFile(const char *begin, const char *end);
|
||||
|
||||
int addressValuesCount;
|
||||
int costValuesCount;
|
||||
int addressValuesCount = 0;
|
||||
int costValuesCount = 0;
|
||||
|
||||
ParseData *data;
|
||||
Function *currentFunction;
|
||||
qint64 lastObject;
|
||||
qint64 lastFile;
|
||||
qint64 currentDifferingFile;
|
||||
ParseData *data = nullptr;
|
||||
Function *currentFunction = nullptr;
|
||||
qint64 lastObject = -1;
|
||||
qint64 lastFile = -1;
|
||||
qint64 currentDifferingFile = -1;
|
||||
|
||||
bool isParsingFunctionCall;
|
||||
quint64 callsCount;
|
||||
bool isParsingFunctionCall = false;
|
||||
quint64 callsCount = 0;
|
||||
struct CallData {
|
||||
CallData()
|
||||
: calledFunction(-1)
|
||||
, calledObject(-1)
|
||||
, calledFile(-1)
|
||||
, call(0)
|
||||
{
|
||||
}
|
||||
|
||||
qint64 calledFunction;
|
||||
qint64 calledObject;
|
||||
qint64 calledFile;
|
||||
FunctionCall *call;
|
||||
qint64 calledFunction = -1;
|
||||
qint64 calledObject = -1;
|
||||
qint64 calledFile = -1;
|
||||
FunctionCall *call = nullptr;
|
||||
};
|
||||
CallData currentCallData;
|
||||
QVector<quint64> callDestinations;
|
||||
@@ -217,7 +200,7 @@ void Parser::Private::parse(QIODevice *device)
|
||||
// be sure to clean up existing data before re-allocating
|
||||
// the callee might not have taken the parse data
|
||||
delete data;
|
||||
data = 0;
|
||||
data = nullptr;
|
||||
|
||||
data = new ParseData;
|
||||
parseHeader(device);
|
||||
|
||||
Reference in New Issue
Block a user