From 4b7251c4ac80f95f82ac25ecfb3a9f618150cb11 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 13 Jun 2020 14:55:31 +0200 Subject: [PATCH] fix some long -> double faulty convertions reported by sonar --- examples/s4u/async-waituntil/s4u-async-waituntil.cpp | 4 ++-- src/xbt/config.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/s4u/async-waituntil/s4u-async-waituntil.cpp b/examples/s4u/async-waituntil/s4u-async-waituntil.cpp index f2a7c83b9a..d63273f8ae 100644 --- a/examples/s4u/async-waituntil/s4u-async-waituntil.cpp +++ b/examples/s4u/async-waituntil/s4u-async-waituntil.cpp @@ -21,8 +21,8 @@ static void sender(int argc, char** argv) { xbt_assert(argc == 4, "Expecting 3 parameters from the XML deployment file but got %d", argc); long messages_count = std::stol(argv[1]); /* - number of messages */ - double msg_size = std::stol(argv[2]); /* - message size in bytes */ - long receivers_count = std::stod(argv[3]); /* - number of receivers */ + double msg_size = std::stod(argv[2]); /* - message size in bytes */ + long receivers_count = std::stol(argv[3]); /* - number of receivers */ std::vector pending_comms; diff --git a/src/xbt/config.cpp b/src/xbt/config.cpp index 8d05c901dd..e3b4f9a385 100644 --- a/src/xbt/config.cpp +++ b/src/xbt/config.cpp @@ -97,7 +97,7 @@ template class ConfigType; template <> class ConfigType { public: static constexpr const char* type_name = "int"; - static inline double parse(const char* value) + static inline int parse(const char* value) { return parse_long(value); } -- 2.30.2