From: Soeren Apel Date: Thu, 31 Dec 2020 19:06:53 +0000 (+0100) Subject: Fix some clang-tidy complaints X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8fa8412e303a3061807facc03b23df6738548115;p=pulseview.git Fix some clang-tidy complaints --- diff --git a/pv/application.cpp b/pv/application.cpp index 3a0ac0f1..a34a6ca7 100644 --- a/pv/application.cpp +++ b/pv/application.cpp @@ -69,7 +69,7 @@ Application::Application(int &argc, char* argv[]) : const QStringList Application::get_languages() const { - QStringList files = QDir(":/l10n/").entryList(QStringList("*.qm"), QDir::Files); + const QStringList files = QDir(":/l10n/").entryList(QStringList("*.qm"), QDir::Files); QStringList result; result << "en"; // Add default language to the set diff --git a/pv/exprtk.hpp b/pv/exprtk.hpp index d1f6cf15..84e35b61 100644 --- a/pv/exprtk.hpp +++ b/pv/exprtk.hpp @@ -416,7 +416,7 @@ namespace exprtk std::string data_; }; - static const std::string reserved_words[] = + const std::string reserved_words[] = { "break", "case", "continue", "default", "false", "for", "if", "else", "ilike", "in", "like", "and", "nand", "nor", @@ -427,7 +427,7 @@ namespace exprtk static const std::size_t reserved_words_size = sizeof(reserved_words) / sizeof(std::string); - static const std::string reserved_symbols[] = + const std::string reserved_symbols[] = { "abs", "acos", "acosh", "and", "asin", "asinh", "atan", "atanh", "atan2", "avg", "break", "case", "ceil", "clamp", @@ -446,7 +446,7 @@ namespace exprtk static const std::size_t reserved_symbols_size = sizeof(reserved_symbols) / sizeof(std::string); - static const std::string base_function_list[] = + const std::string base_function_list[] = { "abs", "acos", "acosh", "asin", "asinh", "atan", "atanh", "atan2", "avg", "ceil", "clamp", "cos", "cosh", "cot", @@ -461,28 +461,28 @@ namespace exprtk static const std::size_t base_function_list_size = sizeof(base_function_list) / sizeof(std::string); - static const std::string logic_ops_list[] = + const std::string logic_ops_list[] = { "and", "nand", "nor", "not", "or", "xnor", "xor", "&", "|" }; static const std::size_t logic_ops_list_size = sizeof(logic_ops_list) / sizeof(std::string); - static const std::string cntrl_struct_list[] = + const std::string cntrl_struct_list[] = { "if", "switch", "for", "while", "repeat", "return" }; static const std::size_t cntrl_struct_list_size = sizeof(cntrl_struct_list) / sizeof(std::string); - static const std::string arithmetic_ops_list[] = + const std::string arithmetic_ops_list[] = { "+", "-", "*", "/", "%", "^" }; static const std::size_t arithmetic_ops_list_size = sizeof(arithmetic_ops_list) / sizeof(std::string); - static const std::string assignment_ops_list[] = + const std::string assignment_ops_list[] = { ":=", "+=", "-=", "*=", "/=", "%=" @@ -490,7 +490,7 @@ namespace exprtk static const std::size_t assignment_ops_list_size = sizeof(assignment_ops_list) / sizeof(std::string); - static const std::string inequality_ops_list[] = + const std::string inequality_ops_list[] = { "<", "<=", "==", "=", "!=", "<>", diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 8e3cb9d1..34938e73 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -669,7 +669,7 @@ void MainWindow::on_run_stop_clicked() vector< shared_ptr > hw_sessions; // Make a list of all sessions where a hardware device is used - for (shared_ptr s : sessions_) { + for (const shared_ptr& s : sessions_) { shared_ptr hw_device = dynamic_pointer_cast< devices::HardwareDevice >(s->device()); if (!hw_device)