BIND 10 trac2726, updated. 51c802b42eafb9d5da4c7f681051cb5fcfbd3df1 [2726] Pass params by reference
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Jun 14 08:23:51 UTC 2013
The branch, trac2726 has been updated
via 51c802b42eafb9d5da4c7f681051cb5fcfbd3df1 (commit)
via b037963e65fcc56bd6ffd847bfb41d172ad1af1e (commit)
via a9d957c18a7428dfa6d57e00baea49652302b4f0 (commit)
via 8780867306315f587012fd7ec9c623a0c439ffa4 (commit)
via a5c5c9e3456d94ee0465a6665dc1c2aafeb21091 (commit)
via ad2c0ba137e17bcf43b9be5a286d99696fd3009b (commit)
via 78af6ba875985a8c33eb1dd54adbe35fc720574b (commit)
via a0b8bc3685dcffca7713bea4d6d738827c045be0 (commit)
via c855ce32bf071dae01559afa743e757100d9a441 (commit)
via 11cdeec052d94483964f379d822e58eb58ffe522 (commit)
from a9f39355b94fe20924aa02f849e35e7000c67631 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 51c802b42eafb9d5da4c7f681051cb5fcfbd3df1
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Fri Jun 14 10:19:23 2013 +0200
[2726] Pass params by reference
This is mostly to silence cppcheck, than to save some CPU power (with
int it makes little sense) and it is less noisy than to put suppression
there.
commit b037963e65fcc56bd6ffd847bfb41d172ad1af1e
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Fri Jun 14 10:13:14 2013 +0200
[2726] Make some things noncopyable
We don't copy them and the implicit copy constructor would be wrong. So
silence the cppcheck and make sure nobody copies by accident.
commit a9d957c18a7428dfa6d57e00baea49652302b4f0
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Fri Jun 14 10:11:16 2013 +0200
[2726] Initialize variables
commit 8780867306315f587012fd7ec9c623a0c439ffa4
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Fri Jun 14 10:00:55 2013 +0200
[2726] Suppress check for no exception on construction
commit a5c5c9e3456d94ee0465a6665dc1c2aafeb21091
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Fri Jun 14 10:00:02 2013 +0200
[2726] Remove unused function
commit ad2c0ba137e17bcf43b9be5a286d99696fd3009b
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Fri Jun 14 09:58:44 2013 +0200
[2726] Use local const ref
commit 78af6ba875985a8c33eb1dd54adbe35fc720574b
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Fri Jun 14 09:50:02 2013 +0200
[2726] Use more common check for assignment to self
This way cppcheck should recognize it as such.
commit a0b8bc3685dcffca7713bea4d6d738827c045be0
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Fri Jun 14 09:38:11 2013 +0200
[2726] Use initializer list
Instead of assignment in the copy constructor.
commit c855ce32bf071dae01559afa743e757100d9a441
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Fri Jun 14 09:35:09 2013 +0200
[2726] Make the suppression so cppcheck finds it
commit 11cdeec052d94483964f379d822e58eb58ffe522
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Fri Jun 14 09:26:35 2013 +0200
[2726] Initialize variable
-----------------------------------------------------------------------
Summary of changes:
src/bin/auth/auth_srv.cc | 3 ++-
src/lib/dns/rdata.cc | 5 +++--
src/lib/dns/rdata/any_255/tsig_250.cc | 2 +-
src/lib/dns/rdata/generic/detail/ds_like.h | 12 ++++++------
src/lib/dns/rdata/generic/dlv_32769.cc | 2 +-
src/lib/dns/rdata/generic/dnskey_48.cc | 2 +-
src/lib/dns/rdata/generic/ds_43.cc | 2 +-
src/lib/dns/rdata/generic/nsec3_50.cc | 2 +-
src/lib/dns/rdata/generic/nsec3param_51.cc | 2 +-
src/lib/dns/rdata/generic/nsec_47.cc | 2 +-
src/lib/dns/rdata/generic/rrsig_46.cc | 2 +-
src/lib/dns/rdata/generic/spf_99.cc | 2 +-
src/lib/dns/rdata/generic/sshfp_44.cc | 2 +-
src/lib/dns/rdata/generic/txt_16.cc | 2 +-
src/lib/dns/rdata/in_1/srv_33.cc | 2 +-
src/lib/dns/rrttl.cc | 7 ++++---
src/lib/dns/tsigkey.cc | 2 +-
src/lib/log/logger_impl.h | 3 ++-
src/lib/log/logger_manager.h | 4 +++-
src/lib/log/message_exception.h | 4 ++--
.../isc/datasrc/configurableclientlist_python.cc | 2 +-
src/lib/resolve/recursive_query.cc | 5 -----
src/lib/server_common/portconfig.cc | 2 ++
src/lib/statistics/counter.h | 4 ++--
24 files changed, 40 insertions(+), 37 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc
index 90efee7..947f385 100644
--- a/src/bin/auth/auth_srv.cc
+++ b/src/bin/auth/auth_srv.cc
@@ -388,7 +388,8 @@ private:
};
AuthSrv::AuthSrv(isc::xfr::AbstractXfroutClient& xfrout_client,
- isc::util::io::BaseSocketSessionForwarder& ddns_forwarder)
+ isc::util::io::BaseSocketSessionForwarder& ddns_forwarder) :
+ dnss_(NULL)
{
impl_ = new AuthSrvImpl(xfrout_client, ddns_forwarder);
checkin_ = new ConfigChecker(this);
diff --git a/src/lib/dns/rdata.cc b/src/lib/dns/rdata.cc
index b71df63..f42c349 100644
--- a/src/lib/dns/rdata.cc
+++ b/src/lib/dns/rdata.cc
@@ -309,9 +309,10 @@ Generic::Generic(const Generic& source) :
Rdata(), impl_(new GenericImpl(*source.impl_))
{}
-// cppcheck-suppress operatorEqToSelf this check is better than
-// this == &source, just that cppcheck doesn't understand it.
Generic&
+// Our check is better than the usual if (this == &source),
+// but cppcheck doesn't recognize it.
+// cppcheck-suppress operatorEqToSelf
Generic::operator=(const Generic& source) {
if (impl_ == source.impl_) {
return (*this);
diff --git a/src/lib/dns/rdata/any_255/tsig_250.cc b/src/lib/dns/rdata/any_255/tsig_250.cc
index 4e86cf9..43cce7a 100644
--- a/src/lib/dns/rdata/any_255/tsig_250.cc
+++ b/src/lib/dns/rdata/any_255/tsig_250.cc
@@ -338,7 +338,7 @@ TSIG::TSIG(const TSIG& source) : Rdata(), impl_(new TSIGImpl(*source.impl_))
TSIG&
TSIG::operator=(const TSIG& source) {
- if (impl_ == source.impl_) {
+ if (this == &source) {
return (*this);
}
diff --git a/src/lib/dns/rdata/generic/detail/ds_like.h b/src/lib/dns/rdata/generic/detail/ds_like.h
index a7bebbf..c143cab 100644
--- a/src/lib/dns/rdata/generic/detail/ds_like.h
+++ b/src/lib/dns/rdata/generic/detail/ds_like.h
@@ -188,12 +188,12 @@ public:
/// \brief The copy constructor.
///
/// Trivial for now, we could've used the default one.
- DSLikeImpl(const DSLikeImpl& source) {
- digest_ = source.digest_;
- tag_ = source.tag_;
- algorithm_ = source.algorithm_;
- digest_type_ = source.digest_type_;
- }
+ DSLikeImpl(const DSLikeImpl& source) :
+ tag_(source.tag_),
+ algorithm_(source.algorithm_),
+ digest_type_(source.digest_type_),
+ digest_(source.digest_)
+ {}
/// \brief Convert the DS-like data to a string.
///
diff --git a/src/lib/dns/rdata/generic/dlv_32769.cc b/src/lib/dns/rdata/generic/dlv_32769.cc
index 89a62e1..97b9d1a 100644
--- a/src/lib/dns/rdata/generic/dlv_32769.cc
+++ b/src/lib/dns/rdata/generic/dlv_32769.cc
@@ -62,7 +62,7 @@ DLV::DLV(const DLV& source) :
/// PIMPL-induced logic
DLV&
DLV::operator=(const DLV& source) {
- if (impl_ == source.impl_) {
+ if (this == &source) {
return (*this);
}
diff --git a/src/lib/dns/rdata/generic/dnskey_48.cc b/src/lib/dns/rdata/generic/dnskey_48.cc
index 2e9a9f3..3ef6c72 100644
--- a/src/lib/dns/rdata/generic/dnskey_48.cc
+++ b/src/lib/dns/rdata/generic/dnskey_48.cc
@@ -212,7 +212,7 @@ DNSKEY::DNSKEY(const DNSKEY& source) :
DNSKEY&
DNSKEY::operator=(const DNSKEY& source) {
- if (impl_ == source.impl_) {
+ if (this == &source) {
return (*this);
}
diff --git a/src/lib/dns/rdata/generic/ds_43.cc b/src/lib/dns/rdata/generic/ds_43.cc
index 3492388..21bf8f3 100644
--- a/src/lib/dns/rdata/generic/ds_43.cc
+++ b/src/lib/dns/rdata/generic/ds_43.cc
@@ -50,7 +50,7 @@ DS::DS(const DS& source) :
DS&
DS::operator=(const DS& source) {
- if (impl_ == source.impl_) {
+ if (this == &source) {
return (*this);
}
diff --git a/src/lib/dns/rdata/generic/nsec3_50.cc b/src/lib/dns/rdata/generic/nsec3_50.cc
index fd8f78d..667f4a4 100644
--- a/src/lib/dns/rdata/generic/nsec3_50.cc
+++ b/src/lib/dns/rdata/generic/nsec3_50.cc
@@ -200,7 +200,7 @@ NSEC3::NSEC3(const NSEC3& source) :
NSEC3&
NSEC3::operator=(const NSEC3& source) {
- if (impl_ == source.impl_) {
+ if (this == &source) {
return (*this);
}
diff --git a/src/lib/dns/rdata/generic/nsec3param_51.cc b/src/lib/dns/rdata/generic/nsec3param_51.cc
index 494746d..f07c569 100644
--- a/src/lib/dns/rdata/generic/nsec3param_51.cc
+++ b/src/lib/dns/rdata/generic/nsec3param_51.cc
@@ -139,7 +139,7 @@ NSEC3PARAM::NSEC3PARAM(const NSEC3PARAM& source) :
NSEC3PARAM&
NSEC3PARAM::operator=(const NSEC3PARAM& source) {
- if (impl_ == source.impl_) {
+ if (this == &source) {
return (*this);
}
diff --git a/src/lib/dns/rdata/generic/nsec_47.cc b/src/lib/dns/rdata/generic/nsec_47.cc
index ffa2c97..c2dca32 100644
--- a/src/lib/dns/rdata/generic/nsec_47.cc
+++ b/src/lib/dns/rdata/generic/nsec_47.cc
@@ -155,7 +155,7 @@ NSEC::NSEC(const NSEC& source) :
NSEC&
NSEC::operator=(const NSEC& source) {
- if (impl_ == source.impl_) {
+ if (this == &source) {
return (*this);
}
diff --git a/src/lib/dns/rdata/generic/rrsig_46.cc b/src/lib/dns/rdata/generic/rrsig_46.cc
index 8e826d7..505c388 100644
--- a/src/lib/dns/rdata/generic/rrsig_46.cc
+++ b/src/lib/dns/rdata/generic/rrsig_46.cc
@@ -230,7 +230,7 @@ RRSIG::RRSIG(const RRSIG& source) :
RRSIG&
RRSIG::operator=(const RRSIG& source) {
- if (impl_ == source.impl_) {
+ if (this == &source) {
return (*this);
}
diff --git a/src/lib/dns/rdata/generic/spf_99.cc b/src/lib/dns/rdata/generic/spf_99.cc
index 4bf24e9..17c4e3c 100644
--- a/src/lib/dns/rdata/generic/spf_99.cc
+++ b/src/lib/dns/rdata/generic/spf_99.cc
@@ -42,7 +42,7 @@ using namespace isc::util;
/// This method never throws an exception otherwise.
SPF&
SPF::operator=(const SPF& source) {
- if (impl_ == source.impl_) {
+ if (this == &source) {
return (*this);
}
diff --git a/src/lib/dns/rdata/generic/sshfp_44.cc b/src/lib/dns/rdata/generic/sshfp_44.cc
index c7199f3..2865ed1 100644
--- a/src/lib/dns/rdata/generic/sshfp_44.cc
+++ b/src/lib/dns/rdata/generic/sshfp_44.cc
@@ -199,7 +199,7 @@ SSHFP::SSHFP(const SSHFP& other) :
SSHFP&
SSHFP::operator=(const SSHFP& source) {
- if (impl_ == source.impl_) {
+ if (this == &source) {
return (*this);
}
diff --git a/src/lib/dns/rdata/generic/txt_16.cc b/src/lib/dns/rdata/generic/txt_16.cc
index 1bd2eb1..ff5d0e1 100644
--- a/src/lib/dns/rdata/generic/txt_16.cc
+++ b/src/lib/dns/rdata/generic/txt_16.cc
@@ -33,7 +33,7 @@ using namespace isc::util;
TXT&
TXT::operator=(const TXT& source) {
- if (impl_ == source.impl_) {
+ if (this == &source) {
return (*this);
}
diff --git a/src/lib/dns/rdata/in_1/srv_33.cc b/src/lib/dns/rdata/in_1/srv_33.cc
index ac62071..fdb8f22 100644
--- a/src/lib/dns/rdata/in_1/srv_33.cc
+++ b/src/lib/dns/rdata/in_1/srv_33.cc
@@ -190,7 +190,7 @@ SRV::SRV(const SRV& source) :
SRV&
SRV::operator=(const SRV& source) {
- if (impl_ == source.impl_) {
+ if (this == &source) {
return (*this);
}
diff --git a/src/lib/dns/rrttl.cc b/src/lib/dns/rrttl.cc
index e7f8441..5a567b2 100644
--- a/src/lib/dns/rrttl.cc
+++ b/src/lib/dns/rrttl.cc
@@ -74,10 +74,11 @@ parseTTLString(const string& ttlstr, uint32_t& ttlval, string* error_txt) {
const string::const_iterator end = ttlstr.end();
string::const_iterator pos = ttlstr.begin();
- // When we detect we have some units
- bool units_mode = false;
-
try {
+
+ // When we detect we have some units
+ bool units_mode = false;
+
while (pos != end) {
// Find the first unit, if there's any.
const string::const_iterator unit = find_if(pos, end, myIsalpha);
diff --git a/src/lib/dns/tsigkey.cc b/src/lib/dns/tsigkey.cc
index e55cce3..7075203 100644
--- a/src/lib/dns/tsigkey.cc
+++ b/src/lib/dns/tsigkey.cc
@@ -148,7 +148,7 @@ TSIGKey::TSIGKey(const TSIGKey& source) : impl_(new TSIGKeyImpl(*source.impl_))
TSIGKey&
TSIGKey::operator=(const TSIGKey& source) {
- if (impl_ == source.impl_) {
+ if (this == &source) {
return (*this);
}
diff --git a/src/lib/log/logger_impl.h b/src/lib/log/logger_impl.h
index d8dea26..60f4c58 100644
--- a/src/lib/log/logger_impl.h
+++ b/src/lib/log/logger_impl.h
@@ -23,6 +23,7 @@
#include <string>
#include <map>
#include <utility>
+#include <boost/noncopyable.hpp>
// log4cplus logger header file
@@ -61,7 +62,7 @@ namespace log {
/// b) The idea of debug levels is implemented. See logger_level.h and
/// logger_level_impl.h for more details on this.
-class LoggerImpl {
+class LoggerImpl : public boost::noncopyable {
public:
/// \brief Constructor
diff --git a/src/lib/log/logger_manager.h b/src/lib/log/logger_manager.h
index b09383e..0c49757 100644
--- a/src/lib/log/logger_manager.h
+++ b/src/lib/log/logger_manager.h
@@ -19,6 +19,8 @@
#include <util/threads/sync.h>
#include <log/logger_specification.h>
+#include <boost/noncopyable.hpp>
+
// Generated if, when updating the logging specification, an unknown
// destination is encountered.
class UnknownLoggingDestination : public isc::Exception {
@@ -41,7 +43,7 @@ class LoggerManagerImpl;
/// To isolate the underlying implementation from basic processing, the
/// LoggerManager is implemented using the "pimpl" idiom.
-class LoggerManager {
+class LoggerManager : public boost::noncopyable {
public:
/// \brief Constructor
LoggerManager();
diff --git a/src/lib/log/message_exception.h b/src/lib/log/message_exception.h
index 5f1ad12..7133cd8 100644
--- a/src/lib/log/message_exception.h
+++ b/src/lib/log/message_exception.h
@@ -62,7 +62,7 @@ public:
/// \param lineno Line number on which error occurred (if > 0).
MessageException(const char* file, size_t line, const char* what,
MessageID id, const std::string& arg1, int lineno)
- : isc::Exception(file, line, what), id_(id)
+ : isc::Exception(file, line, what), id_(id), lineno_(lineno)
{
if (lineno > 0) {
args_.push_back(boost::lexical_cast<std::string>(lineno));
@@ -82,7 +82,7 @@ public:
MessageException(const char* file, size_t line, const char *what,
MessageID id, const std::string& arg1,
const std::string& arg2, int lineno)
- : isc::Exception(file, line, what), id_(id)
+ : isc::Exception(file, line, what), id_(id), lineno_(lineno)
{
if (lineno > 0) {
args_.push_back(boost::lexical_cast<std::string>(lineno));
diff --git a/src/lib/python/isc/datasrc/configurableclientlist_python.cc b/src/lib/python/isc/datasrc/configurableclientlist_python.cc
index 875d7e0..ba1a223 100644
--- a/src/lib/python/isc/datasrc/configurableclientlist_python.cc
+++ b/src/lib/python/isc/datasrc/configurableclientlist_python.cc
@@ -161,7 +161,7 @@ ConfigurableClientList_find(PyObject* po_self, PyObject* args) {
int want_finder = 1;
if (PyArg_ParseTuple(args, "O!|ii", &isc::dns::python::name_type,
&name_obj, &want_exact_match, &want_finder)) {
- const isc::dns::Name
+ const isc::dns::Name&
name(isc::dns::python::PyName_ToName(name_obj));
const ClientList::FindResult
result(self->cppobj->find(name, want_exact_match,
diff --git a/src/lib/resolve/recursive_query.cc b/src/lib/resolve/recursive_query.cc
index 55dc4da..3c54a78 100644
--- a/src/lib/resolve/recursive_query.cc
+++ b/src/lib/resolve/recursive_query.cc
@@ -245,11 +245,6 @@ private:
// normal query state
- // Update the question that will be sent to the server
- void setQuestion(const Question& new_question) {
- question_ = new_question;
- }
-
// TODO: replace by our wrapper
asio::deadline_timer client_timer;
asio::deadline_timer lookup_timer;
diff --git a/src/lib/server_common/portconfig.cc b/src/lib/server_common/portconfig.cc
index 7bc6876..36019c1 100644
--- a/src/lib/server_common/portconfig.cc
+++ b/src/lib/server_common/portconfig.cc
@@ -49,6 +49,8 @@ parseAddresses(isc::data::ConstElementPtr addresses,
"address and port");
}
try {
+ // Just check, don't use the address for anything yet
+ // cppcheck-suppress unusedScopedObject
IOAddress(addr->stringValue());
if (port->intValue() < 0 ||
port->intValue() > 0xffff) {
diff --git a/src/lib/statistics/counter.h b/src/lib/statistics/counter.h
index b0d31e9..32d025e 100644
--- a/src/lib/statistics/counter.h
+++ b/src/lib/statistics/counter.h
@@ -55,7 +55,7 @@ public:
/// \param type %Counter item to increment
///
/// \throw isc::OutOfRange \a type is invalid
- void inc(const Counter::Type type) {
+ void inc(const Counter::Type& type) {
if (type >= counters_.size()) {
isc_throw(isc::OutOfRange, "Counter type is out of range");
}
@@ -68,7 +68,7 @@ public:
/// \param type %Counter item to get the value of
///
/// \throw isc::OutOfRange \a type is invalid
- const Counter::Value& get(const Counter::Type type) const {
+ const Counter::Value& get(const Counter::Type& type) const {
if (type >= counters_.size()) {
isc_throw(isc::OutOfRange, "Counter type is out of range");
}
More information about the bind10-changes
mailing list