Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Please the checkers (sonar, codacy)
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 10 May 2020 13:02:46 +0000 (15:02 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 10 May 2020 13:09:04 +0000 (15:09 +0200)
- reduce the scope of a variable
- Mark a constructor as explicit
- Blindly obey the given hints about javascript that I don't really master

docs/source/_ext/showfile.js
examples/c/dht-kademlia/answer.c
src/mc/remote/RemoteSimulation.hpp

index fd8ae6c..200bbdb 100644 (file)
@@ -3,10 +3,10 @@ $(function() {
     /**
      * Toggle logic
      */
-    $('.hidden-content').hide()
-    $('.toggle-header').click(function () {
+    $(".hidden-content").hide();
+    $(".toggle-header").click(function () {
         $(this).toggleClass("open");
-        $(this).next('.toggle-content').toggle('400');
-    })
+        $(this).next(".toggle-content").toggle('400');
+    });
 });
 
index c50d506..3d71da1 100644 (file)
@@ -23,11 +23,9 @@ answer_t answer_init(unsigned int destination_id)
 /** Destroys a node answer object. */
 void answer_free(answer_t answer)
 {
-  unsigned int i;
   if (answer) {
-    for (i = 0; i < answer->size; i++) {
+    for (unsigned int i = 0; i < answer->size; i++)
       node_contact_free(*(void**)xbt_dynar_get_ptr(answer->nodes, i));
-    }
     xbt_dynar_free(&answer->nodes);
   }
   xbt_free(answer);
index 4d2ce16..55f3f97 100644 (file)
@@ -73,7 +73,7 @@ private:
   static constexpr int cache_simix_processes = 4;
 
 public:
-  RemoteSimulation(pid_t pid);
+  explicit RemoteSimulation(pid_t pid);
   ~RemoteSimulation();
   void init();