clang-tidy: remove else after break and continue
This commit is contained in:
parent
1b0c7bca5e
commit
b26577c92a
@ -2222,7 +2222,8 @@ void cmCTestCoverageHandler::LoadLabels(const char* dir)
|
|||||||
if (line.empty() || line[0] == '#') {
|
if (line.empty() || line[0] == '#') {
|
||||||
// Ignore blank and comment lines.
|
// Ignore blank and comment lines.
|
||||||
continue;
|
continue;
|
||||||
} else if (line[0] == ' ') {
|
}
|
||||||
|
if (line[0] == ' ') {
|
||||||
// Label lines appear indented by one space.
|
// Label lines appear indented by one space.
|
||||||
std::string label = line.substr(1);
|
std::string label = line.substr(1);
|
||||||
int id = this->GetLabelId(label);
|
int id = this->GetLabelId(label);
|
||||||
|
@ -306,7 +306,8 @@ void cmCTestLaunch::LoadLabels()
|
|||||||
if (line.empty() || line[0] == '#') {
|
if (line.empty() || line[0] == '#') {
|
||||||
// Ignore blank and comment lines.
|
// Ignore blank and comment lines.
|
||||||
continue;
|
continue;
|
||||||
} else if (line[0] == ' ') {
|
}
|
||||||
|
if (line[0] == ' ') {
|
||||||
// Label lines appear indented by one space.
|
// Label lines appear indented by one space.
|
||||||
if (inTarget || inSource) {
|
if (inTarget || inSource) {
|
||||||
this->Labels.insert(line.c_str() + 1);
|
this->Labels.insert(line.c_str() + 1);
|
||||||
|
@ -46,7 +46,8 @@ public:
|
|||||||
beginSet.push_back("begin");
|
beginSet.push_back("begin");
|
||||||
coverageVector.push_back(-1);
|
coverageVector.push_back(-1);
|
||||||
continue;
|
continue;
|
||||||
} else if (line.find('{') != line.npos) {
|
}
|
||||||
|
if (line.find('{') != line.npos) {
|
||||||
blockComFlag = true;
|
blockComFlag = true;
|
||||||
} else if (line.find('}') != line.npos) {
|
} else if (line.find('}') != line.npos) {
|
||||||
blockComFlag = false;
|
blockComFlag = false;
|
||||||
|
@ -159,7 +159,8 @@ void cmCursesLongMessageForm::HandleInput()
|
|||||||
// quit
|
// quit
|
||||||
if (key == 'o' || key == 'e') {
|
if (key == 'o' || key == 'e') {
|
||||||
break;
|
break;
|
||||||
} else if (key == KEY_DOWN || key == ctrl('n')) {
|
}
|
||||||
|
if (key == KEY_DOWN || key == ctrl('n')) {
|
||||||
form_driver(this->Form, REQ_SCR_FLINE);
|
form_driver(this->Form, REQ_SCR_FLINE);
|
||||||
} else if (key == KEY_UP || key == ctrl('p')) {
|
} else if (key == KEY_UP || key == ctrl('p')) {
|
||||||
form_driver(this->Form, REQ_SCR_BLINE);
|
form_driver(this->Form, REQ_SCR_BLINE);
|
||||||
|
@ -764,9 +764,8 @@ void cmCursesMainForm::HandleInput()
|
|||||||
// quit
|
// quit
|
||||||
if (key == 'q') {
|
if (key == 'q') {
|
||||||
break;
|
break;
|
||||||
} else {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentField = current_field(this->Form);
|
currentField = current_field(this->Form);
|
||||||
@ -826,7 +825,7 @@ void cmCursesMainForm::HandleInput()
|
|||||||
// (index always corresponds to the value field)
|
// (index always corresponds to the value field)
|
||||||
// scroll down with arrow down, ctrl+n (emacs binding), or j (vim
|
// scroll down with arrow down, ctrl+n (emacs binding), or j (vim
|
||||||
// binding)
|
// binding)
|
||||||
else if (key == KEY_DOWN || key == ctrl('n') || key == 'j') {
|
if (key == KEY_DOWN || key == ctrl('n') || key == 'j') {
|
||||||
FIELD* cur = current_field(this->Form);
|
FIELD* cur = current_field(this->Form);
|
||||||
size_t findex = field_index(cur);
|
size_t findex = field_index(cur);
|
||||||
if (findex == 3 * this->NumberOfVisibleEntries - 1) {
|
if (findex == 3 * this->NumberOfVisibleEntries - 1) {
|
||||||
|
@ -32,7 +32,8 @@ bool cmAddSubDirectoryCommand::InitialPass(
|
|||||||
if (*i == "EXCLUDE_FROM_ALL") {
|
if (*i == "EXCLUDE_FROM_ALL") {
|
||||||
excludeFromAll = true;
|
excludeFromAll = true;
|
||||||
continue;
|
continue;
|
||||||
} else if (binArg.empty()) {
|
}
|
||||||
|
if (binArg.empty()) {
|
||||||
binArg = *i;
|
binArg = *i;
|
||||||
} else {
|
} else {
|
||||||
this->SetError("called with incorrect number of arguments");
|
this->SetError("called with incorrect number of arguments");
|
||||||
|
@ -613,7 +613,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ((c >= 0x20 && c < 0x7F) || c == '\t' ||
|
if ((c >= 0x20 && c < 0x7F) || c == '\t' ||
|
||||||
(c == '\n' && newline_consume)) {
|
(c == '\n' && newline_consume)) {
|
||||||
// This is an ASCII character that may be part of a string.
|
// This is an ASCII character that may be part of a string.
|
||||||
// Cast added to avoid compiler warning. Cast is ok because
|
// Cast added to avoid compiler warning. Cast is ok because
|
||||||
|
@ -3933,15 +3933,14 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
|
|||||||
<< theTarget->GetName() << "\".\n";
|
<< theTarget->GetName() << "\".\n";
|
||||||
cmSystemTools::Error(e.str().c_str());
|
cmSystemTools::Error(e.str().c_str());
|
||||||
break;
|
break;
|
||||||
} else {
|
}
|
||||||
propContent = consistent.second;
|
propContent = consistent.second;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Explicitly set on target and not set in iface. Can't disagree.
|
// Explicitly set on target and not set in iface. Can't disagree.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else if (impliedByUse) {
|
if (impliedByUse) {
|
||||||
propContent = impliedValue<PropertyType>(propContent);
|
propContent = impliedValue<PropertyType>(propContent);
|
||||||
|
|
||||||
if (ifaceIsSet) {
|
if (ifaceIsSet) {
|
||||||
@ -3959,15 +3958,13 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
|
|||||||
<< "\" is in conflict.\n";
|
<< "\" is in conflict.\n";
|
||||||
cmSystemTools::Error(e.str().c_str());
|
cmSystemTools::Error(e.str().c_str());
|
||||||
break;
|
break;
|
||||||
} else {
|
}
|
||||||
propContent = consistent.second;
|
propContent = consistent.second;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Implicitly set on target and not set in iface. Can't disagree.
|
// Implicitly set on target and not set in iface. Can't disagree.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (ifaceIsSet) {
|
if (ifaceIsSet) {
|
||||||
if (propInitialized) {
|
if (propInitialized) {
|
||||||
std::pair<bool, PropertyType> consistent =
|
std::pair<bool, PropertyType> consistent =
|
||||||
@ -3977,27 +3974,22 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
|
|||||||
if (!consistent.first) {
|
if (!consistent.first) {
|
||||||
std::ostringstream e;
|
std::ostringstream e;
|
||||||
e << "The INTERFACE_" << p << " property of \""
|
e << "The INTERFACE_" << p << " property of \""
|
||||||
<< theTarget->GetName() << "\" does\nnot agree with the value "
|
<< theTarget->GetName() << "\" does\nnot agree with the value of "
|
||||||
"of "
|
<< p << " already determined\nfor \"" << tgt->GetName() << "\".\n";
|
||||||
<< p << " already determined\nfor \"" << tgt->GetName()
|
|
||||||
<< "\".\n";
|
|
||||||
cmSystemTools::Error(e.str().c_str());
|
cmSystemTools::Error(e.str().c_str());
|
||||||
break;
|
break;
|
||||||
} else {
|
}
|
||||||
propContent = consistent.second;
|
propContent = consistent.second;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
report += reportEntry + "(Interface set)\n";
|
report += reportEntry + "(Interface set)\n";
|
||||||
propContent = ifacePropContent;
|
propContent = ifacePropContent;
|
||||||
propInitialized = true;
|
propInitialized = true;
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// Not set. Nothing to agree on.
|
// Not set. Nothing to agree on.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
tgt->ReportPropertyOrigin(p, valueAsString<PropertyType>(propContent),
|
tgt->ReportPropertyOrigin(p, valueAsString<PropertyType>(propContent),
|
||||||
report, compatibilityType(t));
|
report, compatibilityType(t));
|
||||||
|
@ -188,9 +188,8 @@ protected:
|
|||||||
if (qstart == std::string::npos) {
|
if (qstart == std::string::npos) {
|
||||||
cmSystemTools::Error("unknown include directive ", line.c_str());
|
cmSystemTools::Error("unknown include directive ", line.c_str());
|
||||||
continue;
|
continue;
|
||||||
} else {
|
|
||||||
qend = line.find('>', qstart + 1);
|
|
||||||
}
|
}
|
||||||
|
qend = line.find('>', qstart + 1);
|
||||||
} else {
|
} else {
|
||||||
qend = line.find('\"', qstart + 1);
|
qend = line.find('\"', qstart + 1);
|
||||||
}
|
}
|
||||||
|
@ -96,15 +96,15 @@ void cmRST::ProcessModule(std::istream& is)
|
|||||||
if (line == "#") {
|
if (line == "#") {
|
||||||
this->ProcessLine("");
|
this->ProcessLine("");
|
||||||
continue;
|
continue;
|
||||||
} else if (line.substr(0, 2) == "# ") {
|
}
|
||||||
|
if (line.substr(0, 2) == "# ") {
|
||||||
this->ProcessLine(line.substr(2, line.npos));
|
this->ProcessLine(line.substr(2, line.npos));
|
||||||
continue;
|
continue;
|
||||||
} else {
|
}
|
||||||
rst = "";
|
rst = "";
|
||||||
this->Reset();
|
this->Reset();
|
||||||
this->OutputLinePending = true;
|
this->OutputLinePending = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (line == "#.rst:") {
|
if (line == "#.rst:") {
|
||||||
rst = "#";
|
rst = "#";
|
||||||
} else if (this->ModuleRST.find(line)) {
|
} else if (this->ModuleRST.find(line)) {
|
||||||
|
@ -32,9 +32,8 @@ bool cmSetTargetPropertiesCommand::InitialPass(
|
|||||||
}
|
}
|
||||||
propertyPairs.insert(propertyPairs.end(), j, args.end());
|
propertyPairs.insert(propertyPairs.end(), j, args.end());
|
||||||
break;
|
break;
|
||||||
} else {
|
|
||||||
numFiles++;
|
|
||||||
}
|
}
|
||||||
|
numFiles++;
|
||||||
}
|
}
|
||||||
if (propertyPairs.empty()) {
|
if (propertyPairs.empty()) {
|
||||||
this->SetError("called with illegal arguments, maybe missing "
|
this->SetError("called with illegal arguments, maybe missing "
|
||||||
|
@ -32,9 +32,8 @@ bool cmSetTestsPropertiesCommand::InitialPass(
|
|||||||
}
|
}
|
||||||
propertyPairs.insert(propertyPairs.end(), j, args.end());
|
propertyPairs.insert(propertyPairs.end(), j, args.end());
|
||||||
break;
|
break;
|
||||||
} else {
|
|
||||||
numFiles++;
|
|
||||||
}
|
}
|
||||||
|
numFiles++;
|
||||||
}
|
}
|
||||||
if (propertyPairs.empty()) {
|
if (propertyPairs.empty()) {
|
||||||
this->SetError("called with illegal arguments, maybe "
|
this->SetError("called with illegal arguments, maybe "
|
||||||
|
@ -1667,7 +1667,8 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
|
|||||||
for (; outiter != out.end(); ++outiter) {
|
for (; outiter != out.end(); ++outiter) {
|
||||||
if ((*outiter == '\r') && ((outiter + 1) == out.end())) {
|
if ((*outiter == '\r') && ((outiter + 1) == out.end())) {
|
||||||
break;
|
break;
|
||||||
} else if (*outiter == '\n' || *outiter == '\0') {
|
}
|
||||||
|
if (*outiter == '\n' || *outiter == '\0') {
|
||||||
std::vector<char>::size_type length = outiter - out.begin();
|
std::vector<char>::size_type length = outiter - out.begin();
|
||||||
if (length > 1 && *(outiter - 1) == '\r') {
|
if (length > 1 && *(outiter - 1) == '\r') {
|
||||||
--length;
|
--length;
|
||||||
@ -1684,7 +1685,8 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
|
|||||||
for (; erriter != err.end(); ++erriter) {
|
for (; erriter != err.end(); ++erriter) {
|
||||||
if ((*erriter == '\r') && ((erriter + 1) == err.end())) {
|
if ((*erriter == '\r') && ((erriter + 1) == err.end())) {
|
||||||
break;
|
break;
|
||||||
} else if (*erriter == '\n' || *erriter == '\0') {
|
}
|
||||||
|
if (*erriter == '\n' || *erriter == '\0') {
|
||||||
std::vector<char>::size_type length = erriter - err.begin();
|
std::vector<char>::size_type length = erriter - err.begin();
|
||||||
if (length > 1 && *(erriter - 1) == '\r') {
|
if (length > 1 && *(erriter - 1) == '\r') {
|
||||||
--length;
|
--length;
|
||||||
@ -2583,7 +2585,7 @@ bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg,
|
|||||||
it = dentries.erase(it);
|
it = dentries.erase(it);
|
||||||
entriesErased++;
|
entriesErased++;
|
||||||
continue;
|
continue;
|
||||||
} else {
|
}
|
||||||
if (cmELF::TagMipsRldMapRel != 0 &&
|
if (cmELF::TagMipsRldMapRel != 0 &&
|
||||||
it->first == cmELF::TagMipsRldMapRel) {
|
it->first == cmELF::TagMipsRldMapRel) {
|
||||||
// Background: debuggers need to know the "linker map" which contains
|
// Background: debuggers need to know the "linker map" which contains
|
||||||
@ -2606,7 +2608,6 @@ bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg,
|
|||||||
|
|
||||||
it++;
|
it++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Encode new entries list
|
// Encode new entries list
|
||||||
bytes = elf.EncodeDynamicEntries(dentries);
|
bytes = elf.EncodeDynamicEntries(dentries);
|
||||||
|
@ -1450,7 +1450,8 @@ bool cmVSLink::Parse(std::vector<std::string>::const_iterator argBeg,
|
|||||||
if (*arg == "--") {
|
if (*arg == "--") {
|
||||||
++arg;
|
++arg;
|
||||||
break;
|
break;
|
||||||
} else if (*arg == "--manifests") {
|
}
|
||||||
|
if (*arg == "--manifests") {
|
||||||
for (++arg; arg != argEnd && !cmHasLiteralPrefix(*arg, "-"); ++arg) {
|
for (++arg; arg != argEnd && !cmHasLiteralPrefix(*arg, "-"); ++arg) {
|
||||||
this->UserManifests.push_back(*arg);
|
this->UserManifests.push_back(*arg);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user