diff options
author | Quipyowert2 <38995150+Quipyowert2@users.noreply.github.com> | 2019-03-06 22:14:05 -0800 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2019-03-07 22:32:16 +0300 |
commit | 28c874cab7e1b272bf111150f691d6348fae1f2a (patch) | |
tree | 564fed7a30921fdbc9f51fc7e22ef3f73ce825f3 | |
parent | 3a7fc8e3bf44b97fc584a295ead0534900851b0b (diff) | |
download | paranucker-28c874cab7e1b272bf111150f691d6348fae1f2a.tar.gz paranucker-28c874cab7e1b272bf111150f691d6348fae1f2a.tar.bz2 paranucker-28c874cab7e1b272bf111150f691d6348fae1f2a.tar.xz paranucker-28c874cab7e1b272bf111150f691d6348fae1f2a.zip |
Pass some strings by const&.
This fixes a few warnings generated by Cppcheck 1.87.
-rw-r--r-- | src/analysis/checks.cpp | 4 | ||||
-rw-r--r-- | src/analysis/reports.cpp | 4 | ||||
-rw-r--r-- | src/analysis/reports.h | 4 | ||||
-rw-r--r-- | src/parsers/generic.cpp | 2 | ||||
-rw-r--r-- | src/parsers/generic.h | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/src/analysis/checks.cpp b/src/analysis/checks.cpp index 96a4631..fb1abad 100644 --- a/src/analysis/checks.cpp +++ b/src/analysis/checks.cpp @@ -67,8 +67,8 @@ std::string mergeCollection(const std::set<std::string> &col) void reportCollections(Node *node, const std::string &name, - std::set<std::string> col1, - std::set<std::string> col2) + const std::set<std::string>& col1, + const std::set<std::string>& col2) { std::string str1 = mergeCollection(col1); std::string str2 = mergeCollection(col2); diff --git a/src/analysis/reports.cpp b/src/analysis/reports.cpp index ddc78bb..c870d11 100644 --- a/src/analysis/reports.cpp +++ b/src/analysis/reports.cpp @@ -214,8 +214,8 @@ void reportWrongCheck(Node *node) void reportCollectionsDifferent(Node *node, const std::string &name, - std::string str1, - std::string str2) + const std::string& str1, + const std::string& str2) { std::string str = "internal collections '%s' is different.\nwant: " + str2 + diff --git a/src/analysis/reports.h b/src/analysis/reports.h index 7f65fb8..ab14435 100644 --- a/src/analysis/reports.h +++ b/src/analysis/reports.h @@ -59,8 +59,8 @@ namespace Analysis void reportCollectionsDifferent(Node *node, const std::string &name, - std::string str1, - std::string str2); + const std::string& str1, + const std::string& str2); } #endif // ANALYSIS_REPORTS_H diff --git a/src/parsers/generic.cpp b/src/parsers/generic.cpp index fd74e49..b263c6d 100644 --- a/src/parsers/generic.cpp +++ b/src/parsers/generic.cpp @@ -35,7 +35,7 @@ namespace Generic Node *createParseNode(Node *parent, tree gccNode, - std::string tag, + const std::string& tag, int parseChilds) { return createParseNode(parent, diff --git a/src/parsers/generic.h b/src/parsers/generic.h index 305c249..5477188 100644 --- a/src/parsers/generic.h +++ b/src/parsers/generic.h @@ -44,7 +44,7 @@ namespace Generic Node *createParseNode(Node *parent, tree gccNode, - std::string tag = "", + const std::string& tag = "", int parseChilds = INT_MAX); Node *createParseNode(Node *parent, |