Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename variables to avoid shadowing outer declarations.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 16 Mar 2022 16:39:52 +0000 (17:39 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 16 Mar 2022 18:03:09 +0000 (19:03 +0100)
include/xbt/automaton.hpp
include/xbt/functional.hpp
src/smpi/include/smpi_file.hpp

index aea5fc6..49d55f5 100644 (file)
@@ -23,11 +23,7 @@ template <class F> xbt_automaton_propositional_symbol_t add_proposition(const_xb
 {
   auto* callback = new F(std::move(f));
   return xbt_automaton_propositional_symbol_new_callback(
-    a, id,
-    [](void* callback) -> int { return (*(F*)callback)(); },
-    callback,
-    [](void* callback) -> void { delete (F*)callback; }
-  );
+      a, id, [](void* cb) -> int { return (*(F*)cb)(); }, callback, [](void* cb) -> void { delete (F*)cb; });
 }
 
 }
index e4baff1..1bb1e36 100644 (file)
@@ -168,7 +168,7 @@ public:
   }
 
 private:
-  template <class F> typename std::enable_if_t<canSBO<F>()> init(F code)
+  template <class F> typename std::enable_if_t<canSBO<F>()> init(F task_code)
   {
     const static TaskVtable vtable {
       // Call:
@@ -194,11 +194,11 @@ private:
         src_code->~F();
       }
     };
-    new(&buffer_) F(std::move(code));
+    new (&buffer_) F(std::move(task_code));
     vtable_ = &vtable;
   }
 
-  template <class F> typename std::enable_if_t<not canSBO<F>()> init(F code)
+  template <class F> typename std::enable_if_t<not canSBO<F>()> init(F task_code)
   {
     const static TaskVtable vtable {
       // Call:
@@ -216,7 +216,7 @@ private:
       // Move:
       nullptr
     };
-    *reinterpret_cast<F**>(&buffer_) = new F(std::move(code));
+    *reinterpret_cast<F**>(&buffer_) = new F(std::move(task_code));
     vtable_ = &vtable;
   }
 
index 92a4c29..bfd883c 100644 (file)
@@ -150,8 +150,7 @@ int File::op_all(void* buf, int count, const Datatype* datatype, MPI_Status* sta
   chunks.push_back(ranges[0]);
 
   unsigned int nchunks = 0;
-  unsigned int i       = 1;
-  while (i < ranges.size()) {
+  for (unsigned i = 1; i < ranges.size(); i++) {
     if (ranges[i].second > chunks[nchunks].second) {
       // else range included - ignore
       if (ranges[i].first > chunks[nchunks].second) {
@@ -163,11 +162,10 @@ int File::op_all(void* buf, int count, const Datatype* datatype, MPI_Status* sta
         chunks[nchunks].second = ranges[i].second;
       }
     }
-    i++;
   }
   // what do I need to read ?
   MPI_Offset totreads = 0;
-  for (i = 0; i < chunks.size(); i++) {
+  for (unsigned i = 0; i < chunks.size(); i++) {
     if (chunks[i].second < my_chunk_start)
       continue;
     else if (chunks[i].first > my_chunk_end)