From: Marcin Siodelski Date: Tue, 13 Sep 2016 13:51:10 +0000 (+0200) Subject: [3161] Pass values by reference as indicated by cpp-check. X-Git-Tag: trac5006_base~2^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=05df64b34c9d046ea4a6bc00286f594e0b99200e;p=thirdparty%2Fkea.git [3161] Pass values by reference as indicated by cpp-check. --- diff --git a/src/lib/eval/tests/token_unittest.cc b/src/lib/eval/tests/token_unittest.cc index d344a06b3b..4a20ca9740 100644 --- a/src/lib/eval/tests/token_unittest.cc +++ b/src/lib/eval/tests/token_unittest.cc @@ -352,7 +352,8 @@ public: /// create the option) /// @param expected_result text representation of the expected outcome void testVendorExists(Option::Universe u, uint32_t token_vendor_id, - uint32_t option_vendor_id, std::string expected_result) { + uint32_t option_vendor_id, + const std::string& expected_result) { // Let's clear any old values, so we can run multiple cases in each test clearStack(); @@ -375,7 +376,7 @@ public: /// create the option) /// @param expected_result text representation of the expected outcome void testVendorEnterprise(Option::Universe u, uint32_t option_vendor_id, - std::string expected_result) { + const std::string& expected_result) { // Let's clear any old values, so we can run multiple cases in each test clearStack(); @@ -394,7 +395,7 @@ public: /// create the option) /// @param expected_result text representation of the expected outcome void testVendorClassEnterprise(Option::Universe u, uint32_t option_vendor_id, - std::string expected_result) { + const std::string& expected_result) { // Let's clear any old values, so we can run multiple cases in each test clearStack(); @@ -414,7 +415,8 @@ public: /// create the option) /// @param expected_result text representation of the expected outcome void testVendorClassExists(Option::Universe u, uint32_t token_vendor_id, - uint32_t option_vendor_id, std::string expected_result) { + uint32_t option_vendor_id, + const std::string& expected_result) { // Let's clear any old values, so we can run multiple cases in each test clearStack(); @@ -441,7 +443,8 @@ public: void testVendorSuboption(Option::Universe u, uint32_t token_vendor_id, uint16_t token_option_code, uint32_t option_vendor_id, uint16_t option_code, - TokenOption::RepresentationType repr, std::string expected) { + TokenOption::RepresentationType repr, + const std::string& expected) { // Let's clear any old values, so we can run multiple cases in each test clearStack(); @@ -471,7 +474,7 @@ public: void testVendorClassData(Option::Universe u, uint32_t token_vendor_id, uint16_t token_index, uint32_t option_vendor_id, uint16_t data_tuples, - std::string expected) { + const std::string& expected) { // Let's clear any old values, so we can run multiple cases in each test clearStack(); diff --git a/tools/system_messages.cc b/tools/system_messages.cc index 74e5171b42..1e022de76e 100644 --- a/tools/system_messages.cc +++ b/tools/system_messages.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -246,7 +246,7 @@ std::string replaceShell(const std::string& src, char c, /// @brief Replace blank lines /// Replaces blank lines in an array with the contents of the 'blank' section. -LinesType replaceBlankLines(const LinesType lines) +LinesType replaceBlankLines(const LinesType& lines) { LinesType result; for (LinesType::const_iterator l = lines.begin(); l != lines.end(); ++l) {