From a66cfa3e250bfd537fb32d32f71c44115beeb6f6 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 9 Jun 2020 10:32:46 +0200 Subject: [PATCH] Prefer using initialization lists in ctors. --- src/smpi/mpi/smpi_request.cpp | 14 +++++++++++--- src/surf/network_ns3.cpp | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/smpi/mpi/smpi_request.cpp b/src/smpi/mpi/smpi_request.cpp index 7812f96a1e..58892ed47c 100644 --- a/src/smpi/mpi/smpi_request.cpp +++ b/src/smpi/mpi/smpi_request.cpp @@ -33,10 +33,18 @@ extern void (*smpi_comm_copy_data_callback)(simgrid::kernel::activity::CommImpl* namespace simgrid{ namespace smpi{ -Request::Request(const void* buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm, unsigned flags, MPI_Op op) - : buf_(const_cast(buf)), old_type_(datatype), src_(src), dst_(dst), tag_(tag), comm_(comm), flags_(flags), op_(op) +Request::Request(const void* buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm, + unsigned flags, MPI_Op op) + : buf_(const_cast(buf)) + , old_type_(datatype) + , size_(datatype->size() * count) + , src_(src) + , dst_(dst) + , tag_(tag) + , comm_(comm) + , flags_(flags) + , op_(op) { - size_ = datatype->size() * count; datatype->ref(); comm_->ref(); if(op != MPI_REPLACE && op != MPI_OP_NULL) diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index f74f504da3..7c6fc979ca 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -282,11 +282,11 @@ void NetworkNS3Model::update_actions_state(double now, double delta) LinkNS3::LinkNS3(NetworkNS3Model* model, const std::string& name, double bandwidth, double latency, s4u::Link::SharingPolicy policy) - : LinkImpl(model, name, nullptr) + : LinkImpl(model, name, nullptr), sharing_policy_(policy) { bandwidth_.peak = bandwidth; latency_.peak = latency; - sharing_policy_ = policy; + /* If wifi, create the wifizone now. If not, don't do anything: the links will be created in routeCreate_cb */ s4u::Link::on_creation(*this->get_iface()); -- 2.20.1