summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-06-10 16:36:24 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-06-10 16:36:24 (GMT)
commita16bf141bc5d393b27d13d8235d95a1b034052c2 (patch)
tree59ecd625114f6e98065e7901f418a28fc540cd45 /Tests
parentbd9e551c1a13f566e6ffe8cdd1262b7628ed5330 (diff)
downloadCMake-a16bf141bc5d393b27d13d8235d95a1b034052c2.zip
CMake-a16bf141bc5d393b27d13d8235d95a1b034052c2.tar.gz
CMake-a16bf141bc5d393b27d13d8235d95a1b034052c2.tar.bz2
Add missing braces around statements.
Apply fixits of clang-tidy's readability-braces-around-statements checker.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in12
-rw-r--r--Tests/CMakeLib/run_compile_commands.cxx15
2 files changed, 17 insertions, 10 deletions
diff --git a/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in b/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in
index 9958021..e2cdec8 100644
--- a/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in
+++ b/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in
@@ -15,15 +15,15 @@ int main(int ac, char** av)
std::string logarg;
bool nextarg = false;
- if (exename.find("valgrind") != exename.npos)
+ if (exename.find("valgrind") != exename.npos) {
logarg = "--log-file=";
- else if (exename.find("purify") != exename.npos)
+ } else if (exename.find("purify") != exename.npos) {
#ifdef _WIN32
logarg = "/SAVETEXTDATA=";
#else
logarg = "-log-file=";
#endif
- else if (exename.find("BC") != exename.npos) {
+ } else if (exename.find("BC") != exename.npos) {
nextarg = true;
logarg = "/X";
}
@@ -34,8 +34,9 @@ int main(int ac, char** av)
std::string arg = argv[i];
if (arg.find(logarg) == 0) {
if (nextarg) {
- if (i == argc - 1)
+ if (i == argc - 1) {
return 1; // invalid command line
+ }
logfile = argv[i + 1];
} else {
logfile = arg.substr(logarg.length());
@@ -44,8 +45,9 @@ int main(int ac, char** av)
}
}
- if (!logfile.empty())
+ if (!logfile.empty()) {
cmSystemTools::Touch(logfile, true);
+ }
}
return RETVAL;
diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx
index 1cfd381..b811c7f 100644
--- a/Tests/CMakeLib/run_compile_commands.cxx
+++ b/Tests/CMakeLib/run_compile_commands.cxx
@@ -46,10 +46,12 @@ private:
void ParseTranslationUnit()
{
this->Command = CommandType();
- if (!Expect('{'))
+ if (!Expect('{')) {
return;
- if (Expect('}'))
+ }
+ if (Expect('}')) {
return;
+ }
do {
ParseString();
std::string name = this->String;
@@ -64,8 +66,9 @@ private:
void ParseString()
{
this->String = "";
- if (!Expect('"'))
+ if (!Expect('"')) {
return;
+ }
while (!Expect('"')) {
Expect('\\');
this->String.append(1, C);
@@ -84,8 +87,9 @@ private:
void ExpectOrDie(char c, const std::string& message)
{
- if (!Expect(c))
+ if (!Expect(c)) {
ErrorExit(std::string("'") + c + "' expected " + message + ".");
+ }
}
void NextNonWhitespace()
@@ -98,8 +102,9 @@ private:
void Next()
{
this->C = char(Input->get());
- if (this->Input->bad())
+ if (this->Input->bad()) {
ErrorExit("Unexpected end of file.");
+ }
}
void ErrorExit(const std::string& message)