Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove unused variable.
[simgrid.git] / examples / s4u / app-bittorrent / s4u_peer.cpp
index 04bb2e4..0b03bdb 100644 (file)
@@ -18,7 +18,6 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_bt_peer, "Messages specific for the peers");
 #define FILE_PIECES 10UL
 #define PIECES_BLOCKS 5UL
 #define BLOCK_SIZE 16384
-static const unsigned long int FILE_SIZE = FILE_PIECES * PIECES_BLOCKS * BLOCK_SIZE;
 
 /** Number of blocks asked by each request */
 #define BLOCKS_REQUESTED 2
@@ -88,7 +87,7 @@ bool Peer::getPeersFromTracker()
 {
   simgrid::s4u::MailboxPtr tracker_mailbox = simgrid::s4u::Mailbox::byName(TRACKER_MAILBOX);
   // Build the task to send to the tracker
-  TrackerQuery* peer_request = new TrackerQuery(id, mailbox_, 0, 0, FILE_SIZE);
+  TrackerQuery* peer_request = new TrackerQuery(id, mailbox_);
   try {
     XBT_DEBUG("Sending a peer request to the tracker.");
     tracker_mailbox->put(peer_request, TRACKER_COMM_SIZE, GET_PEERS_TIMEOUT);
@@ -657,7 +656,7 @@ bool Peer::hasCompletedPiece(unsigned int piece)
 int Peer::getFirstMissingBlockFrom(int piece)
 {
   for (unsigned int i = 0; i < PIECES_BLOCKS; i++)
-    if (!(bitfield_blocks & 1ULL << (piece * PIECES_BLOCKS + i)))
+    if (not(bitfield_blocks & 1ULL << (piece * PIECES_BLOCKS + i)))
       return i;
   return -1;
 }