diff options
author | Oleksandr Koval <oleksandr.koval.dev@gmail.com> | 2021-01-05 12:32:36 (GMT) |
---|---|---|
committer | Oleksandr Koval <oleksandr.koval.dev@gmail.com> | 2021-01-05 12:32:36 (GMT) |
commit | 209daa20b2bd2ee2a76e70af58e895647f7e284f (patch) | |
tree | 081f3192927b19325f40c0da459a11e5b5a5784b /Tests | |
parent | 764ce15ffbe232347a41e40509a2e485bae226f6 (diff) | |
download | CMake-209daa20b2bd2ee2a76e70af58e895647f7e284f.zip CMake-209daa20b2bd2ee2a76e70af58e895647f7e284f.tar.gz CMake-209daa20b2bd2ee2a76e70af58e895647f7e284f.tar.bz2 |
Code style: add missed explicit 'this->'
CMake uses explicit 'this->' style. Using custom clang-tidy check we can
detect and fix places where 'this->' was missed.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLib/run_compile_commands.cxx | 50 | ||||
-rw-r--r-- | Tests/CMakeLib/testCMExtMemory.cxx | 4 |
2 files changed, 27 insertions, 27 deletions
diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx index 2c77acc..0fd6cfb 100644 --- a/Tests/CMakeLib/run_compile_commands.cxx +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -36,8 +36,8 @@ public: void Parse() { - NextNonWhitespace(); - ParseTranslationUnits(); + this->NextNonWhitespace(); + this->ParseTranslationUnits(); } const TranslationUnitsType& GetTranslationUnits() @@ -49,51 +49,51 @@ private: void ParseTranslationUnits() { this->TranslationUnits = TranslationUnitsType(); - ExpectOrDie('[', "at start of compile command file\n"); + this->ExpectOrDie('[', "at start of compile command file\n"); do { - ParseTranslationUnit(); + this->ParseTranslationUnit(); this->TranslationUnits.push_back(this->Command); - } while (Expect(',')); - ExpectOrDie(']', "at end of array"); + } while (this->Expect(',')); + this->ExpectOrDie(']', "at end of array"); } void ParseTranslationUnit() { this->Command = CommandType(); - if (!Expect('{')) { + if (!this->Expect('{')) { return; } - if (Expect('}')) { + if (this->Expect('}')) { return; } do { - ParseString(); + this->ParseString(); std::string name = this->String; - ExpectOrDie(':', "between name and value"); - ParseString(); + this->ExpectOrDie(':', "between name and value"); + this->ParseString(); std::string value = this->String; this->Command[name] = value; - } while (Expect(',')); - ExpectOrDie('}', "at end of object"); + } while (this->Expect(',')); + this->ExpectOrDie('}', "at end of object"); } void ParseString() { this->String = ""; - if (!Expect('"')) { + if (!this->Expect('"')) { return; } - while (!Expect('"')) { - Expect('\\'); - this->String.append(1, C); - Next(); + while (!this->Expect('"')) { + this->Expect('\\'); + this->String.append(1, this->C); + this->Next(); } } bool Expect(char c) { if (this->C == c) { - NextNonWhitespace(); + this->NextNonWhitespace(); return true; } return false; @@ -101,23 +101,23 @@ private: void ExpectOrDie(char c, const std::string& message) { - if (!Expect(c)) { - ErrorExit(std::string("'") + c + "' expected " + message + "."); + if (!this->Expect(c)) { + this->ErrorExit(std::string("'") + c + "' expected " + message + "."); } } void NextNonWhitespace() { do { - Next(); - } while (IsWhitespace()); + this->Next(); + } while (this->IsWhitespace()); } void Next() { - this->C = char(Input.get()); + this->C = char(this->Input.get()); if (this->Input.bad()) { - ErrorExit("Unexpected end of file."); + this->ErrorExit("Unexpected end of file."); } } diff --git a/Tests/CMakeLib/testCMExtMemory.cxx b/Tests/CMakeLib/testCMExtMemory.cxx index 2aeaf7f..d8932ce 100644 --- a/Tests/CMakeLib/testCMExtMemory.cxx +++ b/Tests/CMakeLib/testCMExtMemory.cxx @@ -26,9 +26,9 @@ public: : value(v) { } - ~Wrapper() { delete value; } + ~Wrapper() { delete this->value; } - T* get() const { return value; } + T* get() const { return this->value; } private: T* value; |