]> AND Public Git Repository - simgrid.git/blobdiff - teshsuite/msg/app-bittorrent/connection.h
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Constify pointer and reference parameters in teshsuite/.
[simgrid.git] / teshsuite / msg / app-bittorrent / connection.h
index ccfc52a81865622626ea18d5c0b83110d8affbee..3f3c1706815f37ed154e32cc79c1f20299d29924 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014, 2016. The SimGrid Team.
+/* Copyright (c) 2012-2019. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -9,7 +9,7 @@
 
 /**  Contains the connection data of a peer. */
 typedef struct s_connection {
-  char* id;              // Peer id
+  int id;                // Peer id
   unsigned int bitfield; // Fields
   char* mailbox;
   int messages_count;
@@ -27,7 +27,7 @@ typedef s_connection_t* connection_t;
 /** @brief Build a new connection object from the peer id.
  *  @param id id of the peer
  */
-connection_t connection_new(const char* id);
+connection_t connection_new(int id);
 /** @brief Add a new value to the peer speed average
  *  @param connection connection data
  *  @param speed speed to add to the speed average
@@ -35,5 +35,5 @@ connection_t connection_new(const char* id);
 void connection_add_speed_value(connection_t connection, double speed);
 /** Frees a connection object */
 void connection_free(void* data);
-int connection_has_piece(connection_t connection, unsigned int piece);
+int connection_has_piece(const s_connection_t* connection, unsigned int piece);
 #endif /* BITTORRENT_CONNECTION_H_ */