Browse Source

[master] fix errors with ambiguous types and other boost uses

Stop doing "using namespace boost" and be specific with the using boost::.

Problem noticed on Solaris 11 with g++ 4.5.2 and boost 1.50.0.
Tested with older g++ 4.1.3 with boost 1.42.0 (on NetBSD).

Discussed little on jabber.
Jeremy C. Reed 13 years ago
parent
commit
438f31e788

+ 1 - 1
src/lib/cryptolink/tests/crypto_unittests.cc

@@ -31,7 +31,7 @@
 
 #include <boost/shared_ptr.hpp>
 
-using namespace boost;
+using boost::lexical_cast;
 using namespace isc::util;
 using namespace isc::util::encode;
 using namespace isc::cryptolink;

+ 3 - 1
src/lib/datasrc/client_list.cc

@@ -24,7 +24,9 @@
 using namespace isc::data;
 using namespace isc::dns;
 using namespace std;
-using namespace boost;
+using boost::lexical_cast;
+using boost::shared_ptr;
+using boost::dynamic_pointer_cast;
 
 namespace isc {
 namespace datasrc {

+ 2 - 1
src/lib/datasrc/database.cc

@@ -38,7 +38,8 @@
 using namespace isc::dns;
 using namespace std;
 using namespace isc::dns::rdata;
-using namespace boost;
+using boost::lexical_cast;
+using boost::scoped_ptr;
 
 namespace isc {
 namespace datasrc {

+ 1 - 1
src/lib/dns/edns.cc

@@ -34,7 +34,7 @@
 #include <dns/rrtype.h>
 
 using namespace std;
-using namespace boost;
+using boost::lexical_cast;
 using namespace isc::dns::rdata;
 using namespace isc::util;
 

+ 1 - 1
src/lib/dns/message.cc

@@ -44,7 +44,7 @@
 #include <dns/tsig.h>
 
 using namespace std;
-using namespace boost;
+using boost::lexical_cast;
 using namespace isc::dns::rdata;
 using namespace isc::util;
 

+ 1 - 1
src/lib/dns/rdata.cc

@@ -35,7 +35,7 @@
 #include <dns/rrtype.h>
 
 using namespace std;
-using namespace boost;
+using boost::lexical_cast;
 using namespace isc::util;
 
 namespace isc {

+ 1 - 1
src/lib/dns/rdata/any_255/tsig_250.cc

@@ -29,7 +29,7 @@
 #include <dns/tsigerror.h>
 
 using namespace std;
-using namespace boost;
+using boost::lexical_cast;
 using namespace isc::util;
 using namespace isc::util::encode;
 using namespace isc::util::str;

+ 1 - 1
src/lib/dns/rdata/generic/hinfo_13.cc

@@ -28,7 +28,7 @@
 #include <util/strutil.h>
 
 using namespace std;
-using namespace boost;
+using boost::lexical_cast;
 using namespace isc::util;
 using namespace isc::dns;
 using namespace isc::dns::characterstr;

+ 1 - 1
src/lib/dns/rdata/generic/mx_15.cc

@@ -27,7 +27,7 @@
 #include <dns/rdataclass.h>
 
 using namespace std;
-using namespace boost;
+using boost::lexical_cast;
 using namespace isc::util;
 
 // BEGIN_ISC_NAMESPACE

+ 1 - 1
src/lib/dns/rdata/generic/naptr_35.cc

@@ -27,7 +27,7 @@
 #include <dns/rdataclass.h>
 
 using namespace std;
-using namespace boost;
+using boost::lexical_cast;
 using namespace isc::util;
 using namespace isc::dns;
 using namespace isc::dns::characterstr;

+ 1 - 1
src/lib/dns/rdata/generic/nsec3_50.cc

@@ -162,7 +162,7 @@ NSEC3::toText() const {
     ostringstream s;
     bitmapsToText(impl_->typebits_, s);
 
-    using namespace boost;
+    using boost::lexical_cast;
     return (lexical_cast<string>(static_cast<int>(impl_->hashalg_)) +
             " " + lexical_cast<string>(static_cast<int>(impl_->flags_)) +
             " " + lexical_cast<string>(static_cast<int>(impl_->iterations_)) +

+ 1 - 1
src/lib/dns/rdata/generic/nsec3param_51.cc

@@ -95,7 +95,7 @@ NSEC3PARAM::~NSEC3PARAM() {
 
 string
 NSEC3PARAM::toText() const {
-    using namespace boost;
+    using boost::lexical_cast;
     return (lexical_cast<string>(static_cast<int>(impl_->hashalg_)) +
             " " + lexical_cast<string>(static_cast<int>(impl_->flags_)) +
             " " + lexical_cast<string>(static_cast<int>(impl_->iterations_)) +

+ 1 - 1
src/lib/dns/rdata/generic/soa_6.cc

@@ -27,7 +27,7 @@
 #include <dns/rdataclass.h>
 
 using namespace std;
-using namespace boost;
+using boost::lexical_cast;
 using namespace isc::util;
 
 // BEGIN_ISC_NAMESPACE

+ 1 - 1
src/lib/dns/rdata/generic/sshfp_44.cc

@@ -28,7 +28,7 @@
 #include <dns/rdataclass.h>
 
 using namespace std;
-using namespace boost;
+using boost::lexical_cast;
 using namespace isc::util;
 using namespace isc::util::encode;
 

+ 1 - 1
src/lib/dns/rdata/in_1/srv_33.cc

@@ -157,7 +157,7 @@ SRV::~SRV() {
 /// \return A \c string object that represents the \c SRV object.
 string
 SRV::toText() const {
-    using namespace boost;
+    using boost::lexical_cast;
     return (lexical_cast<string>(impl_->priority_) +
         " " + lexical_cast<string>(impl_->weight_) +
         " " + lexical_cast<string>(impl_->port_) +

+ 2 - 1
src/lib/server_common/tests/client_unittest.cc

@@ -31,7 +31,8 @@
 
 #include <gtest/gtest.h>
 
-using namespace boost;
+using boost::lexical_cast;
+using boost::scoped_ptr;
 using namespace isc::acl;
 using namespace isc::asiolink;
 using namespace isc::server_common;