From: Mukund Sivaraman Date: Wed, 29 Jan 2014 16:40:40 +0000 (+0530) Subject: [3312] Pass variables by reference (cppcheck report, etc.) X-Git-Tag: bind10-1.2.0beta1-release~73^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bbee45a49834b3e89a9afaf05acd98f1b6b3b76e;p=thirdparty%2Fkea.git [3312] Pass variables by reference (cppcheck report, etc.) --- diff --git a/src/lib/datasrc/memory/zone_data_loader.cc b/src/lib/datasrc/memory/zone_data_loader.cc index e796dd4fcd..ddf6a1974a 100644 --- a/src/lib/datasrc/memory/zone_data_loader.cc +++ b/src/lib/datasrc/memory/zone_data_loader.cc @@ -69,7 +69,7 @@ typedef boost::function LoadCallback; class ZoneDataLoader : boost::noncopyable { public: ZoneDataLoader(util::MemorySegment& mem_sgmt, - const isc::dns::RRClass rrclass, + const isc::dns::RRClass& rrclass, const isc::dns::Name& zone_name, ZoneData& zone_data) : updater_(mem_sgmt, rrclass, zone_name, zone_data) {} diff --git a/src/lib/datasrc/memory/zone_data_updater.h b/src/lib/datasrc/memory/zone_data_updater.h index e8826bdd5c..5a45be43f9 100644 --- a/src/lib/datasrc/memory/zone_data_updater.h +++ b/src/lib/datasrc/memory/zone_data_updater.h @@ -67,7 +67,7 @@ public: /// on the given memory segment. Currently, at most one zone data /// updater may exist on the same memory segment. ZoneDataUpdater(util::MemorySegment& mem_sgmt, - isc::dns::RRClass rrclass, + const isc::dns::RRClass& rrclass, const isc::dns::Name& zone_name, ZoneData& zone_data) : mem_sgmt_(mem_sgmt), diff --git a/src/lib/datasrc/tests/database_unittest.cc b/src/lib/datasrc/tests/database_unittest.cc index 19d664f437..17bf7ba4c7 100644 --- a/src/lib/datasrc/tests/database_unittest.cc +++ b/src/lib/datasrc/tests/database_unittest.cc @@ -1683,7 +1683,7 @@ findTestCommon(ZoneFinder& finder, const isc::dns::Name& name, const isc::dns::RRType& type, ConstZoneFinderContextPtr actual_result, const isc::dns::RRType& expected_type, - const isc::dns::RRTTL expected_ttl, + const isc::dns::RRTTL& expected_ttl, ZoneFinder::Result expected_result, const std::vector& expected_rdatas, const std::vector& expected_sig_rdatas, @@ -1737,7 +1737,7 @@ doFindTest(ZoneFinder& finder, const isc::dns::Name& name, const isc::dns::RRType& type, const isc::dns::RRType& expected_type, - const isc::dns::RRTTL expected_ttl, + const isc::dns::RRTTL& expected_ttl, ZoneFinder::Result expected_result, const std::vector& expected_rdatas, const std::vector& expected_sig_rdatas, @@ -1758,7 +1758,7 @@ doFindAtOriginTest(ZoneFinder& finder, const isc::dns::Name& origin, const isc::dns::RRType& type, const isc::dns::RRType& expected_type, - const isc::dns::RRTTL expected_ttl, + const isc::dns::RRTTL& expected_ttl, ZoneFinder::Result expected_result, const std::vector& expected_rdatas, const std::vector& expected_sig_rdatas, @@ -1781,7 +1781,7 @@ doFindAtOriginTest(ZoneFinder& finder, void doFindAllTestResult(ZoneFinder& finder, const isc::dns::Name& name, ZoneFinder::Result expected_result, - const isc::dns::RRType expected_type, + const isc::dns::RRType& expected_type, std::vector expected_rdata, const isc::dns::Name& expected_name = isc::dns::Name::ROOT_NAME(), diff --git a/src/lib/dhcp/iface_mgr.h b/src/lib/dhcp/iface_mgr.h index 5a26c5deb8..f6a861f948 100644 --- a/src/lib/dhcp/iface_mgr.h +++ b/src/lib/dhcp/iface_mgr.h @@ -1022,7 +1022,7 @@ private: /// error occurs during opening a socket, or NULL if exception should /// be thrown upon error. bool openMulticastSocket(Iface& iface, - const isc::asiolink::IOAddress addr, + const isc::asiolink::IOAddress& addr, const uint16_t port, IfaceMgrErrorMsgCallback error_handler = NULL); diff --git a/src/lib/dhcp/iface_mgr_bsd.cc b/src/lib/dhcp/iface_mgr_bsd.cc index cf6c3e2772..7a01228256 100644 --- a/src/lib/dhcp/iface_mgr_bsd.cc +++ b/src/lib/dhcp/iface_mgr_bsd.cc @@ -152,7 +152,7 @@ IfaceMgr::setMatchingPacketFilter(const bool /* direct_response_desired */) { bool IfaceMgr::openMulticastSocket(Iface& iface, - const isc::asiolink::IOAddress addr, + const isc::asiolink::IOAddress& addr, const uint16_t port, IfaceMgrErrorMsgCallback error_handler) { try { diff --git a/src/lib/dhcp/iface_mgr_linux.cc b/src/lib/dhcp/iface_mgr_linux.cc index eaa625eb7d..f4b0613dd8 100644 --- a/src/lib/dhcp/iface_mgr_linux.cc +++ b/src/lib/dhcp/iface_mgr_linux.cc @@ -536,7 +536,7 @@ bool IfaceMgr::os_receive4(struct msghdr&, Pkt4Ptr&) { bool IfaceMgr::openMulticastSocket(Iface& iface, - const isc::asiolink::IOAddress addr, + const isc::asiolink::IOAddress& addr, const uint16_t port, IfaceMgrErrorMsgCallback error_handler) { // This variable will hold a descriptor of the socket bound to diff --git a/src/lib/dhcp/iface_mgr_sun.cc b/src/lib/dhcp/iface_mgr_sun.cc index 0a9f9b4f9d..a78de8f4a5 100644 --- a/src/lib/dhcp/iface_mgr_sun.cc +++ b/src/lib/dhcp/iface_mgr_sun.cc @@ -156,7 +156,7 @@ IfaceMgr::setMatchingPacketFilter(const bool /* direct_response_desired */) { bool IfaceMgr::openMulticastSocket(Iface& iface, - const isc::asiolink::IOAddress addr, + const isc::asiolink::IOAddress& addr, const uint16_t port, IfaceMgrErrorMsgCallback error_handler) { try {