Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Minor sonar related changes
authorBruno Donassolo <bruno.donassolo@inria.fr>
Wed, 12 May 2021 09:11:06 +0000 (11:11 +0200)
committerBruno Donassolo <bruno.donassolo@inria.fr>
Wed, 12 May 2021 09:11:06 +0000 (11:11 +0200)
src/surf/sg_platf.cpp
src/surf/xml/platf_private.hpp
teshsuite/s4u/seal-platform/seal-platform.cpp

index 7b72b44..882e3fb 100644 (file)
@@ -38,7 +38,7 @@ xbt::signal<void(ClusterCreationArgs const&)> on_cluster_creation;
 } // namespace kernel
 } // namespace simgrid
 
-simgrid::kernel::routing::ClusterZoneCreationArgs
+static simgrid::kernel::routing::ClusterZoneCreationArgs
     zone_cluster; /* temporary store data for irregular clusters, created with <zone routing="Cluster"> */
 
 /** The current NetZone in the parsing */
@@ -363,8 +363,9 @@ void sg_platf_new_tag_cluster(simgrid::kernel::routing::ClusterCreationArgs* clu
 /*************************************************************************************************/
 /** @brief Set the links for internal node inside a Cluster(Star) */
 static void sg_platf_cluster_set_hostlink(simgrid::kernel::routing::StarZone* zone,
-                                          simgrid::kernel::routing::NetPoint* netpoint, simgrid::s4u::Link* link_up,
-                                          simgrid::s4u::Link* link_down, simgrid::kernel::resource::LinkImpl* backbone)
+                                          simgrid::kernel::routing::NetPoint* netpoint,
+                                          const simgrid::s4u::Link* link_up, const simgrid::s4u::Link* link_down,
+                                          simgrid::kernel::resource::LinkImpl* backbone)
 {
   XBT_DEBUG("Push Host_link for host '%s' to position %u", netpoint->get_cname(), netpoint->id());
   if (backbone) {
@@ -410,7 +411,7 @@ static void sg_platf_build_cabinet(simgrid::kernel::routing::StarZone* zone,
   }
 }
 
-void sg_platf_zone_cluster_populate(simgrid::kernel::routing::ClusterZoneCreationArgs* cluster)
+static void sg_platf_zone_cluster_populate(const simgrid::kernel::routing::ClusterZoneCreationArgs* cluster)
 {
   auto* zone = dynamic_cast<simgrid::kernel::routing::StarZone*>(current_routing);
   xbt_assert(zone, "Host_links are only valid for Cluster(Star)");
@@ -577,7 +578,7 @@ sg_platf_create_zone(const simgrid::kernel::routing::ZoneCreationArgs* zone)
 simgrid::kernel::routing::NetZoneImpl* sg_platf_new_Zone_begin(const simgrid::kernel::routing::ZoneCreationArgs* zone)
 {
   zone_cluster.routing = zone->routing;
-  current_routing = sg_platf_create_zone(zone);
+  current_routing      = sg_platf_create_zone(zone);
 
   return current_routing;
 }
index 6c0c475..b5443e8 100644 (file)
@@ -199,8 +199,6 @@ XBT_PUBLIC void
 sg_platf_new_peer(const simgrid::kernel::routing::PeerCreationArgs* peer); // Add a peer to the current Zone
 XBT_PUBLIC void sg_platf_new_tag_cluster(
     simgrid::kernel::routing::ClusterCreationArgs* clust); // Add a regular cluster  to the current Zone
-XBT_PUBLIC void sg_platf_zone_cluster_populate(
-    simgrid::kernel::routing::ClusterZoneCreationArgs* clust); // Add a routing cluster to the current Zone
 XBT_PUBLIC simgrid::kernel::routing::NetPoint*                                      // Add a router to the current Zone
 sg_platf_new_router(const std::string&, const std::string& coords);
 XBT_PUBLIC void
index a91e452..325d32d 100644 (file)
@@ -51,14 +51,14 @@ public:
     auto received = mbox->get_unique<std::string>();
     XBT_INFO("I got a '%s'.", received->c_str());
 
-    sg4::Disk* disk      = sg4::Host::current()->get_disks().front();
-    sg_size_t write_size = disk->write(4e6);
+    const sg4::Disk* disk = sg4::Host::current()->get_disks().front();
+    sg_size_t write_size  = disk->write(4e6);
     XBT_INFO("Wrote %llu bytes on '%s'", write_size, disk->get_cname());
   }
 };
 
 /*************************************************************************************************/
-static sg4::NetZone* create_zone(sg4::NetZone* root, const std::string& id)
+static sg4::NetZone* create_zone(const sg4::NetZone* root, const std::string& id)
 {
   auto* zone = sg4::create_floyd_zone(id);
   zone->set_parent(root);