]> sigrok.org Git - pulseview.git/commitdiff
Fix some clang-tidy complaints
authorSoeren Apel <redacted>
Thu, 31 Dec 2020 19:06:53 +0000 (20:06 +0100)
committerSoeren Apel <redacted>
Thu, 31 Dec 2020 19:31:51 +0000 (20:31 +0100)
pv/application.cpp
pv/exprtk.hpp
pv/mainwindow.cpp

index 3a0ac0f13a5dc7986ca737615d9858998f775055..a34a6ca758350671e37a3d8a92ddf195e1e52ede 100644 (file)
@@ -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
index d1f6cf1520d02fa4b98aa4bc867ecc44039763ca..84e35b61ffc152ef754638acb9a12e0647ab9267 100644 (file)
@@ -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[] =
                                   {
                                      "<",  "<=", "==",
                                      "=",  "!=", "<>",
index 8e3cb9d1085f9c72588c519dc74e9e5bbb8b8179..34938e7364cb5d827670558d903be0f6426fe0c0 100644 (file)
@@ -669,7 +669,7 @@ void MainWindow::on_run_stop_clicked()
                vector< shared_ptr<Session> > hw_sessions;
 
                // Make a list of all sessions where a hardware device is used
-               for (shared_ptr<Session> s : sessions_) {
+               for (const shared_ptr<Session>& s : sessions_) {
                        shared_ptr<devices::HardwareDevice> hw_device =
                                        dynamic_pointer_cast< devices::HardwareDevice >(s->device());
                        if (!hw_device)