Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sonar smells of the day.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 1 Nov 2017 16:15:29 +0000 (17:15 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 2 Nov 2017 16:12:48 +0000 (17:12 +0100)
src/mc/compare.cpp
src/mc/mc_dwarf.cpp
src/mc/mc_global.cpp
src/mc/remote/RemoteClient.cpp
teshsuite/mc/dwarf/dwarf.cpp

index 386e017..ab4bc29 100644 (file)
@@ -122,7 +122,8 @@ namespace {
  *
  *  It can hash pairs: the standard hash currently doesn't include this.
  */
-template<class X> struct hash : public std::hash<X> {};
+template <class X> class hash : public std::hash<X> {
+};
 
 template <class X, class Y> class hash<std::pair<X, Y>> {
 public:
index e7ae570..daedf1a 100644 (file)
@@ -815,10 +815,10 @@ static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(
 
   // The current code needs a variable name,
   // generate a fake one:
-  if (variable->name.empty())
-    variable->name =
-      "@anonymous#" + std::to_string(mc_anonymous_variable_index++);
-
+  if (variable->name.empty()) {
+    variable->name = "@anonymous#" + std::to_string(mc_anonymous_variable_index);
+    mc_anonymous_variable_index++;
+  }
   return variable;
 }
 
index 0e86c47..b06c18d 100644 (file)
@@ -163,7 +163,8 @@ static void MC_dump_stacks(FILE* file)
 {
   int nstack = 0;
   for (auto const& stack : mc_model_checker->process().stack_areas()) {
-    fprintf(file, "Stack %i:\n", nstack++);
+    fprintf(file, "Stack %i:\n", nstack);
+    nstack++;
 
     simgrid::mc::UnwindContext context;
     unw_context_t raw_context =
index d24507b..0172d70 100644 (file)
@@ -415,7 +415,6 @@ std::string RemoteClient::read_string(RemotePtr<char> address) const
   if (not address)
     return {};
 
-  // TODO, use std::vector with .data() in C++17 to avoid useless copies
   std::vector<char> res(128);
   off_t off = 0;
 
index 0bc60e6..de1555f 100644 (file)
@@ -25,7 +25,8 @@ int test_some_array[4][5][6];
 struct some_struct {
   int first;
   int second[4][5];
-} test_some_struct;
+};
+some_struct test_some_struct;
 
 static simgrid::mc::Type* find_type_by_name(simgrid::mc::ObjectInformation* info, const char* name)
 {