diff options
author | Andrew Morrow <acm@mongodb.com> | 2015-01-09 18:02:51 -0500 |
---|---|---|
committer | Andrew Morrow <acm@mongodb.com> | 2015-01-15 07:04:26 -0500 |
commit | 9f30e21c627e4c73ab0b44e45b7ce657b3e2619f (patch) | |
tree | 4863e66baca59d2733c4d8090ed962ef60908d6a /src/mongo/util | |
parent | 44cafa7dddde7510aa0a05efce807a2e294fdc6d (diff) | |
download | mongo-9f30e21c627e4c73ab0b44e45b7ce657b3e2619f.tar.gz |
SERVER-13256 Add usings and qualifications for names from namespace std
Diffstat (limited to 'src/mongo/util')
27 files changed, 80 insertions, 3 deletions
diff --git a/src/mongo/util/base64.cpp b/src/mongo/util/base64.cpp index cd7218c368f..04216eb0b64 100644 --- a/src/mongo/util/base64.cpp +++ b/src/mongo/util/base64.cpp @@ -36,6 +36,10 @@ #include "mongo/util/base64.h" namespace mongo { + + using std::string; + using std::stringstream; + namespace base64 { Alphabet alphabet; diff --git a/src/mongo/util/concurrency/task.cpp b/src/mongo/util/concurrency/task.cpp index 8c33c5b7bfe..a991334c479 100644 --- a/src/mongo/util/concurrency/task.cpp +++ b/src/mongo/util/concurrency/task.cpp @@ -47,6 +47,9 @@ namespace mongo { + using std::cout; + using std::endl; + namespace task { /*void foo() { diff --git a/src/mongo/util/concurrency/thread_name.cpp b/src/mongo/util/concurrency/thread_name.cpp index 87d4ec195f1..1d9fe2ff201 100644 --- a/src/mongo/util/concurrency/thread_name.cpp +++ b/src/mongo/util/concurrency/thread_name.cpp @@ -34,6 +34,8 @@ namespace mongo { + using std::string; + namespace { boost::thread_specific_ptr<std::string> _threadName; diff --git a/src/mongo/util/concurrency/thread_pool.cpp b/src/mongo/util/concurrency/thread_pool.cpp index 137b7d6f3a5..bb01bc4c6d2 100644 --- a/src/mongo/util/concurrency/thread_pool.cpp +++ b/src/mongo/util/concurrency/thread_pool.cpp @@ -47,6 +47,8 @@ namespace mongo { namespace threadpool { + using std::endl; + // Worker thread class Worker : boost::noncopyable { public: diff --git a/src/mongo/util/fail_point.cpp b/src/mongo/util/fail_point.cpp index 4e8a13dc483..424e2c27ad5 100644 --- a/src/mongo/util/fail_point.cpp +++ b/src/mongo/util/fail_point.cpp @@ -34,6 +34,8 @@ #include "mongo/util/log.h" #include "mongo/util/time_support.h" +using std::endl; + using mongoutils::str::stream; namespace mongo { diff --git a/src/mongo/util/fail_point_registry.cpp b/src/mongo/util/fail_point_registry.cpp index f58f7a55af3..99ff384b8c0 100644 --- a/src/mongo/util/fail_point_registry.cpp +++ b/src/mongo/util/fail_point_registry.cpp @@ -34,6 +34,9 @@ using mongoutils::str::stream; namespace mongo { + + using std::string; + FailPointRegistry::FailPointRegistry(): _frozen(false) { } diff --git a/src/mongo/util/file_allocator.cpp b/src/mongo/util/file_allocator.cpp index 319d6fddfd0..2adbba1a020 100644 --- a/src/mongo/util/file_allocator.cpp +++ b/src/mongo/util/file_allocator.cpp @@ -71,6 +71,11 @@ using namespace mongoutils; namespace mongo { + using std::endl; + using std::list; + using std::string; + using std::stringstream; + // unique number for temporary file names unsigned long long FileAllocator::_uniqueNumber = 0; static SimpleMutex _uniqueNumberMutex( "uniqueNumberMutex" ); diff --git a/src/mongo/util/hex.cpp b/src/mongo/util/hex.cpp index 3d6c1b45f86..d1170e5e768 100644 --- a/src/mongo/util/hex.cpp +++ b/src/mongo/util/hex.cpp @@ -70,7 +70,7 @@ namespace mongo { template<> std::string integerToHex<unsigned long long>(unsigned long long val) { return integerToHexDef(val); } - string hexdump(const char *data, unsigned len) { + std::string hexdump(const char *data, unsigned len) { verify( len < 1000000 ); const unsigned char *p = (const unsigned char *) data; std::stringstream ss; diff --git a/src/mongo/util/logfile.cpp b/src/mongo/util/logfile.cpp index 37064fba587..5e8f185bc4c 100644 --- a/src/mongo/util/logfile.cpp +++ b/src/mongo/util/logfile.cpp @@ -48,6 +48,9 @@ using namespace mongoutils; +using std::endl; +using std::string; + namespace mongo { struct LogfileTest : public StartupTest { LogfileTest() { } @@ -140,7 +143,7 @@ namespace mongo { const char *buf = (const char *) _buf; size_t left = _len; while( left ) { - size_t toWrite = min(left, BlockSize); + size_t toWrite = std::min(left, BlockSize); DWORD written; if( !WriteFile(_fd, buf, toWrite, &written, NULL) ) { DWORD e = GetLastError(); diff --git a/src/mongo/util/mmap.cpp b/src/mongo/util/mmap.cpp index 917fff03327..6ccadbe7f6d 100644 --- a/src/mongo/util/mmap.cpp +++ b/src/mongo/util/mmap.cpp @@ -49,6 +49,13 @@ namespace mongo { + using std::endl; + using std::map; + using std::set; + using std::string; + using std::stringstream; + using std::vector; + void minOSPageSizeBytesTest(size_t minOSPageSizeBytes) { fassert( 16325, minOSPageSizeBytes > 0 ); fassert( 16326, minOSPageSizeBytes < 1000000 ); diff --git a/src/mongo/util/mmap_posix.cpp b/src/mongo/util/mmap_posix.cpp index 6b840928f3e..8d9f2a11caf 100644 --- a/src/mongo/util/mmap_posix.cpp +++ b/src/mongo/util/mmap_posix.cpp @@ -49,6 +49,10 @@ #include "mongo/util/processinfo.h" #include "mongo/util/startup_test.h" +using std::endl; +using std::numeric_limits; +using std::vector; + using namespace mongoutils; namespace { diff --git a/src/mongo/util/mmap_win.cpp b/src/mongo/util/mmap_win.cpp index c1f6492561e..c40bf9a876e 100644 --- a/src/mongo/util/mmap_win.cpp +++ b/src/mongo/util/mmap_win.cpp @@ -45,6 +45,10 @@ namespace mongo { + using std::endl; + using std::string; + using std::vector; + namespace { mongo::AtomicUInt64 mmfNextId(0); } diff --git a/src/mongo/util/net/httpclient.cpp b/src/mongo/util/net/httpclient.cpp index cf64d5f7447..ecea9bbba56 100644 --- a/src/mongo/util/net/httpclient.cpp +++ b/src/mongo/util/net/httpclient.cpp @@ -43,6 +43,9 @@ namespace mongo { + using std::string; + using std::stringstream; + //#define HD(x) cout << x << endl; #define HD(x) diff --git a/src/mongo/util/net/listen.cpp b/src/mongo/util/net/listen.cpp index ea20d07e4e6..d15161645ac 100644 --- a/src/mongo/util/net/listen.cpp +++ b/src/mongo/util/net/listen.cpp @@ -76,6 +76,9 @@ namespace mongo { using boost::shared_ptr; + using std::endl; + using std::string; + using std::vector; // ----- Listener ------- @@ -286,7 +289,7 @@ namespace mongo { } #if defined(__linux__) - _elapsedTime += max(ret, (int)(( 10000 - maxSelectTime.tv_usec ) / 1000)); + _elapsedTime += std::max(ret, (int)(( 10000 - maxSelectTime.tv_usec ) / 1000)); #else _elapsedTime += ret; // assume 1ms to grab connection. very rough #endif diff --git a/src/mongo/util/net/message_port.cpp b/src/mongo/util/net/message_port.cpp index 4fc33df7dc4..2748c61fa67 100644 --- a/src/mongo/util/net/message_port.cpp +++ b/src/mongo/util/net/message_port.cpp @@ -58,6 +58,7 @@ namespace mongo { using boost::shared_ptr; + using std::string; // if you want trace output: #define mmm(x) diff --git a/src/mongo/util/net/message_server_port.cpp b/src/mongo/util/net/message_server_port.cpp index df4d4a1ec3d..afcce360db4 100644 --- a/src/mongo/util/net/message_server_port.cpp +++ b/src/mongo/util/net/message_server_port.cpp @@ -63,6 +63,7 @@ namespace mongo { using boost::scoped_ptr; + using std::endl; namespace { diff --git a/src/mongo/util/net/miniwebserver.cpp b/src/mongo/util/net/miniwebserver.cpp index 92700291944..2cbc24e099b 100644 --- a/src/mongo/util/net/miniwebserver.cpp +++ b/src/mongo/util/net/miniwebserver.cpp @@ -42,6 +42,9 @@ namespace mongo { using boost::shared_ptr; + using std::endl; + using std::stringstream; + using std::vector; MiniWebServer::MiniWebServer(const string& name, const string &ip, int port) : Listener(name, ip, port, false) diff --git a/src/mongo/util/net/sock.cpp b/src/mongo/util/net/sock.cpp index 51581136620..233ebf5d9a3 100644 --- a/src/mongo/util/net/sock.cpp +++ b/src/mongo/util/net/sock.cpp @@ -61,6 +61,12 @@ namespace mongo { + using std::endl; + using std::pair; + using std::string; + using std::stringstream; + using std::vector; + MONGO_FP_DECLARE(throwSockExcep); static bool ipv6 = false; diff --git a/src/mongo/util/net/ssl_options.cpp b/src/mongo/util/net/ssl_options.cpp index f49397f49e4..c6e33a8a32a 100644 --- a/src/mongo/util/net/ssl_options.cpp +++ b/src/mongo/util/net/ssl_options.cpp @@ -40,6 +40,8 @@ namespace mongo { + using std::string; + Status addSSLServerOptions(moe::OptionSection* options) { options->addOptionChaining("net.ssl.sslOnNormalPorts", "sslOnNormalPorts", moe::Switch, "use ssl on configured ports") diff --git a/src/mongo/util/ntservice.cpp b/src/mongo/util/ntservice.cpp index 88ed53de62e..eb19146bc65 100644 --- a/src/mongo/util/ntservice.cpp +++ b/src/mongo/util/ntservice.cpp @@ -48,6 +48,7 @@ #include "mongo/util/text.h" #include "mongo/util/winutil.h" +using std::string; using std::wstring; namespace mongo { diff --git a/src/mongo/util/options_parser/environment.cpp b/src/mongo/util/options_parser/environment.cpp index c85989c4c7c..1178b6e356f 100644 --- a/src/mongo/util/options_parser/environment.cpp +++ b/src/mongo/util/options_parser/environment.cpp @@ -39,6 +39,8 @@ namespace mongo { namespace optionenvironment { using boost::shared_ptr; + using std::string; + using std::type_info; // Environment implementation diff --git a/src/mongo/util/safe_num.cpp b/src/mongo/util/safe_num.cpp index 437a1818f2c..d6f7f99a3da 100644 --- a/src/mongo/util/safe_num.cpp +++ b/src/mongo/util/safe_num.cpp @@ -38,6 +38,8 @@ namespace mongo { + using std::ostringstream; + SafeNum::SafeNum(const BSONElement& element) { switch (element.type()) { case NumberInt: diff --git a/src/mongo/util/signal_handlers.cpp b/src/mongo/util/signal_handlers.cpp index 51f7af74baf..6217ae9bc7b 100644 --- a/src/mongo/util/signal_handlers.cpp +++ b/src/mongo/util/signal_handlers.cpp @@ -65,6 +65,8 @@ namespace { namespace mongo { + using std::endl; + /* * WARNING: PLEASE READ BEFORE CHANGING THIS MODULE * diff --git a/src/mongo/util/stringutils.cpp b/src/mongo/util/stringutils.cpp index ad9e6021424..85c7e8c3a87 100644 --- a/src/mongo/util/stringutils.cpp +++ b/src/mongo/util/stringutils.cpp @@ -36,6 +36,9 @@ namespace mongo { + using std::string; + using std::vector; + void splitStringDelim( const string& str , vector<string>* res , char delim ) { if ( str.empty() ) return; diff --git a/src/mongo/util/stringutils_test.cpp b/src/mongo/util/stringutils_test.cpp index fef78254d34..12a93c7c8f6 100644 --- a/src/mongo/util/stringutils_test.cpp +++ b/src/mongo/util/stringutils_test.cpp @@ -34,6 +34,8 @@ namespace mongo { + using std::string; + TEST(Comparison, Basic) { // diff --git a/src/mongo/util/version.cpp b/src/mongo/util/version.cpp index 160cc485829..0c5454ea014 100644 --- a/src/mongo/util/version.cpp +++ b/src/mongo/util/version.cpp @@ -37,6 +37,9 @@ namespace mongo { + using std::string; + using std::stringstream; + /* Approved formats for versionString: * 1.2.3 * 1.2.3-pre- diff --git a/src/mongo/util/version_reporting.cpp b/src/mongo/util/version_reporting.cpp index 4eb57619b31..a82c1556fb0 100644 --- a/src/mongo/util/version_reporting.cpp +++ b/src/mongo/util/version_reporting.cpp @@ -46,6 +46,10 @@ namespace mongo { + using std::endl; + using std::string; + using std::stringstream; + void printGitVersion() { log() << "git version: " << gitVersion() << endl; } const std::string openSSLVersion(const std::string &prefix, const std::string &suffix) { |