Commit cf9c4f39 authored by Francis Dupont's avatar Francis Dupont

[master] Merged trac5066 (enforce C++11)

parents e348313f 37555482
...@@ -117,6 +117,41 @@ AC_CHECK_DECL([__clang__], [CLANGPP="yes"], [CLANGPP="no"]) ...@@ -117,6 +117,41 @@ AC_CHECK_DECL([__clang__], [CLANGPP="yes"], [CLANGPP="no"])
# USE_CLANGPP is no longer used, keep it by summetry with USE_GXX? # USE_CLANGPP is no longer used, keep it by summetry with USE_GXX?
AM_CONDITIONAL(USE_CLANGPP, test "X${CLANGPP}" = "Xyes") AM_CONDITIONAL(USE_CLANGPP, test "X${CLANGPP}" = "Xyes")
# Check for std::unique_ptr and aggregate initialization (aka C++11) support
CXX_SAVED=$CXX
feature=
for retry in "none" "--std=c++11" "--std=c++0x" "--std=c++1x" "fail"; do
if test "$retry" = "fail"; then
AC_MSG_ERROR([$feature (a C++11 feature) is not supported])
fi
if test "$retry" != "none"; then
AC_MSG_WARN([unsupported C++11 feature])
AC_MSG_NOTICE([retrying by adding $retry to $CXX])
CXX="$CXX_SAVED $retry"
fi
AC_MSG_CHECKING(std::unique_ptr support)
feature="std::unique_ptr"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <memory>],
[std::unique_ptr<int> a;])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
continue])
AC_MSG_CHECKING(aggregate initialization support)
feature="aggregate initialization"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <vector>],
[std::vector<int> foo = { 1, 2, 3};])],
[AC_MSG_RESULT([yes])
break],
[AC_MSG_RESULT([no])
continue])
done
dnl Determine if we are using GNU sed dnl Determine if we are using GNU sed
GNU_SED=no GNU_SED=no
$SED --version 2> /dev/null | grep GNU > /dev/null 2>&1 $SED --version 2> /dev/null | grep GNU > /dev/null 2>&1
......
// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
#include <dns/master_loader.h> #include <dns/master_loader.h>
#include <dns/master_lexer.h> #include <dns/master_lexer.h>
#include <dns/name.h> #include <dns/name.h>
...@@ -25,7 +27,7 @@ ...@@ -25,7 +27,7 @@
#include <cstdio> // for sscanf() #include <cstdio> // for sscanf()
using std::string; using std::string;
using std::auto_ptr; using std::unique_ptr;
using std::vector; using std::vector;
using std::pair; using std::pair;
using boost::algorithm::iequals; using boost::algorithm::iequals;
...@@ -1034,10 +1036,9 @@ MasterLoader::MasterLoader(std::istream& stream, ...@@ -1034,10 +1036,9 @@ MasterLoader::MasterLoader(std::istream& stream,
if (add_callback.empty()) { if (add_callback.empty()) {
isc_throw(isc::InvalidParameter, "Empty add RR callback"); isc_throw(isc::InvalidParameter, "Empty add RR callback");
} }
auto_ptr<MasterLoaderImpl> impl(new MasterLoaderImpl("", zone_origin, unique_ptr<MasterLoaderImpl>
zone_class, callbacks, impl(new MasterLoaderImpl("", zone_origin, zone_class,
add_callback, callbacks, add_callback, options));
options));
impl->pushStreamSource(stream); impl->pushStreamSource(stream);
impl_ = impl.release(); impl_ = impl.release();
} }
......
// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
#include <exceptions/exceptions.h> #include <exceptions/exceptions.h>
#include <util/buffer.h> #include <util/buffer.h>
...@@ -278,10 +280,10 @@ Generic::constructFromLexer(MasterLexer& lexer) { ...@@ -278,10 +280,10 @@ Generic::constructFromLexer(MasterLexer& lexer) {
Generic::Generic(const std::string& rdata_string) : Generic::Generic(const std::string& rdata_string) :
impl_(NULL) impl_(NULL)
{ {
// We use auto_ptr here because if there is an exception in this // We use unique_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a // constructor, the destructor is not called and there could be a
// leak of the GenericImpl that constructFromLexer() returns. // leak of the GenericImpl that constructFromLexer() returns.
std::auto_ptr<GenericImpl> impl_ptr(NULL); std::unique_ptr<GenericImpl> impl_ptr;
try { try {
std::istringstream ss(rdata_string); std::istringstream ss(rdata_string);
......
// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <vector> #include <vector>
...@@ -208,10 +210,10 @@ TSIG::constructFromLexer(MasterLexer& lexer, const Name* origin) { ...@@ -208,10 +210,10 @@ TSIG::constructFromLexer(MasterLexer& lexer, const Name* origin) {
/// ///
/// \param tsig_str A string containing the RDATA to be created /// \param tsig_str A string containing the RDATA to be created
TSIG::TSIG(const std::string& tsig_str) : impl_(NULL) { TSIG::TSIG(const std::string& tsig_str) : impl_(NULL) {
// We use auto_ptr here because if there is an exception in this // We use unique_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a // constructor, the destructor is not called and there could be a
// leak of the TSIGImpl that constructFromLexer() returns. // leak of the TSIGImpl that constructFromLexer() returns.
std::auto_ptr<TSIGImpl> impl_ptr(NULL); std::unique_ptr<TSIGImpl> impl_ptr;
try { try {
std::istringstream ss(tsig_str); std::istringstream ss(tsig_str);
......
// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
...@@ -95,10 +95,10 @@ CAA::constructFromLexer(MasterLexer& lexer) { ...@@ -95,10 +95,10 @@ CAA::constructFromLexer(MasterLexer& lexer) {
CAA::CAA(const string& caa_str) : CAA::CAA(const string& caa_str) :
impl_(NULL) impl_(NULL)
{ {
// We use auto_ptr here because if there is an exception in this // We use unique_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a // constructor, the destructor is not called and there could be a
// leak of the CAAImpl that constructFromLexer() returns. // leak of the CAAImpl that constructFromLexer() returns.
std::auto_ptr<CAAImpl> impl_ptr(NULL); std::unique_ptr<CAAImpl> impl_ptr;
try { try {
std::istringstream ss(caa_str); std::istringstream ss(caa_str);
......
// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <sstream> #include <sstream>
...@@ -70,10 +72,10 @@ struct DNSKEYImpl { ...@@ -70,10 +72,10 @@ struct DNSKEYImpl {
DNSKEY::DNSKEY(const std::string& dnskey_str) : DNSKEY::DNSKEY(const std::string& dnskey_str) :
impl_(NULL) impl_(NULL)
{ {
// We use auto_ptr here because if there is an exception in this // We use unique_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a // constructor, the destructor is not called and there could be a
// leak of the DNSKEYImpl that constructFromLexer() returns. // leak of the DNSKEYImpl that constructFromLexer() returns.
std::auto_ptr<DNSKEYImpl> impl_ptr(NULL); std::unique_ptr<DNSKEYImpl> impl_ptr;
try { try {
std::istringstream ss(dnskey_str); std::istringstream ss(dnskey_str);
......
// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
#include <string> #include <string>
...@@ -79,10 +81,10 @@ struct NSEC3Impl { ...@@ -79,10 +81,10 @@ struct NSEC3Impl {
NSEC3::NSEC3(const std::string& nsec3_str) : NSEC3::NSEC3(const std::string& nsec3_str) :
impl_(NULL) impl_(NULL)
{ {
// We use auto_ptr here because if there is an exception in this // We use unique_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a // constructor, the destructor is not called and there could be a
// leak of the NSEC3Impl that constructFromLexer() returns. // leak of the NSEC3Impl that constructFromLexer() returns.
std::auto_ptr<NSEC3Impl> impl_ptr(NULL); std::unique_ptr<NSEC3Impl> impl_ptr;
try { try {
std::istringstream ss(nsec3_str); std::istringstream ss(nsec3_str);
......
// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
#include <util/buffer.h> #include <util/buffer.h>
#include <util/encode/hex.h> #include <util/encode/hex.h>
...@@ -57,10 +59,10 @@ struct NSEC3PARAMImpl { ...@@ -57,10 +59,10 @@ struct NSEC3PARAMImpl {
NSEC3PARAM::NSEC3PARAM(const std::string& nsec3param_str) : NSEC3PARAM::NSEC3PARAM(const std::string& nsec3param_str) :
impl_(NULL) impl_(NULL)
{ {
// We use auto_ptr here because if there is an exception in this // We use unique_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a // constructor, the destructor is not called and there could be a
// leak of the NSEC3PARAMImpl that constructFromLexer() returns. // leak of the NSEC3PARAMImpl that constructFromLexer() returns.
std::auto_ptr<NSEC3PARAMImpl> impl_ptr(NULL); std::unique_ptr<NSEC3PARAMImpl> impl_ptr;
try { try {
std::istringstream ss(nsec3param_str); std::istringstream ss(nsec3param_str);
......
// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
...@@ -86,7 +86,7 @@ OPT::OPT(MasterLexer&, const Name*, ...@@ -86,7 +86,7 @@ OPT::OPT(MasterLexer&, const Name*,
OPT::OPT(InputBuffer& buffer, size_t rdata_len) : OPT::OPT(InputBuffer& buffer, size_t rdata_len) :
impl_(NULL) impl_(NULL)
{ {
std::auto_ptr<OPTImpl> impl_ptr(new OPTImpl); std::unique_ptr<OPTImpl> impl_ptr(new OPTImpl);
while (true) { while (true) {
if (rdata_len == 0) { if (rdata_len == 0) {
......
// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
#include <string> #include <string>
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
...@@ -137,10 +139,10 @@ RRSIG::constructFromLexer(MasterLexer& lexer, const Name* origin) { ...@@ -137,10 +139,10 @@ RRSIG::constructFromLexer(MasterLexer& lexer, const Name* origin) {
RRSIG::RRSIG(const std::string& rrsig_str) : RRSIG::RRSIG(const std::string& rrsig_str) :
impl_(NULL) impl_(NULL)
{ {
// We use auto_ptr here because if there is an exception in this // We use unique_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a // constructor, the destructor is not called and there could be a
// leak of the RRSIGImpl that constructFromLexer() returns. // leak of the RRSIGImpl that constructFromLexer() returns.
std::auto_ptr<RRSIGImpl> impl_ptr(NULL); std::unique_ptr<RRSIGImpl> impl_ptr;
try { try {
std::istringstream iss(rrsig_str); std::istringstream iss(rrsig_str);
......
// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
...@@ -104,10 +104,10 @@ SSHFP::constructFromLexer(MasterLexer& lexer) { ...@@ -104,10 +104,10 @@ SSHFP::constructFromLexer(MasterLexer& lexer) {
SSHFP::SSHFP(const string& sshfp_str) : SSHFP::SSHFP(const string& sshfp_str) :
impl_(NULL) impl_(NULL)
{ {
// We use auto_ptr here because if there is an exception in this // We use unique_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a // constructor, the destructor is not called and there could be a
// leak of the SSHFPImpl that constructFromLexer() returns. // leak of the SSHFPImpl that constructFromLexer() returns.
std::auto_ptr<SSHFPImpl> impl_ptr(NULL); std::unique_ptr<SSHFPImpl> impl_ptr;
try { try {
std::istringstream ss(sshfp_str); std::istringstream ss(sshfp_str);
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
/////////////// ///////////////
/////////////// ///////////////
// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <vector> #include <vector>
...@@ -217,10 +219,10 @@ TSIG::constructFromLexer(MasterLexer& lexer, const Name* origin) { ...@@ -217,10 +219,10 @@ TSIG::constructFromLexer(MasterLexer& lexer, const Name* origin) {
/// ///
/// \param tsig_str A string containing the RDATA to be created /// \param tsig_str A string containing the RDATA to be created
TSIG::TSIG(const std::string& tsig_str) : impl_(NULL) { TSIG::TSIG(const std::string& tsig_str) : impl_(NULL) {
// We use auto_ptr here because if there is an exception in this // We use unique_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a // constructor, the destructor is not called and there could be a
// leak of the TSIGImpl that constructFromLexer() returns. // leak of the TSIGImpl that constructFromLexer() returns.
std::auto_ptr<TSIGImpl> impl_ptr(NULL); std::unique_ptr<TSIGImpl> impl_ptr;
try { try {
std::istringstream ss(tsig_str); std::istringstream ss(tsig_str);
...@@ -843,7 +845,7 @@ AFSDB::getSubtype() const { ...@@ -843,7 +845,7 @@ AFSDB::getSubtype() const {
} // end of namespace "rdata" } // end of namespace "rdata"
} // end of namespace "dns" } // end of namespace "dns"
} // end of namespace "isc" } // end of namespace "isc"
// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
...@@ -942,10 +944,10 @@ CAA::constructFromLexer(MasterLexer& lexer) { ...@@ -942,10 +944,10 @@ CAA::constructFromLexer(MasterLexer& lexer) {
CAA::CAA(const string& caa_str) : CAA::CAA(const string& caa_str) :
impl_(NULL) impl_(NULL)
{ {
// We use auto_ptr here because if there is an exception in this // We use unique_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a // constructor, the destructor is not called and there could be a
// leak of the CAAImpl that constructFromLexer() returns. // leak of the CAAImpl that constructFromLexer() returns.
std::auto_ptr<CAAImpl> impl_ptr(NULL); std::unique_ptr<CAAImpl> impl_ptr;
try { try {
std::istringstream ss(caa_str); std::istringstream ss(caa_str);
...@@ -1527,12 +1529,14 @@ DNAME::getDname() const { ...@@ -1527,12 +1529,14 @@ DNAME::getDname() const {
} // end of namespace "rdata" } // end of namespace "rdata"
} // end of namespace "dns" } // end of namespace "dns"
} // end of namespace "isc" } // end of namespace "isc"
// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <sstream> #include <sstream>
...@@ -1601,10 +1605,10 @@ struct DNSKEYImpl { ...@@ -1601,10 +1605,10 @@ struct DNSKEYImpl {
DNSKEY::DNSKEY(const std::string& dnskey_str) : DNSKEY::DNSKEY(const std::string& dnskey_str) :
impl_(NULL) impl_(NULL)
{ {
// We use auto_ptr here because if there is an exception in this // We use unique_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a // constructor, the destructor is not called and there could be a
// leak of the DNSKEYImpl that constructFromLexer() returns. // leak of the DNSKEYImpl that constructFromLexer() returns.
std::auto_ptr<DNSKEYImpl> impl_ptr(NULL); std::unique_ptr<DNSKEYImpl> impl_ptr;
try { try {
std::istringstream ss(dnskey_str); std::istringstream ss(dnskey_str);
...@@ -2816,12 +2820,14 @@ NS::getNSName() const { ...@@ -2816,12 +2820,14 @@ NS::getNSName() const {
} // end of namespace "rdata" } // end of namespace "rdata"
} // end of namespace "dns" } // end of namespace "dns"
} // end of namespace "isc" } // end of namespace "isc"
// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
#include <string> #include <string>
...@@ -2899,10 +2905,10 @@ struct NSEC3Impl { ...@@ -2899,10 +2905,10 @@ struct NSEC3Impl {
NSEC3::NSEC3(const std::string& nsec3_str) : NSEC3::NSEC3(const std::string& nsec3_str) :
impl_(NULL) impl_(NULL)
{ {
// We use auto_ptr here because if there is an exception in this // We use unique_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a // constructor, the destructor is not called and there could be a
// leak of the NSEC3Impl that constructFromLexer() returns. // leak of the NSEC3Impl that constructFromLexer() returns.
std::auto_ptr<NSEC3Impl> impl_ptr(NULL); std::unique_ptr<NSEC3Impl> impl_ptr;
try { try {
std::istringstream ss(nsec3_str); std::istringstream ss(nsec3_str);
...@@ -3161,12 +3167,14 @@ NSEC3::getNext() const { ...@@ -3161,12 +3167,14 @@ NSEC3::getNext() const {
} // end of namespace "rdata" } // end of namespace "rdata"
} // end of namespace "dns" } // end of namespace "dns"
} // end of namespace "isc" } // end of namespace "isc"
// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
#include <util/buffer.h> #include <util/buffer.h>
#include <util/encode/hex.h> #include <util/encode/hex.h>
...@@ -3222,10 +3230,10 @@ struct NSEC3PARAMImpl { ...@@ -3222,10 +3230,10 @@ struct NSEC3PARAMImpl {
NSEC3PARAM::NSEC3PARAM(const std::string& nsec3param_str) : NSEC3PARAM::NSEC3PARAM(const std::string& nsec3param_str) :
impl_(NULL) impl_(NULL)
{ {
// We use auto_ptr here because if there is an exception in this // We use unique_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a // constructor, the destructor is not called and there could be a
// leak of the NSEC3PARAMImpl that constructFromLexer() returns. // leak of the NSEC3PARAMImpl that constructFromLexer() returns.
std::auto_ptr<NSEC3PARAMImpl> impl_ptr(NULL); std::unique_ptr<NSEC3PARAMImpl> impl_ptr;
try { try {
std::istringstream ss(nsec3param_str); std::istringstream ss(nsec3param_str);
...@@ -3613,7 +3621,7 @@ NSEC::compare(const Rdata& other) const { ...@@ -3613,7 +3621,7 @@ NSEC::compare(const Rdata& other) const {
} // end of namespace "rdata" } // end of namespace "rdata"
} // end of namespace "dns" } // end of namespace "dns"
} // end of namespace "isc" } // end of namespace "isc"
// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
...@@ -3703,7 +3711,7 @@ OPT::OPT(MasterLexer&, const Name*, ...@@ -3703,7 +3711,7 @@ OPT::OPT(MasterLexer&, const Name*,
OPT::OPT(InputBuffer& buffer, size_t rdata_len) : OPT::OPT(InputBuffer& buffer, size_t rdata_len) :
impl_(NULL) impl_(NULL)
{ {
std::auto_ptr<OPTImpl> impl_ptr(new OPTImpl); std::unique_ptr<OPTImpl> impl_ptr(new OPTImpl);
while (true) { while (true) {
if (rdata_len == 0) { if (rdata_len == 0) {
...@@ -4125,12 +4133,14 @@ RP::compare(const Rdata& other) const { ...@@ -4125,12 +4133,14 @@ RP::compare(const Rdata& other) const {
} // end of namespace "rdata" } // end of namespace "rdata"
} // end of namespace "dns" } // end of namespace "dns"
} // end of namespace "isc" } // end of namespace "isc"
// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // 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 // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>