Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Misc sonar issues.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 11 Apr 2023 13:26:28 +0000 (15:26 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 11 Apr 2023 13:26:28 +0000 (15:26 +0200)
src/dag/loaders.cpp
src/mc/remote/AppSide.cpp
src/mc/remote/Channel.cpp

index 465e0af..f0d1826 100644 (file)
@@ -95,7 +95,7 @@ std::vector<ActivityPtr> create_DAG_from_json(const std::string& filename)
   std::ifstream f(filename);
   auto data = nlohmann::json::parse(f);
   std::vector<ActivityPtr> dag = {};
-  std::map<std::string, std::vector<ActivityPtr>> successors = {};
+  std::map<std::string, std::vector<ActivityPtr>, std::less<>> successors = {};
   std::map<ActivityPtr, Host*> comms_destinations = {};
   ActivityPtr current; 
   
index b66d7a1..a9983f0 100644 (file)
@@ -24,6 +24,7 @@
 #include <simgrid/modelchecker.h>
 
 #include <cerrno>
+#include <cinttypes>
 #include <cstdio> // setvbuf
 #include <cstdlib>
 #include <memory>
@@ -172,7 +173,7 @@ void AppSide::handle_fork(const s_mc_message_int_t* msg)
 
     struct sockaddr_un addr = {};
     addr.sun_family         = AF_UNIX;
-    snprintf(addr.sun_path, 64, "/tmp/simgrid-mc-%lu", static_cast<unsigned long>(msg->value));
+    snprintf(addr.sun_path, 64, "/tmp/simgrid-mc-%" PRIu64, msg->value);
     auto addr_size = offsetof(struct sockaddr_un, sun_path) + strlen(addr.sun_path);
 
     xbt_assert(connect(sock, (struct sockaddr*)&addr, addr_size) >= 0,
index c7d57fe..63a6393 100644 (file)
@@ -50,7 +50,7 @@ ssize_t Channel::receive(void* message, size_t size, int flags)
 {
   size_t bufsize = buffer_.size();
   ssize_t copied = 0;
-  char* whereto  = static_cast<char*>(message);
+  auto* whereto  = static_cast<char*>(message);
   size_t todo    = size;
   if (bufsize > 0) {
     XBT_DEBUG("%d %zu bytes (of %zu expected) are already in buffer", getpid(), bufsize, size);