]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/tools: build without "using namespace std"
authorKefu Chai <kchai@redhat.com>
Wed, 11 Aug 2021 10:24:34 +0000 (18:24 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 13 Aug 2021 04:23:39 +0000 (12:23 +0800)
* add "std::" prefix in headers
* add "using" declarations in .cc files.

so we don't rely on "using namespace std" in one or more included
headers.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/tools/store_nbd/store-nbd.cc
src/tools/crimson/perf_async_msgr.cc
src/tools/crimson/perf_crimson_msgr.cc
src/tools/crimson/perf_staged_fltree.cc

index 149373601dce14744da0a3819c912b2536ad4418..c4398942208bb724eeff95ac8a776ea043c65567 100644 (file)
@@ -293,7 +293,7 @@ int main(int argc, char** argv)
     return seastar::async([&] {
       seastar_apps_lib::stop_signal should_stop;
       crimson::common::sharded_conf()
-        .start(EntityName{}, string_view{"ceph"}).get();
+        .start(EntityName{}, std::string_view{"ceph"}).get();
       auto stop_conf = seastar::defer([] {
         crimson::common::sharded_conf().stop().get();
       });
index 25d1d410e4931ea5974aa296da9507c1f7a09927..af8b9ec40afc9067cabc63a7ef9e9786a128704a 100644 (file)
@@ -28,7 +28,7 @@ struct Server {
     msgr->set_require_authorizer(false);
   }
   DummyAuthClientServer dummy_auth;
-  unique_ptr<Messenger> msgr;
+  std::unique_ptr<Messenger> msgr;
   struct ServerDispatcher : Dispatcher {
     unsigned msg_len = 0;
     bufferlist msg_data;
index 19eada68d13f6b20e412b2dee59c92637fda485b..35de1d6e73d7c6644c9e16a9f8ec02d6c94c5a2e 100644 (file)
@@ -22,6 +22,9 @@
 #include "crimson/net/Dispatcher.h"
 #include "crimson/net/Messenger.h"
 
+using namespace std;
+using namespace std::chrono_literals;
+
 namespace bpo = boost::program_options;
 
 namespace {
index 537a0a9080c308db2fb788fd14ffcbf5c14de33a..81b6217506f0d6acb57739977160c9be3dcc9e59 100644 (file)
@@ -115,7 +115,7 @@ seastar::future<> run(const bpo::variables_map& config) {
     ceph_assert(erase_ratio <= 1);
 
     using crimson::common::sharded_conf;
-    sharded_conf().start(EntityName{}, string_view{"ceph"}).get();
+    sharded_conf().start(EntityName{}, std::string_view{"ceph"}).get();
     seastar::engine().at_exit([] {
       return sharded_conf().stop();
     });