Fixed warnings of CppCheck's own code (caused by new check #695)

This commit is contained in:
Jakub Melka 2015-03-08 18:18:09 +01:00
parent 2af9212b16
commit b7d92a4fc7
25 changed files with 28 additions and 28 deletions

View File

@ -33,7 +33,7 @@ class ApplicationList : public QObject {
Q_OBJECT
public:
ApplicationList(QObject *parent = 0);
explicit ApplicationList(QObject *parent = 0);
virtual ~ApplicationList();
/**

View File

@ -30,7 +30,7 @@
*/
class CheckStatistics : public QObject {
public:
CheckStatistics(QObject *parent = NULL);
explicit CheckStatistics(QObject *parent = NULL);
/**
* @brief Add new checked item to statistics.

View File

@ -36,7 +36,7 @@ class Settings;
class CheckThread : public QThread {
Q_OBJECT
public:
CheckThread(ThreadResult &result);
explicit CheckThread(ThreadResult &result);
virtual ~CheckThread();
/**

View File

@ -35,7 +35,7 @@
*/
class CsvReport : public Report {
public:
CsvReport(const QString &filename);
explicit CsvReport(const QString &filename);
virtual ~CsvReport();
/**

View File

@ -57,7 +57,7 @@ public:
class ErrorItem {
public:
ErrorItem();
ErrorItem(const ErrorLine &line);
explicit ErrorItem(const ErrorLine &line);
/**
* @brief Convert error item to string.

View File

@ -32,7 +32,7 @@
class LogView : public QWidget {
Q_OBJECT
public:
LogView(QWidget *parent = 0);
explicit LogView(QWidget *parent = 0);
~LogView();
/**

View File

@ -44,7 +44,7 @@ class Platforms : public QObject {
Q_OBJECT
public:
Platforms(QObject *parent = NULL);
explicit Platforms(QObject *parent = NULL);
void add(const QString &title, Settings::PlatformType platform);
int getCount() const;
void init();

View File

@ -36,7 +36,7 @@ class Project : public QObject {
Q_OBJECT
public:
Project(QWidget *parent = 0);
explicit Project(QWidget *parent = 0);
Project(const QString &filename, QWidget *parent = 0);
~Project();

View File

@ -37,7 +37,7 @@ class ProjectFile : public QObject {
Q_OBJECT
public:
ProjectFile(QObject *parent = 0);
explicit ProjectFile(QObject *parent = 0);
ProjectFile(const QString &filename, QObject *parent = 0);
/**

View File

@ -40,7 +40,7 @@ public:
CSV,
};
Report(const QString &filename);
explicit Report(const QString &filename);
virtual ~Report();
/**

View File

@ -47,7 +47,7 @@ class QItemSelectionModel;
class ResultsTree : public QTreeView {
Q_OBJECT
public:
ResultsTree(QWidget * parent = 0);
explicit ResultsTree(QWidget * parent = 0);
virtual ~ResultsTree();
void Initialize(QSettings *settings, ApplicationList *list);

View File

@ -43,7 +43,7 @@ class ResultsView : public QWidget {
Q_OBJECT
public:
ResultsView(QWidget * parent = 0);
explicit ResultsView(QWidget * parent = 0);
void Initialize(QSettings *settings, ApplicationList *list);
virtual ~ResultsView();

View File

@ -33,7 +33,7 @@ class MainWindow;
class ScratchPad : public QDialog {
Q_OBJECT
public:
ScratchPad(MainWindow& mainWindow);
explicit ScratchPad(MainWindow& mainWindow);
private slots:
/**

View File

@ -35,7 +35,7 @@ class CheckStatistics;
class StatsDialog : public QDialog {
Q_OBJECT
public:
StatsDialog(QWidget *parent = 0);
explicit StatsDialog(QWidget *parent = 0);
/**
* @brief Sets the project to extract statistics from

View File

@ -42,7 +42,7 @@ class Settings;
class ThreadHandler : public QObject {
Q_OBJECT
public:
ThreadHandler(QObject *parent = 0);
explicit ThreadHandler(QObject *parent = 0);
virtual ~ThreadHandler();
/**

View File

@ -61,7 +61,7 @@ struct TranslationInfo {
class TranslationHandler : QObject {
Q_OBJECT
public:
TranslationHandler(QObject *parent = 0);
explicit TranslationHandler(QObject *parent = 0);
virtual ~TranslationHandler();
/**

View File

@ -35,7 +35,7 @@ class TxtReport : public Report {
Q_OBJECT
public:
TxtReport(const QString &filename);
explicit TxtReport(const QString &filename);
virtual ~TxtReport();
/**

View File

@ -35,7 +35,7 @@ class QObject;
*/
class XmlReport : public Report {
public:
XmlReport(const QString &filename);
explicit XmlReport(const QString &filename);
/**
* @brief Read contents of the report file.

View File

@ -35,7 +35,7 @@
*/
class XmlReportV1 : public XmlReport {
public:
XmlReportV1(const QString &filename);
explicit XmlReportV1(const QString &filename);
virtual ~XmlReportV1();
/**

View File

@ -36,7 +36,7 @@
*/
class XmlReportV2 : public XmlReport {
public:
XmlReportV2(const QString &filename);
explicit XmlReportV2(const QString &filename);
virtual ~XmlReportV2();
/**

View File

@ -129,7 +129,7 @@ private:
/** disabled assignment operator and copy constructor */
void operator=(const Check &);
Check(const Check &);
Check(const Check &) = delete;
};
/// @}

View File

@ -33,7 +33,7 @@ class Settings;
class CPPCHECKLIB TokenList {
public:
TokenList(const Settings* settings);
explicit TokenList(const Settings* settings);
~TokenList();
void setSettings(const Settings *settings) {

View File

@ -1567,7 +1567,7 @@ static void valueFlowForLoopSimplify(Token * const bodyStart, const unsigned int
}
if (Token::Match(tok2, "%oror%|&&")) {
const std::map<unsigned int, MathLib::bigint> programMemory(getProgramMemory(tok2->astTop(), varid, value));
const std::map<unsigned int, MathLib::bigint> programMemory(getProgramMemory(tok2->astTop(), varid, ValueFlow::Value(value)));
if ((tok2->str() == "&&" && conditionIsFalse(tok2->astOperand1(), programMemory)) ||
(tok2->str() == "||" && conditionIsTrue(tok2->astOperand1(), programMemory))) {
// Skip second expression..
@ -1584,8 +1584,8 @@ static void valueFlowForLoopSimplify(Token * const bodyStart, const unsigned int
}
}
if ((tok2->str() == "&&" && conditionIsFalse(tok2->astOperand1(), getProgramMemory(tok2->astTop(), varid, value))) ||
(tok2->str() == "||" && conditionIsTrue(tok2->astOperand1(), getProgramMemory(tok2->astTop(), varid, value))))
if ((tok2->str() == "&&" && conditionIsFalse(tok2->astOperand1(), getProgramMemory(tok2->astTop(), varid, ValueFlow::Value(value)))) ||
(tok2->str() == "||" && conditionIsTrue(tok2->astOperand1(), getProgramMemory(tok2->astTop(), varid, ValueFlow::Value(value)))))
break;
else if (Token::simpleMatch(tok2, ") {") && Token::findmatch(tok2->link(), "%varid%", tok2, varid)) {
@ -1630,7 +1630,7 @@ static void valueFlowForLoopSimplifyAfter(Token *fortok, unsigned int varid, con
endToken = fortok->scope()->classEnd;
std::list<ValueFlow::Value> values;
values.push_back(num);
values.push_back(ValueFlow::Value(num));
valueFlowForward(fortok->linkAt(1)->linkAt(1)->next(),
endToken,

View File

@ -30,7 +30,7 @@ class Settings;
namespace ValueFlow {
class Value {
public:
Value(long long val = 0) : intvalue(val), tokvalue(nullptr), varvalue(val), condition(0), varId(0U), conditional(false), inconclusive(false), defaultArg(false) {}
explicit Value(long long val = 0) : intvalue(val), tokvalue(nullptr), varvalue(val), condition(0), varId(0U), conditional(false), inconclusive(false), defaultArg(false) {}
Value(const Token *c, long long val) : intvalue(val), tokvalue(nullptr), varvalue(val), condition(c), varId(0U), conditional(false), inconclusive(false), defaultArg(false) {}
/** int value */

View File

@ -74,7 +74,7 @@ public:
void warn(const char msg[]) const;
void warnUnsimplified(const std::string& unsimplified, const std::string& simplified);
TestFixture(const std::string &_name);
explicit TestFixture(const std::string &_name);
virtual ~TestFixture() { }
static std::size_t runTests(const options& args);