]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
global: Build without using namespace declarations in headers
authorAdam C. Emerson <aemerson@redhat.com>
Sat, 21 Mar 2020 06:21:17 +0000 (02:21 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Sun, 22 Mar 2020 04:28:00 +0000 (00:28 -0400)
This is part of a series of commits to clean up using namespace at top
level in headers.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/global/global_init.cc
src/global/pidfile.cc
src/global/signal_handler.cc

index 0afeddb12a5f9bcc31937f99765424bced6efc01..f396da9ed58034b08c05e9acedc2c105d3096171 100644 (file)
 
 #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<std::string,std::string> *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<string> plugins_list;
+  std::list<string> plugins_list;
   get_str_list(plugins, plugins_list);
-  for (list<string>::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<std::string>("erasure_code_dir"),
     &ss);
index 25e4f22826e3860e00253d6e941795d0edc82e33..69b8467b37e3487b0a7b86be0fbdc9ab1e7cecc0 100644 (file)
@@ -29,6 +29,8 @@
 
 #include "include/compat.h"
 
+using std::string;
+
 //
 // derr can be used for functions exclusively called from pidfile_write
 //
index c3f17f632ec38fe88955004afff224a57f3cdc80..0447f96e1b18138ddc0122a8b9bae9310c88b141 100644 (file)
@@ -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;