X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6985b5de45eda7769cd98891461948ae298eb8c3..7d195832dafde68afd749dd614e9a14d697bdb92:/src/kernel/routing/ClusterZone.cpp diff --git a/src/kernel/routing/ClusterZone.cpp b/src/kernel/routing/ClusterZone.cpp index 6cb3575468..84052939e9 100644 --- a/src/kernel/routing/ClusterZone.cpp +++ b/src/kernel/routing/ClusterZone.cpp @@ -40,19 +40,19 @@ void ClusterBase::set_link_characteristics(double bw, double lat, s4u::Link::Sha link_lat_ = lat; } -void ClusterBase::add_private_link_at(unsigned int position, std::pair link) +void ClusterBase::add_private_link_at(unsigned long position, std::pair link) { private_links_.insert({position, link}); } -void ClusterBase::set_gateway(unsigned int position, NetPoint* gateway) +void ClusterBase::set_gateway(unsigned long position, NetPoint* gateway) { xbt_assert(not gateway || not gateway->is_netzone(), "ClusterBase: gateway cannot be another netzone %s", gateway->get_cname()); gateways_[position] = gateway; } -NetPoint* ClusterBase::get_gateway(unsigned int position) +NetPoint* ClusterBase::get_gateway(unsigned long position) { NetPoint* res = nullptr; auto it = gateways_.find(position); @@ -73,13 +73,13 @@ void ClusterBase::fill_leaf_from_cb(unsigned long position, const std::vector dims_array(dimensions.size()); + auto index_to_dims = [&dimensions](unsigned long index) { + std::vector dims_array(dimensions.size()); for (auto i = static_cast(dimensions.size() - 1); i >= 0; --i) { if (index <= 0) { break; } - unsigned int value = index % dimensions[i]; + unsigned long value = index % dimensions[i]; dims_array[i] = value; index = (index / dimensions[i]); }