X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cd641543689ed33eb33ac4f3905f63d3d6a0d541..65b0ef3e4abf59f79ff89fa7644aff2451922729:/examples/msg/bittorrent/messages.c diff --git a/examples/msg/bittorrent/messages.c b/examples/msg/bittorrent/messages.c index d165051276..374b686530 100644 --- a/examples/msg/bittorrent/messages.c +++ b/examples/msg/bittorrent/messages.c @@ -7,7 +7,7 @@ #include "bittorrent.h" XBT_LOG_NEW_DEFAULT_CATEGORY(msg_messages, - "Messages specific for the message factory"); + "Messages specific for the message factory"); #define BITS_TO_BYTES(x) ((x / 8) + (x % 8) ? 1 : 0) @@ -20,7 +20,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_messages, * @param size message size in bytes */ msg_task_t task_message_new(e_message_type type, const char *issuer_host_name, - const char *mailbox, int peer_id, int size) + const char *mailbox, int peer_id, int size) { message_t message = xbt_new(s_message_t, 1); message->issuer_host_name = issuer_host_name; @@ -36,39 +36,39 @@ msg_task_t task_message_new(e_message_type type, const char *issuer_host_name, * Builds a message containing an index. */ msg_task_t task_message_index_new(e_message_type type, - const char *issuer_host_name, - const char *mailbox, int peer_id, - int index, int varsize) + const char *issuer_host_name, + const char *mailbox, int peer_id, + int index, int varsize) { msg_task_t task = task_message_new(type, issuer_host_name, mailbox, peer_id, - task_message_size(type) + varsize); + task_message_size(type) + varsize); message_t message = MSG_task_get_data(task); message->index = index; return task; } msg_task_t task_message_bitfield_new(const char *issuer_host_name, - const char *mailbox, int peer_id, - char *bitfield, int bitfield_size) + const char *mailbox, int peer_id, + char *bitfield, int bitfield_size) { msg_task_t task = - task_message_new(MESSAGE_BITFIELD, issuer_host_name, mailbox, peer_id, - task_message_size(MESSAGE_BITFIELD) + - /* Size of bitfield in bytes */ - BITS_TO_BYTES(bitfield_size)); + task_message_new(MESSAGE_BITFIELD, issuer_host_name, mailbox, peer_id, + task_message_size(MESSAGE_BITFIELD) + + /* Size of bitfield in bytes */ + BITS_TO_BYTES(bitfield_size)); message_t message = MSG_task_get_data(task); message->bitfield = bitfield; return task; } msg_task_t task_message_request_new(const char *issuer_host_name, - const char *mailbox, int peer_id, - int index, int block_index, - int block_length) + const char *mailbox, int peer_id, + int index, int block_index, + int block_length) { msg_task_t task = - task_message_index_new(MESSAGE_REQUEST, issuer_host_name, mailbox, - peer_id, index, 0); + task_message_index_new(MESSAGE_REQUEST, issuer_host_name, mailbox, + peer_id, index, 0); message_t message = MSG_task_get_data(task); message->block_index = block_index; message->block_length = block_length; @@ -76,13 +76,13 @@ msg_task_t task_message_request_new(const char *issuer_host_name, } msg_task_t task_message_piece_new(const char *issuer_host_name, - const char *mailbox, int peer_id, int index, - int stalled, int block_index, - int block_length, int block_size) + const char *mailbox, int peer_id, int index, + int stalled, int block_index, + int block_length, int block_size) { msg_task_t task = - task_message_index_new(MESSAGE_PIECE, issuer_host_name, mailbox, peer_id, - index, block_length * block_size); + task_message_index_new(MESSAGE_PIECE, issuer_host_name, mailbox, peer_id, + index, block_length * block_size); message_t message = MSG_task_get_data(task); message->stalled = stalled; message->block_index = block_index;