From 5fbac6d853529658242f08396b2297bc4893c6a0 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 11 Aug 2021 18:24:34 +0800 Subject: [PATCH] crimson/tools: build without "using namespace std" * 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 --- src/crimson/tools/store_nbd/store-nbd.cc | 2 +- src/tools/crimson/perf_async_msgr.cc | 2 +- src/tools/crimson/perf_crimson_msgr.cc | 3 +++ src/tools/crimson/perf_staged_fltree.cc | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/crimson/tools/store_nbd/store-nbd.cc b/src/crimson/tools/store_nbd/store-nbd.cc index 149373601dce1..c4398942208bb 100644 --- a/src/crimson/tools/store_nbd/store-nbd.cc +++ b/src/crimson/tools/store_nbd/store-nbd.cc @@ -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(); }); diff --git a/src/tools/crimson/perf_async_msgr.cc b/src/tools/crimson/perf_async_msgr.cc index 25d1d410e4931..af8b9ec40afc9 100644 --- a/src/tools/crimson/perf_async_msgr.cc +++ b/src/tools/crimson/perf_async_msgr.cc @@ -28,7 +28,7 @@ struct Server { msgr->set_require_authorizer(false); } DummyAuthClientServer dummy_auth; - unique_ptr msgr; + std::unique_ptr msgr; struct ServerDispatcher : Dispatcher { unsigned msg_len = 0; bufferlist msg_data; diff --git a/src/tools/crimson/perf_crimson_msgr.cc b/src/tools/crimson/perf_crimson_msgr.cc index 19eada68d13f6..35de1d6e73d7c 100644 --- a/src/tools/crimson/perf_crimson_msgr.cc +++ b/src/tools/crimson/perf_crimson_msgr.cc @@ -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 { diff --git a/src/tools/crimson/perf_staged_fltree.cc b/src/tools/crimson/perf_staged_fltree.cc index 537a0a9080c30..81b6217506f0d 100644 --- a/src/tools/crimson/perf_staged_fltree.cc +++ b/src/tools/crimson/perf_staged_fltree.cc @@ -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(); }); -- 2.39.5