Skip to content

Commit ff2b767

Browse files
committed
fix ci
1 parent defdfc0 commit ff2b767

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/selfcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
122122
- name: Self check (unusedFunction / no test / no gui)
123123
run: |
124-
supprs="--suppress=unusedFunction:lib/errorlogger.h:197 --suppress=unusedFunction:lib/importproject.cpp:1671 --suppress=unusedFunction:lib/importproject.cpp:1695"
124+
supprs="--suppress=unusedFunction:lib/errorlogger.h:197 --suppress=unusedFunction:lib/importproject.cpp:1695 --suppress=unusedFunction:lib/importproject.cpp:1719"
125125
./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib -D__CPPCHECK__ -D__GNUC__ --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output.notest_nogui/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr $supprs
126126
env:
127127
DISABLE_VALUEFLOW: 1

lib/importproject.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -543,33 +543,36 @@ bool ImportProject::importSlnx(const std::string& filename, const std::vector<st
543543
auto processProject = [&](const tinyxml2::XMLElement* projectNode) {
544544
const char* pathAttribute = projectNode->Attribute("Path");
545545
if (pathAttribute == nullptr)
546-
return;
546+
return true;
547547

548548
std::string vcxproj(pathAttribute);
549549
vcxproj = Path::toNativeSeparators(std::move(vcxproj));
550550

551551
if (Path::getFilenameExtensionInLowerCase(vcxproj) != ".vcxproj")
552-
return; // skip other project types
552+
return true; // skip other project types
553553

554554
if (!Path::isAbsolute(vcxproj))
555555
vcxproj = variables["SolutionDir"] + vcxproj;
556556

557557
vcxproj = Path::fromNativeSeparators(std::move(vcxproj));
558558
if (!importVcxproj(vcxproj, variables, "", fileFilters, sharedItemsProjects)) {
559559
errors.emplace_back("failed to load '" + vcxproj + "' from Visual Studio solution");
560-
return;
560+
return false;
561561
}
562562
found = true;
563+
return true;
563564
};
564565

565566
for (const tinyxml2::XMLElement* node = rootnode->FirstChildElement(); node; node = node->NextSiblingElement()) {
566567
const char* name = node->Name();
567568
if (std::strcmp(name, "Project") == 0) {
568-
processProject(node);
569+
if (!processProject(node))
570+
return false;
569571
} else if (std::strcmp(name, "Folder") == 0) {
570572
for (const tinyxml2::XMLElement* childNode = node->FirstChildElement(); childNode; childNode = childNode->NextSiblingElement()) {
571573
if (std::strcmp(childNode->Name(), "Project") == 0) {
572-
processProject(childNode);
574+
if (!processProject(childNode))
575+
return false;
573576
}
574577
}
575578
}

0 commit comments

Comments
 (0)