8000 Enable clang-tidy concurrency checks by ahojnnes · Pull Request #1967 · colmap/colmap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Enable clang-tidy concurrency checks #1967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Checks: >
performance-*,
concurrency-*,
WarningsAsErrors: '*'
FormatStyle: 'file'
User: 'user'
2 changes: 2 additions & 0 deletions src/colmap/ui/main_window.cc
Original file line number Diff line number Di 8000 ff line change
Expand Up @@ -41,7 +41,9 @@ MainWindow::MainWindow(const OptionManager& options)
: options_(options),
thread_control_widget_(new ThreadControlWidget(this)),
window_closed_(false) {
// NOLINTNEXTLINE(concurrency-mt-unsafe)
std::setlocale(LC_NUMERIC, "C");

resize(1024, 600);
UpdateWindowTitle();

Expand Down
5 changes: 5 additions & 0 deletions src/colmap/util/option_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -855,12 +855,14 @@ void OptionManager::Parse(const int argc, char** argv) {
<< std::endl
<< std::endl;
std::cout << *desc_ << std::endl;
// NOLINTNEXTLINE(concurrency-mt-unsafe)
exit(EXIT_SUCCESS);
}

if (vmap.count("project_path")) {
*project_path = vmap["project_path"].as<std::string>();
if (!Read(*project_path)) {
// NOLINTNEXTLINE(concurrency-mt-unsafe)
exit(EXIT_FAILURE);
}
} else {
Expand All @@ -869,15 +871,18 @@ void OptionManager::Parse(const int argc, char** argv) {
} catch (std::exception& exc) {
std::cerr << "ERROR: Failed to parse options - " << exc.what() << "."
<< std::endl;
// NOLINTNEXTLINE(concurrency-mt-unsafe)
exit(EXIT_FAILURE);
} catch (...) {
std::cerr << "ERROR: Failed to parse options for unknown reason."
<< std::endl;
// NOLINTNEXTLINE(concurrency-mt-unsafe)
exit(EXIT_FAILURE);
}

if (!Check()) {
std::cerr << "ERROR: Invalid options provided." << std::endl;
// NOLINTNEXTLINE(concurrency-mt-unsafe)
exit(EXIT_FAILURE);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/colmap/util/sqlite3_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ inline int SQLite3CallHelper(const int result_code,
filename.c_str(),
line_number,
sqlite3_errstr(result_code));
exit(EXIT_FAILURE);
throw std::runtime_error("SQLite error");
}
}

Expand Down
0