]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
c++11: replace auto_ptr with unique_ptr
authorCasey Bodley <cbodley@redhat.com>
Thu, 30 Jul 2015 20:18:55 +0000 (16:18 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 3 Aug 2015 15:16:13 +0000 (11:16 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/auth/KeyRing.cc
src/include/memory.h
src/osd/PG.cc
src/osd/PG.h
src/test/admin_socket.cc

index 63f2ccdb9c2e2bcba5261a60a09322469409c2b0..f5793239e853444f8a013d2b43ce2d58ee8eadc9 100644 (file)
@@ -33,7 +33,6 @@
 #undef dout_prefix
 #define dout_prefix *_dout << "auth: "
 
-using std::auto_ptr;
 using namespace std;
 
 int KeyRing::from_ceph_context(CephContext *cct)
index b829e48b682a63068177bf7f4e56bc8282f99de8..409b49fd6b164aaf450d80fca8a6586864301ee6 100644 (file)
@@ -6,6 +6,7 @@
 namespace ceph {
   using std::shared_ptr;
   using std::weak_ptr;
+  using std::unique_ptr;
   using std::static_pointer_cast;
 }
 
index 8b17288c6d1c8e7029c11fc2f8230874ac1a2c4e..9afcddac4e1de44e07049a8472ea22f3bdbaf9d5 100644 (file)
@@ -835,7 +835,7 @@ bool PG::all_unfound_are_queried_or_lost(const OSDMapRef osdmap) const
   return true;
 }
 
-void PG::build_prior(std::auto_ptr<PriorSet> &prior_set)
+void PG::build_prior(std::unique_ptr<PriorSet> &prior_set)
 {
   if (1) {
     // sanity check
@@ -6751,7 +6751,7 @@ PG::RecoveryState::GetInfo::GetInfo(my_context ctx)
 
   PG *pg = context< RecoveryMachine >().pg;
   pg->generate_past_intervals();
-  auto_ptr<PriorSet> &prior_set = context< Peering >().prior_set;
+  unique_ptr<PriorSet> &prior_set = context< Peering >().prior_set;
 
   assert(pg->blocked_by.empty());
 
@@ -6768,7 +6768,7 @@ PG::RecoveryState::GetInfo::GetInfo(my_context ctx)
 void PG::RecoveryState::GetInfo::get_infos()
 {
   PG *pg = context< RecoveryMachine >().pg;
-  auto_ptr<PriorSet> &prior_set = context< Peering >().prior_set;
+  unique_ptr<PriorSet> &prior_set = context< Peering >().prior_set;
 
   pg->blocked_by.clear();
   for (set<pg_shard_t>::const_iterator it = prior_set->probe.begin();
@@ -6815,7 +6815,7 @@ boost::statechart::result PG::RecoveryState::GetInfo::react(const MNotifyRec& in
   epoch_t old_start = pg->info.history.last_epoch_started;
   if (pg->proc_replica_info(infoevt.from, infoevt.notify.info)) {
     // we got something new ...
-    auto_ptr<PriorSet> &prior_set = context< Peering >().prior_set;
+    unique_ptr<PriorSet> &prior_set = context< Peering >().prior_set;
     if (old_start < pg->info.history.last_epoch_started) {
       dout(10) << " last_epoch_started moved forward, rebuilding prior" << dendl;
       pg->build_prior(prior_set);
@@ -7153,7 +7153,7 @@ PG::RecoveryState::Incomplete::Incomplete(my_context ctx)
   pg->state_clear(PG_STATE_PEERING);
   pg->state_set(PG_STATE_INCOMPLETE);
 
-  auto_ptr<PriorSet> &prior_set = context< Peering >().prior_set;
+  unique_ptr<PriorSet> &prior_set = context< Peering >().prior_set;
   assert(pg->blocked_by.empty());
   pg->blocked_by.insert(prior_set->down.begin(), prior_set->down.end());
   pg->publish_stats_to_osd();
index 6c089b316f72cf7a5466710b04600a052bf5c55b..8c1f0ed757066f9bffb6d876acf67406fdf1553c 100644 (file)
@@ -811,7 +811,7 @@ public:
   bool _calc_past_interval_range(epoch_t *start, epoch_t *end, epoch_t oldest_map);
   void generate_past_intervals();
   void trim_past_intervals();
-  void build_prior(std::auto_ptr<PriorSet> &prior_set);
+  void build_prior(std::unique_ptr<PriorSet> &prior_set);
 
   void remove_down_peer_info(const OSDMapRef osdmap);
 
@@ -1640,7 +1640,7 @@ public:
     struct Active;
 
     struct Peering : boost::statechart::state< Peering, Primary, GetInfo >, NamedState {
-      std::auto_ptr< PriorSet > prior_set;
+      std::unique_ptr< PriorSet > prior_set;
 
       Peering(my_context ctx);
       void exit();
index ab52cecb88fedff14da98748e7e6ad23195fbdff..b26acb8908d5352ab3160b4aaaf0785c0da61691 100644 (file)
@@ -48,14 +48,14 @@ public:
 };
 
 TEST(AdminSocket, Teardown) {
-  std::auto_ptr<AdminSocket>
+  std::unique_ptr<AdminSocket>
       asokc(new AdminSocket(g_ceph_context));
   AdminSocketTest asoct(asokc.get());
   ASSERT_EQ(true, asoct.shutdown());
 }
 
 TEST(AdminSocket, TeardownSetup) {
-  std::auto_ptr<AdminSocket>
+  std::unique_ptr<AdminSocket>
       asokc(new AdminSocket(g_ceph_context));
   AdminSocketTest asoct(asokc.get());
   ASSERT_EQ(true, asoct.shutdown());
@@ -64,7 +64,7 @@ TEST(AdminSocket, TeardownSetup) {
 }
 
 TEST(AdminSocket, SendHelp) {
-  std::auto_ptr<AdminSocket>
+  std::unique_ptr<AdminSocket>
       asokc(new AdminSocket(g_ceph_context));
   AdminSocketTest asoct(asokc.get());
   ASSERT_EQ(true, asoct.shutdown());
@@ -96,7 +96,7 @@ TEST(AdminSocket, SendHelp) {
 }
 
 TEST(AdminSocket, SendNoOp) {
-  std::auto_ptr<AdminSocket>
+  std::unique_ptr<AdminSocket>
       asokc(new AdminSocket(g_ceph_context));
   AdminSocketTest asoct(asokc.get());
   ASSERT_EQ(true, asoct.shutdown());
@@ -127,7 +127,7 @@ class MyTest : public AdminSocketHook {
 };
 
 TEST(AdminSocket, RegisterCommand) {
-  std::auto_ptr<AdminSocket>
+  std::unique_ptr<AdminSocket>
       asokc(new AdminSocket(g_ceph_context));
   AdminSocketTest asoct(asokc.get());
   ASSERT_EQ(true, asoct.shutdown());
@@ -159,7 +159,7 @@ class MyTest2 : public AdminSocketHook {
 };
 
 TEST(AdminSocket, RegisterCommandPrefixes) {
-  std::auto_ptr<AdminSocket>
+  std::unique_ptr<AdminSocket>
       asokc(new AdminSocket(g_ceph_context));
   AdminSocketTest asoct(asokc.get());
   ASSERT_EQ(true, asoct.shutdown());
@@ -202,7 +202,7 @@ public:
 
 TEST(AdminSocketClient, Ping) {
   string path = get_rand_socket_path();
-  std::auto_ptr<AdminSocket>
+  std::unique_ptr<AdminSocket>
       asokc(new AdminSocket(g_ceph_context));
   AdminSocketClient client(path);
   // no socket
@@ -251,7 +251,7 @@ TEST(AdminSocketClient, Ping) {
 
 TEST(AdminSocket, bind_and_listen) {
   string path = get_rand_socket_path();
-  std::auto_ptr<AdminSocket>
+  std::unique_ptr<AdminSocket>
       asokc(new AdminSocket(g_ceph_context));
 
   AdminSocketTest asoct(asokc.get());