From 67d8461e1530fcf03ba924c15a97eba2550d78e0 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 20 Nov 2017 10:30:09 +0100 Subject: [PATCH 1/1] Use method get() instead of &* for intrusive_ptr. --- src/mc/mc_request.cpp | 2 +- src/simix/popping_private.hpp | 4 ++-- src/simix/smx_network.cpp | 2 +- src/simix/smx_synchro.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mc/mc_request.cpp b/src/mc/mc_request.cpp index 6a800b7934..c07f4ff139 100644 --- a/src/mc/mc_request.cpp +++ b/src/mc/mc_request.cpp @@ -324,7 +324,7 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid read_element(mc_model_checker->process(), &remote_sync, remote(simcall_comm_waitany__get__comms(req)), value, sizeof(remote_sync)); - char* p = pointer_to_string(&*remote_sync); + char* p = pointer_to_string(remote_sync.get()); args = bprintf("comm=%s (%d of %lu)", p, value + 1, xbt_dynar_length(&comms)); xbt_free(p); diff --git a/src/simix/popping_private.hpp b/src/simix/popping_private.hpp index e0c200a3d6..b7d4b5fa9e 100644 --- a/src/simix/popping_private.hpp +++ b/src/simix/popping_private.hpp @@ -143,8 +143,8 @@ inline void marshal(type>, u_smx_scalar& simcall, boost: if (value.get() == nullptr) { // Sometimes we return nullptr in an intrusive_ptr... simcall.dp = nullptr; } else { - intrusive_ptr_add_ref(&*value); - simcall.dp = static_cast(&*value); + intrusive_ptr_add_ref(value.get()); + simcall.dp = static_cast(value.get()); } } template inline boost::intrusive_ptr unmarshal(type>, u_smx_scalar const& simcall) diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index fde74d4aef..173e0af9c5 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -318,7 +318,7 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t synchro, do } else { /* we need a surf sleep action even when there is no timeout, otherwise surf won't tell us when the host fails */ surf_action_t sleep = simcall->issuer->host->pimpl_cpu->sleep(timeout); - sleep->setData(&*synchro); + sleep->setData(synchro.get()); simgrid::kernel::activity::CommImplPtr comm = boost::static_pointer_cast(synchro); diff --git a/src/simix/smx_synchro.cpp b/src/simix/smx_synchro.cpp index 6194069658..e25a2275d2 100644 --- a/src/simix/smx_synchro.cpp +++ b/src/simix/smx_synchro.cpp @@ -29,7 +29,7 @@ static smx_activity_t SIMIX_synchro_wait(sg_host_t smx_host, double timeout) simgrid::kernel::activity::RawImplPtr sync = simgrid::kernel::activity::RawImplPtr(new simgrid::kernel::activity::RawImpl()); sync->sleep = smx_host->pimpl_cpu->sleep(timeout); - sync->sleep->setData(&*sync); + sync->sleep->setData(sync.get()); XBT_OUT(); return sync; } -- 2.20.1