Remove using-namespace-directives at global scope

This commit is contained in:
Vinnie Falco
2013-06-27 14:46:00 -07:00
parent 6f03efa882
commit 49340de0cd
5 changed files with 12 additions and 27 deletions

View File

@@ -4,13 +4,6 @@ TODO
- Remove "ENABLE_INSECURE" when the time is right. - Remove "ENABLE_INSECURE" when the time is right.
- Put all the Ripple code in the ripple namespace
* boost unit tests create namespace problems
- Remove references to BEASTApplication
- Remove "using namespace" statements
- lift bind, function, and placeholders into ripple namespace - lift bind, function, and placeholders into ripple namespace
- lift beast into the ripple namespace, remove ripple's duplicated integer types - lift beast into the ripple namespace, remove ripple's duplicated integer types
- lift unique_ptr / auto_ptr into ripple namespace, or replace with ScopedPointer - lift unique_ptr / auto_ptr into ripple namespace, or replace with ScopedPointer

View File

@@ -6,12 +6,9 @@
SETUP_LOG (PeerDoor) SETUP_LOG (PeerDoor)
using namespace std;
using namespace boost::asio::ip;
PeerDoor::PeerDoor (boost::asio::io_service& io_service) : PeerDoor::PeerDoor (boost::asio::io_service& io_service) :
mAcceptor (io_service, mAcceptor (io_service,
tcp::endpoint (address ().from_string (theConfig.PEER_IP.empty () ? "0.0.0.0" : theConfig.PEER_IP), boost::asio::ip::tcp::endpoint (boost::asio::ip::address ().from_string (theConfig.PEER_IP.empty () ? "0.0.0.0" : theConfig.PEER_IP),
theConfig.PEER_PORT)), theConfig.PEER_PORT)),
mCtx (boost::asio::ssl::context::sslv23), mDelayTimer (io_service) mCtx (boost::asio::ssl::context::sslv23), mDelayTimer (io_service)
{ {

View File

@@ -6,15 +6,14 @@
SETUP_LOG (RPCDoor) SETUP_LOG (RPCDoor)
using namespace std;
using namespace boost::asio::ip;
extern void initSSLContext (boost::asio::ssl::context& context, extern void initSSLContext (boost::asio::ssl::context& context,
std::string key_file, std::string cert_file, std::string chain_file); std::string key_file, std::string cert_file, std::string chain_file);
RPCDoor::RPCDoor (boost::asio::io_service& io_service) : RPCDoor::RPCDoor (boost::asio::io_service& io_service)
mAcceptor (io_service, tcp::endpoint (address::from_string (theConfig.RPC_IP), theConfig.RPC_PORT)), : mAcceptor (io_service,
mDelayTimer (io_service), mSSLContext (boost::asio::ssl::context::sslv23) boost::asio::ip::tcp::endpoint (boost::asio::ip::address::from_string (theConfig.RPC_IP), theConfig.RPC_PORT))
, mDelayTimer (io_service)
, mSSLContext (boost::asio::ssl::context::sslv23)
{ {
WriteLog (lsINFO, RPCDoor) << "RPC port: " << theConfig.RPC_IP << " " << theConfig.RPC_PORT << " allow remote: " << theConfig.RPC_ALLOW_REMOTE; WriteLog (lsINFO, RPCDoor) << "RPC port: " << theConfig.RPC_IP << " " << theConfig.RPC_PORT << " allow remote: " << theConfig.RPC_ALLOW_REMOTE;

View File

@@ -10,9 +10,6 @@ namespace po = boost::program_options;
extern void TFInit (); extern void TFInit ();
extern void LEFInit (); extern void LEFInit ();
using namespace std;
using namespace boost::unit_test;
void setupServer () void setupServer ()
{ {
theApp = IApplication::New (); theApp = IApplication::New ();
@@ -56,6 +53,8 @@ bool init_unit_test ()
void printHelp (const po::options_description& desc) void printHelp (const po::options_description& desc)
{ {
using namespace std;
cerr << SYSTEM_NAME "d [options] <command> <params>" << endl; cerr << SYSTEM_NAME "d [options] <command> <params>" << endl;
cerr << desc << endl; cerr << desc << endl;
@@ -121,6 +120,8 @@ void printHelp (const po::options_description& desc)
int rippleMain (int argc, char** argv) int rippleMain (int argc, char** argv)
{ {
using namespace std;
setCallingThreadName ("main"); setCallingThreadName ("main");
int iResult = 0; int iResult = 0;
po::variables_map vm; // Map of options. po::variables_map vm; // Map of options.
@@ -214,7 +215,7 @@ int rippleMain (int argc, char** argv)
if (vm.count ("unittest")) if (vm.count ("unittest"))
{ {
unit_test_main (init_unit_test, argc, argv); boost::unit_test::unit_test_main (init_unit_test, argc, argv);
return 0; return 0;
} }

View File

@@ -5,15 +5,10 @@
//============================================================================== //==============================================================================
// Used for logging // Used for logging
struct RPC struct RPC;
{
};
SETUP_LOG (RPC) SETUP_LOG (RPC)
using namespace boost;
using namespace boost::asio;
unsigned int const gMaxHTTPHeaderSize = 0x02000000; unsigned int const gMaxHTTPHeaderSize = 0x02000000;
std::string gFormatStr ("v1"); std::string gFormatStr ("v1");