From: Arnaud Giersch Date: Tue, 11 Apr 2023 13:26:28 +0000 (+0200) Subject: Misc sonar issues. X-Git-Tag: v3.34~178 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/dcdf664682e926bc945f7dea46d4cc672d38498c Misc sonar issues. --- diff --git a/src/dag/loaders.cpp b/src/dag/loaders.cpp index 465e0afb2b..f0d18268fd 100644 --- a/src/dag/loaders.cpp +++ b/src/dag/loaders.cpp @@ -95,7 +95,7 @@ std::vector create_DAG_from_json(const std::string& filename) std::ifstream f(filename); auto data = nlohmann::json::parse(f); std::vector dag = {}; - std::map> successors = {}; + std::map, std::less<>> successors = {}; std::map comms_destinations = {}; ActivityPtr current; diff --git a/src/mc/remote/AppSide.cpp b/src/mc/remote/AppSide.cpp index b66d7a10ce..a9983f094b 100644 --- a/src/mc/remote/AppSide.cpp +++ b/src/mc/remote/AppSide.cpp @@ -24,6 +24,7 @@ #include #include +#include #include // setvbuf #include #include @@ -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(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, diff --git a/src/mc/remote/Channel.cpp b/src/mc/remote/Channel.cpp index c7d57feef0..63a6393e43 100644 --- a/src/mc/remote/Channel.cpp +++ b/src/mc/remote/Channel.cpp @@ -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(message); + auto* whereto = static_cast(message); size_t todo = size; if (bufsize > 0) { XBT_DEBUG("%d %zu bytes (of %zu expected) are already in buffer", getpid(), bufsize, size);