diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-10-06 17:54:17 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-10-10 15:34:54 +0200 |
commit | 47797a2fed69a92885c6c09dec3c431dff413f62 (patch) | |
tree | c090275d4bf57ec3deb0cd0bb2162f918941f004 | |
parent | ba2b24fdeadef27af4dd49ad09a57c378e05308f (diff) |
Get rid of using namespace std
-rw-r--r-- | bbot/agent/agent.cxx | 12 | ||||
-rw-r--r-- | bbot/worker/worker.cxx | 11 |
2 files changed, 15 insertions, 8 deletions
diff --git a/bbot/agent/agent.cxx b/bbot/agent/agent.cxx index c8e316a..54d7056 100644 --- a/bbot/agent/agent.cxx +++ b/bbot/agent/agent.cxx @@ -36,10 +36,12 @@ #include <bbot/agent/tftp.hxx> #include <bbot/agent/machine.hxx> -using namespace std; using namespace butl; using namespace bbot; +using std::cout; +using std::endl; + namespace bbot { agent_options ops; @@ -829,7 +831,7 @@ try if (gethostname (buf, sizeof (buf)) == -1) fail << "unable to obtain hostname: " - << system_error (errno, generic_category ()); // Sanitize. + << system_error (errno, std::generic_category ()); // Sanitize. hname = buf; } @@ -841,7 +843,7 @@ try // if (signal (SIGPIPE, SIG_IGN) == SIG_ERR) fail << "unable to ignore broken pipe (SIGPIPE) signal: " - << system_error (errno, generic_category ()); // Sanitize. + << system_error (errno, std::generic_category ()); // Sanitize. // Version. // @@ -897,7 +899,7 @@ try if (signal (SIGHUP, &handle_signal) == SIG_ERR || signal (SIGTERM, &handle_signal) == SIG_ERR) fail << "unable to set signal handler: " - << system_error (errno, generic_category ()); // Sanitize. + << system_error (errno, std::generic_category ()); // Sanitize. optional<string> fingerprint; @@ -1239,7 +1241,7 @@ namespace bbot { if (rand_seed == 0) rand_seed = static_cast<unsigned int> ( - chrono::system_clock::now ().time_since_epoch ().count ()); + std::chrono::system_clock::now ().time_since_epoch ().count ()); return static_cast<size_t> (rand_r (&rand_seed)); } diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx index 348075b..6040d9e 100644 --- a/bbot/worker/worker.cxx +++ b/bbot/worker/worker.cxx @@ -12,6 +12,7 @@ #include <regex> #include <cstring> // strchr() +#include <sstream> #include <iostream> #include <libbutl/pager.hxx> @@ -27,10 +28,12 @@ #include <bbot/worker/worker-options.hxx> -using namespace std; using namespace butl; using namespace bbot; +using std::cout; +using std::endl; + namespace bbot { process_path argv0; @@ -60,6 +63,8 @@ catch (const system_error& e) fail << "unable to change current directory to " << d << ": " << e << endf; } +using std::regex; +namespace regex_constants = std::regex_constants; using regexes = vector<regex>; // Run a named command. Name is used for logging and diagnostics only. Match @@ -82,7 +87,7 @@ run_cmd (tracer& t, { t (c, n); - ostringstream os; + std::ostringstream os; process::print (os, c, n); log += os.str (); log += '\n'; @@ -777,7 +782,7 @@ try #ifndef _WIN32 if (signal (SIGPIPE, SIG_IGN) == SIG_ERR) fail << "unable to ignore broken pipe (SIGPIPE) signal: " - << system_error (errno, generic_category ()); // Sanitize. + << system_error (errno, std::generic_category ()); // Sanitize. #else SetErrorMode (SetErrorMode (0) | // Returns the current mode. SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); |