Skip to content

Commit ce50df8

Browse files
IOBYTEdanmar
authored andcommitted
Fix override warnings. (danmar#1234)
1 parent 6bd4bdb commit ce50df8

File tree

93 files changed

+204
-204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+204
-204
lines changed

cli/cppcheckexecutor.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ class CppCheckExecutor : public ErrorLogger {
6969
*
7070
* @param outmsg Progress message e.g. "Checking main.cpp..."
7171
*/
72-
virtual void reportOut(const std::string &outmsg);
72+
virtual void reportOut(const std::string &outmsg) override;
7373

7474
/** xml output of errors */
75-
virtual void reportErr(const ErrorLogger::ErrorMessage &msg);
75+
virtual void reportErr(const ErrorLogger::ErrorMessage &msg) override;
7676

77-
void reportProgress(const std::string &filename, const char stage[], const std::size_t value);
77+
void reportProgress(const std::string &filename, const char stage[], const std::size_t value) override;
7878

7979
/**
8080
* Output information messages.
8181
*/
82-
virtual void reportInfo(const ErrorLogger::ErrorMessage &msg);
82+
virtual void reportInfo(const ErrorLogger::ErrorMessage &msg) override;
8383

8484
/**
8585
* Information about how many files have been checked

cli/threadexecutor.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ class ThreadExecutor : public ErrorLogger {
4949
virtual ~ThreadExecutor();
5050
unsigned int check();
5151

52-
virtual void reportOut(const std::string &outmsg);
53-
virtual void reportErr(const ErrorLogger::ErrorMessage &msg);
54-
virtual void reportInfo(const ErrorLogger::ErrorMessage &msg);
52+
virtual void reportOut(const std::string &outmsg) override;
53+
virtual void reportErr(const ErrorLogger::ErrorMessage &msg) override;
54+
virtual void reportInfo(const ErrorLogger::ErrorMessage &msg) override;
5555

5656
/**
5757
* @brief Add content to a file, to be used in unit testing.

gui/csvreport.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,23 @@ class CsvReport : public Report {
4242
* @brief Create the report (file).
4343
* @return true if succeeded, false if file could not be created.
4444
*/
45-
virtual bool create();
45+
virtual bool create() override;
4646

4747
/**
4848
* @brief Write report header.
4949
*/
50-
virtual void writeHeader();
50+
virtual void writeHeader() override;
5151

5252
/**
5353
* @brief Write report footer.
5454
*/
55-
virtual void writeFooter();
55+
virtual void writeFooter() override;
5656

5757
/**
5858
* @brief Write error to report.
5959
* @param error Error data.
6060
*/
61-
virtual void writeError(const ErrorItem &error);
61+
virtual void writeError(const ErrorItem &error) override;
6262

6363
private:
6464

gui/printablereport.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,23 @@ class PrintableReport : public Report {
3838
* @brief Create the report (file).
3939
* @return true if succeeded, false if file could not be created.
4040
*/
41-
virtual bool create();
41+
virtual bool create() override;
4242

4343
/**
4444
* @brief Write report header.
4545
*/
46-
virtual void writeHeader();
46+
virtual void writeHeader() override;
4747

4848
/**
4949
* @brief Write report footer.
5050
*/
51-
virtual void writeFooter();
51+
virtual void writeFooter() override;
5252

5353
/**
5454
* @brief Write error to report.
5555
* @param error Error data.
5656
*/
57-
virtual void writeError(const ErrorItem &error);
57+
virtual void writeError(const ErrorItem &error) override;
5858

5959
/**
6060
* @brief Returns the formatted report.

gui/test/benchmark/simple/benchmarksimple.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ private slots:
3131
private:
3232
// Empty implementations of ErrorLogger methods.
3333
// We don't care about the output in the benchmark tests.
34-
void reportOut(const std::string & outmsg) {
34+
void reportOut(const std::string & outmsg) override {
3535
}
36-
void reportErr(const ErrorLogger::ErrorMessage &msg) {
36+
void reportErr(const ErrorLogger::ErrorMessage &msg) override {
3737
}
3838
};

gui/threadresult.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ class ThreadResult : public QObject, public ErrorLogger {
7272
/**
7373
* ErrorLogger methods
7474
*/
75-
void reportOut(const std::string &outmsg);
76-
void reportErr(const ErrorLogger::ErrorMessage &msg);
75+
void reportOut(const std::string &outmsg) override;
76+
void reportErr(const ErrorLogger::ErrorMessage &msg) override;
7777

7878
public slots:
7979

gui/txtreport.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,23 @@ class TxtReport : public Report {
4242
* @brief Create the report (file).
4343
* @return true if succeeded, false if file could not be created.
4444
*/
45-
virtual bool create();
45+
virtual bool create() override;
4646

4747
/**
4848
* @brief Write report header.
4949
*/
50-
virtual void writeHeader();
50+
virtual void writeHeader() override;
5151

5252
/**
5353
* @brief Write report footer.
5454
*/
55-
virtual void writeFooter();
55+
virtual void writeFooter() override;
5656

5757
/**
5858
* @brief Write error to report.
5959
* @param error Error data.
6060
*/
61-
virtual void writeError(const ErrorItem &error);
61+
virtual void writeError(const ErrorItem &error) override;
6262

6363
private:
6464

gui/xmlreportv2.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,33 +43,33 @@ class XmlReportV2 : public XmlReport {
4343
* @brief Create the report (file).
4444
* @return true if succeeded, false if file could not be created.
4545
*/
46-
virtual bool create();
46+
virtual bool create() override;
4747

4848
/**
4949
* @brief Open existing report file.
5050
*/
51-
bool open();
51+
virtual bool open() override;
5252

5353
/**
5454
* @brief Write report header.
5555
*/
56-
virtual void writeHeader();
56+
virtual void writeHeader() override;
5757

5858
/**
5959
* @brief Write report footer.
6060
*/
61-
virtual void writeFooter();
61+
virtual void writeFooter() override;
6262

6363
/**
6464
* @brief Write error to report.
6565
* @param error Error data.
6666
*/
67-
virtual void writeError(const ErrorItem &error);
67+
virtual void writeError(const ErrorItem &error) override;
6868

6969
/**
7070
* @brief Read contents of the report file.
7171
*/
72-
virtual QList<ErrorItem> read();
72+
virtual QList<ErrorItem> read() override;
7373

7474
protected:
7575
/**

lib/check64bit.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ class CPPCHECKLIB Check64BitPortability : public Check {
5252
}
5353

5454
/** @brief Run checks against the normal token list */
55-
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
55+
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
5656
Check64BitPortability check64BitPortability(tokenizer, settings, errorLogger);
5757
check64BitPortability.pointerassignment();
5858
}
5959

6060
/** @brief Run checks against the simplified token list */
61-
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
61+
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
6262
(void)tokenizer;
6363
(void)settings;
6464
(void)errorLogger;
@@ -74,7 +74,7 @@ class CPPCHECKLIB Check64BitPortability : public Check {
7474
void returnIntegerError(const Token *tok);
7575
void returnPointerError(const Token *tok);
7676

77-
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
77+
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
7878
Check64BitPortability c(nullptr, settings, errorLogger);
7979
c.assignmentAddressToIntegerError(nullptr);
8080
c.assignmentIntegerToAddressError(nullptr);
@@ -86,7 +86,7 @@ class CPPCHECKLIB Check64BitPortability : public Check {
8686
return "64-bit portability";
8787
}
8888

89-
std::string classInfo() const {
89+
std::string classInfo() const override {
9090
return "Check if there is 64-bit portability issues:\n"
9191
"- assign address to/from int/long\n"
9292
"- casting address from/to integer when returning from function\n";

lib/checkassert.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class CPPCHECKLIB CheckAssert : public Check {
4949
: Check(myName(), tokenizer, settings, errorLogger) {
5050
}
5151

52-
virtual void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
52+
virtual void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
5353
CheckAssert check(tokenizer, settings, errorLogger);
5454
check.assertWithSideEffects();
5555
}
@@ -64,7 +64,7 @@ class CPPCHECKLIB CheckAssert : public Check {
6464
void sideEffectInAssertError(const Token *tok, const std::string& functionName);
6565
void assignmentInAssertError(const Token *tok, const std::string &varname);
6666

67-
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
67+
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
6868
CheckAssert c(nullptr, settings, errorLogger);
6969
c.sideEffectInAssertError(nullptr, "function");
7070
c.assignmentInAssertError(nullptr, "var");
@@ -74,7 +74,7 @@ class CPPCHECKLIB CheckAssert : public Check {
7474
return "Assert";
7575
}
7676

77-
std::string classInfo() const {
77+
std::string classInfo() const override {
7878
return "Warn if there are side effects in assert statements (since this cause different behaviour in debug/release builds).\n";
7979
}
8080
};

0 commit comments

Comments
 (0)