From: Adam C. Emerson Date: Sat, 21 Mar 2020 06:21:17 +0000 (-0400) Subject: global: Build without using namespace declarations in headers X-Git-Tag: v17.0.0~2842^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2f56e9b6d892151186770863c595a3f595e09c50;p=ceph.git global: Build without using namespace declarations in headers This is part of a series of commits to clean up using namespace at top level in headers. Signed-off-by: Adam C. Emerson --- diff --git a/src/global/global_init.cc b/src/global/global_init.cc index 0afeddb12a5f9..f396da9ed5803 100644 --- a/src/global/global_init.cc +++ b/src/global/global_init.cc @@ -38,6 +38,10 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_ + +using std::cerr; +using std::string; + static void global_init_set_globals(CephContext *cct) { g_ceph_context = cct; @@ -197,13 +201,13 @@ global_init(const std::map *defaults, if (g_conf()->fatal_signal_handlers) { install_standard_sighandlers(); } - register_assert_context(g_ceph_context); + ceph::register_assert_context(g_ceph_context); if (g_conf()->log_flush_on_exit) g_ceph_context->_log->set_flush_on_exit(); // drop privileges? - ostringstream priv_ss; + std::ostringstream priv_ss; // consider --setuser root a no-op, even if we're not root if (getuid() != 0) { @@ -570,11 +574,9 @@ int global_init_preload_erasure_code(const CephContext *cct) string plugins = conf->osd_erasure_code_plugins; // validate that this is a not a legacy plugin - list plugins_list; + std::list plugins_list; get_str_list(plugins, plugins_list); - for (list::iterator i = plugins_list.begin(); - i != plugins_list.end(); - ++i) { + for (auto i = plugins_list.begin(); i != plugins_list.end(); ++i) { string plugin_name = *i; string replacement = ""; @@ -598,8 +600,8 @@ int global_init_preload_erasure_code(const CephContext *cct) } } - stringstream ss; - int r = ErasureCodePluginRegistry::instance().preload( + std::stringstream ss; + int r = ceph::ErasureCodePluginRegistry::instance().preload( plugins, conf.get_val("erasure_code_dir"), &ss); diff --git a/src/global/pidfile.cc b/src/global/pidfile.cc index 25e4f22826e38..69b8467b37e34 100644 --- a/src/global/pidfile.cc +++ b/src/global/pidfile.cc @@ -29,6 +29,8 @@ #include "include/compat.h" +using std::string; + // // derr can be used for functions exclusively called from pidfile_write // diff --git a/src/global/signal_handler.cc b/src/global/signal_handler.cc index c3f17f632ec38..0447f96e1b181 100644 --- a/src/global/signal_handler.cc +++ b/src/global/signal_handler.cc @@ -40,6 +40,12 @@ extern char *sys_siglist[]; #define dout_context g_ceph_context +using std::ostringstream; +using std::string; + +using ceph::BackTrace; +using ceph::JSONFormatter; + void install_sighandler(int signum, signal_handler_t handler, int flags) { int ret;