Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sonar treats
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 31 May 2017 06:52:20 +0000 (08:52 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 31 May 2017 06:52:20 +0000 (08:52 +0200)
examples/java/dht/chord/Node.java
examples/java/dht/kademlia/Answer.java
examples/msg/app-bittorrent/peer.c
include/simgrid/s4u/Mutex.hpp
include/simgrid/simix.h
include/xbt/config.h

index 1817ab3..87c4e50 100644 (file)
@@ -330,9 +330,9 @@ public class Node extends Process {
 
   // Performs a find successor request to a random id.
   private void randomLookup() {
-    int id = 1337;
-    //Msg.info("Making a lookup request for id " + id);
-    findSuccessor(id);
+    int dest = 1337;
+    //Msg.info("Making a lookup request for id " + dest);
+    findSuccessor(dest);
   }
 
   /**
index c339c3b..7a34831 100644 (file)
@@ -59,7 +59,7 @@ public class Answer {
 
   /* Returns if the destination has been found */
   public boolean destinationFound() {
-    if (nodes.size() < 1) {
+    if (nodes.isEmpty()) {
       return false;
     }
     Contact tail = nodes.get(0);
index 40a8256..959e523 100644 (file)
@@ -454,7 +454,7 @@ void remove_current_piece(peer_t peer, connection_t remote_peer, unsigned int cu
 void update_pieces_count_from_bitfield(peer_t peer, unsigned int bitfield)
 {
   for (int i = 0; i < FILE_PIECES; i++) {
-    if ((bitfield & (1U << i))) {
+    if (bitfield & (1U << i)) {
       peer->pieces_count[i]++;
     }
   }
index 05199bd..0d1f227 100644 (file)
@@ -37,7 +37,7 @@ XBT_PUBLIC_CLASS Mutex {
   friend ConditionVariable;
   friend simgrid::simix::MutexImpl;
   simgrid::simix::MutexImpl* mutex_;
-  Mutex(simgrid::simix::MutexImpl * mutex) : mutex_(mutex) {}
+  explicit Mutex(simgrid::simix::MutexImpl * mutex) : mutex_(mutex) {}
 
   /* refcounting of the intrusive_ptr is delegated to the implementation object */
   friend void intrusive_ptr_add_ref(Mutex* mutex)
index 7f2d4e7..64f9aac 100644 (file)
@@ -110,8 +110,6 @@ typedef enum {
 
 /* Process creation/destruction callbacks */
 typedef void (*void_pfn_smxprocess_t) (smx_actor_t);
-/* for auto-restart function */
-typedef void (*void_pfn_sghost_t) (sg_host_t);
 
 extern int smx_context_stack_size;
 extern int smx_context_stack_size_was_set;
index fa0b5d4..1131871 100644 (file)
@@ -12,8 +12,6 @@
 #include <stdarg.h>
 #include <xbt/dynar.h>
 
-SG_BEGIN_DECL()
-
 /** @addtogroup XBT_config
  *  @brief Changing the configuration of SimGrid components (grounding feature)
  *
@@ -67,6 +65,8 @@ typedef simgrid::config::Config* xbt_cfg_t;
 typedef void* xbt_cfg_t;
 #endif
 
+SG_BEGIN_DECL()
+
 XBT_PUBLIC(void) xbt_cfg_set_parse(const char *options);
 
 /* Set the value of the cell \a name in \a cfg with the provided value.*/