From: Marcin Siodelski Date: Fri, 6 Mar 2015 19:55:33 +0000 (+0100) Subject: [3736] Fixed the functionStatic cppcheck errors in multiple places. X-Git-Tag: trac3764_base~14^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69572795fd52d2d6641090480ac329e79b05b2ca;p=thirdparty%2Fkea.git [3736] Fixed the functionStatic cppcheck errors in multiple places. --- diff --git a/src/lib/cc/tests/session_unittests.cc b/src/lib/cc/tests/session_unittests.cc index e3546d2846..81a3c8971c 100644 --- a/src/lib/cc/tests/session_unittests.cc +++ b/src/lib/cc/tests/session_unittests.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2009,2015 Internet Systems Consortium, Inc. ("ISC") // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above @@ -77,9 +77,8 @@ public: acceptor_(io_service_, ep_), socket_(io_service_) { - acceptor_.async_accept(socket_, - boost::bind(&TestDomainSocket::acceptHandler, - this, _1)); + acceptor_.async_accept(socket_, boost::bind(&TestDomainSocket::acceptHandler, + _1)); } ~TestDomainSocket() { @@ -87,7 +86,7 @@ public: unlink(BUNDY_TEST_SOCKET_FILE); } - void acceptHandler(const asio::error_code&) const { + static void acceptHandler(const asio::error_code&) { } void sendmsg(isc::data::ElementPtr& env, isc::data::ElementPtr& msg) { diff --git a/src/lib/dns/messagerenderer.cc b/src/lib/dns/messagerenderer.cc index bc11cb4d83..2c73d657cd 100644 --- a/src/lib/dns/messagerenderer.cc +++ b/src/lib/dns/messagerenderer.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2009,2015 Internet Systems Consortium, Inc. ("ISC") // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above @@ -117,8 +117,8 @@ struct NameCompare { } private: - uint16_t nextPosition(const OutputBuffer& buffer, - uint16_t pos, uint16_t& llen) const + static uint16_t nextPosition(const OutputBuffer& buffer, + uint16_t pos, uint16_t& llen) { if (llen == 0) { size_t i = 0; diff --git a/src/lib/log/tests/logger_manager_unittest.cc b/src/lib/log/tests/logger_manager_unittest.cc index 95e660ea98..c5b036e437 100644 --- a/src/lib/log/tests/logger_manager_unittest.cc +++ b/src/lib/log/tests/logger_manager_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2011,2015 Internet Systems Consortium, Inc. ("ISC") // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above @@ -113,7 +113,7 @@ public: // does not exist, use /tmp. // // \return Temporary file name - std::string createTempFilename() { + static std::string createTempFilename() { string filename = TEMP_DIR + "/kea_logger_manager_test_XXXXXX"; // Copy into writeable storage for the call to mkstemp