From: Arnaud Giersch Date: Mon, 23 Dec 2019 13:39:27 +0000 (+0100) Subject: Cosmetics: use empty parentheses for new std::container. X-Git-Tag: v3.25~238 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b204ff04eae43a5f5a8825141ae0647b92507bc8 Cosmetics: use empty parentheses for new std::container. --- diff --git a/src/instr/instr_platform.cpp b/src/instr/instr_platform.cpp index f0dd78aa8d..ef07fe1c01 100644 --- a/src/instr/instr_platform.cpp +++ b/src/instr/instr_platform.cpp @@ -138,8 +138,8 @@ static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t } xbt_graph_t graph = xbt_graph_new_graph(0, nullptr); - std::map* nodes = new std::map; - std::map* edges = new std::map; + std::map* nodes = new std::map(); + std::map* edges = new std::map(); netzone->get_impl()->get_graph(graph, nodes, edges); for (auto elm : *edges) { @@ -278,7 +278,7 @@ static void instr_netpoint_on_creation(simgrid::kernel::routing::NetPoint const& static void instr_on_platform_created() { currentContainer.clear(); - std::set* filter = new std::set; + std::set* filter = new std::set(); XBT_DEBUG("Starting graph extraction."); recursiveGraphExtraction(simgrid::s4u::Engine::get_instance()->get_netzone_root(), simgrid::instr::Container::get_root(), filter); @@ -508,8 +508,8 @@ static void recursiveXBTGraphExtraction(xbt_graph_t graph, std::map* nodes = new std::map; - std::map* edges = new std::map; + std::map* nodes = new std::map(); + std::map* edges = new std::map(); recursiveXBTGraphExtraction(ret, nodes, edges, simgrid::s4u::Engine::get_instance()->get_netzone_root(), simgrid::instr::Container::get_root()); delete nodes; diff --git a/src/simdag/sd_dotloader.cpp b/src/simdag/sd_dotloader.cpp index 90d8662e18..bfd0ddb8c8 100644 --- a/src/simdag/sd_dotloader.cpp +++ b/src/simdag/sd_dotloader.cpp @@ -99,7 +99,7 @@ xbt_dynar_t SD_dotload_generic(const char* filename, bool sequential, bool sched if (comp != computers.end()) { computer = comp->second; } else { - computer = new std::vector; + computer = new std::vector(); computers.insert({char_performer, computer}); } if (static_cast(order) < computer->size()) { diff --git a/src/smpi/bindings/smpi_pmpi_coll.cpp b/src/smpi/bindings/smpi_pmpi_coll.cpp index 0a97fa032b..dd38bb4c85 100644 --- a/src/smpi/bindings/smpi_pmpi_coll.cpp +++ b/src/smpi/bindings/smpi_pmpi_coll.cpp @@ -176,7 +176,7 @@ int PMPI_Igatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, voi int rank = simgrid::s4u::this_actor::get_pid(); int dt_size_recv = recvtype->is_replayable() ? 1 : recvtype->size(); - std::vector* trace_recvcounts = new std::vector; + std::vector* trace_recvcounts = new std::vector(); if (comm->rank() == root) { for (int i = 0; i < comm->size(); i++) // copy data to avoid bad free trace_recvcounts->push_back(recvcounts[i] * dt_size_recv); @@ -275,7 +275,7 @@ int PMPI_Iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, int rank = simgrid::s4u::this_actor::get_pid(); int dt_size_recv = recvtype->is_replayable() ? 1 : recvtype->size(); - std::vector* trace_recvcounts = new std::vector; + std::vector* trace_recvcounts = new std::vector(); for (int i = 0; i < comm->size(); i++) { // copy data to avoid bad free trace_recvcounts->push_back(recvcounts[i] * dt_size_recv); } @@ -377,7 +377,7 @@ int PMPI_Iscatterv(const void* sendbuf, const int* sendcounts, const int* displs int rank = simgrid::s4u::this_actor::get_pid(); int dt_size_send = sendtype->is_replayable() ? 1 : sendtype->size(); - std::vector* trace_sendcounts = new std::vector; + std::vector* trace_sendcounts = new std::vector(); if (comm->rank() == root) { for (int i = 0; i < comm->size(); i++) { // copy data to avoid bad free trace_sendcounts->push_back(sendcounts[i] * dt_size_send); @@ -576,7 +576,7 @@ int PMPI_Ireduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcoun smpi_bench_end(); int rank = simgrid::s4u::this_actor::get_pid(); - std::vector* trace_recvcounts = new std::vector; + std::vector* trace_recvcounts = new std::vector(); int dt_send_size = datatype->is_replayable() ? 1 : datatype->size(); int totalcount = 0; @@ -733,8 +733,8 @@ int PMPI_Ialltoallv(const void* sendbuf, const int* sendcounts, const int* sendd smpi_bench_end(); int send_size = 0; int recv_size = 0; - std::vector* trace_sendcounts = new std::vector; - std::vector* trace_recvcounts = new std::vector; + std::vector* trace_sendcounts = new std::vector(); + std::vector* trace_recvcounts = new std::vector(); int dt_size_recv = recvtype->size(); const int* real_sendcounts = sendcounts; @@ -824,8 +824,8 @@ int PMPI_Ialltoallw(const void* sendbuf, const int* sendcounts, const int* sendd int send_size = 0; int recv_size = 0; - std::vector* trace_sendcounts = new std::vector; - std::vector* trace_recvcounts = new std::vector; + std::vector* trace_sendcounts = new std::vector(); + std::vector* trace_recvcounts = new std::vector(); const int* real_sendcounts = sendcounts; const int* real_senddispls = senddispls; diff --git a/src/smpi/bindings/smpi_pmpi_request.cpp b/src/smpi/bindings/smpi_pmpi_request.cpp index 88a4c98267..dc9f48eaf4 100644 --- a/src/smpi/bindings/smpi_pmpi_request.cpp +++ b/src/smpi/bindings/smpi_pmpi_request.cpp @@ -427,8 +427,8 @@ int PMPI_Sendrecv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, int int src_traced = getPid(comm, src); // FIXME: Hack the way to trace this one - std::vector* dst_hack = new std::vector; - std::vector* src_hack = new std::vector; + std::vector* dst_hack = new std::vector(); + std::vector* src_hack = new std::vector(); dst_hack->push_back(dst_traced); src_hack->push_back(src_traced); TRACE_smpi_comm_in(my_proc_id, __func__, diff --git a/src/smpi/mpi/smpi_f2c.cpp b/src/smpi/mpi/smpi_f2c.cpp index 0c0cab3912..bb8e9cf73b 100644 --- a/src/smpi/mpi/smpi_f2c.cpp +++ b/src/smpi/mpi/smpi_f2c.cpp @@ -66,7 +66,7 @@ void F2C::free_f(int id) int F2C::add_f() { if (f2c_lookup_ == nullptr) - f2c_lookup_ = new std::unordered_map; + f2c_lookup_ = new std::unordered_map(); char key[KEY_SIZE]; my_f2c_id_=f2c_id_; @@ -78,7 +78,7 @@ int F2C::add_f() int F2C::c2f() { if (f2c_lookup_ == nullptr) { - f2c_lookup_ = new std::unordered_map; + f2c_lookup_ = new std::unordered_map(); } if(my_f2c_id_==-1) @@ -91,7 +91,7 @@ int F2C::c2f() F2C* F2C::f2c(int id) { if (f2c_lookup_ == nullptr) - f2c_lookup_ = new std::unordered_map; + f2c_lookup_ = new std::unordered_map(); if(id >= 0){ char key[KEY_SIZE]; diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 98b7b871ed..c4f452e26a 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -196,7 +196,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster simgrid::kernel::routing::HostCreationArgs host; host.id = host_id; if ((cluster->properties != nullptr) && (not cluster->properties->empty())) { - host.properties = new std::unordered_map; + host.properties = new std::unordered_map(); for (auto const& elm : *cluster->properties) host.properties->insert({elm.first, elm.second}); diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 05ea270185..134ba2de62 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -48,7 +48,7 @@ static void XBT_ATTRIB_DESTRUCTOR(800) simgrid_free_plugin_description() XBT_PUBLIC void simgrid_add_plugin_description(const char* name, const char* description, void_f_void_t init_fun) { if (not surf_plugin_description) - surf_plugin_description = new std::vector; + surf_plugin_description = new std::vector(); surf_plugin_description->emplace_back(surf_model_description_t{name, description, init_fun}); }