X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2d16ebcee6bde01575b4cd88a853e1ac1c2532bf..027274ae8707c374384dbef37ae24a1c80b4fd10:/src/xbt/xbt_trp_plugin_tcp.c diff --git a/src/xbt/xbt_trp_plugin_tcp.c b/src/xbt/xbt_trp_plugin_tcp.c index 000016d1ac..cf171bf3a6 100644 --- a/src/xbt/xbt_trp_plugin_tcp.c +++ b/src/xbt/xbt_trp_plugin_tcp.c @@ -224,7 +224,7 @@ static xbt_socket_t xbt_trp_sock_socket_accept(xbt_socket_t sock) int failed = 0; - XBT_IN(""); + XBT_IN(); xbt_socket_new_ext(1, &res, sock->plugin, sock->buf_size, 0); sd = accept(sock->sd, (struct sockaddr *) &peer_in, &peer_in_len); @@ -326,7 +326,7 @@ static XBT_INLINE void xbt_trp_tcp_send(xbt_socket_t sock, int status = 0; status = tcp_write(sock->sd, data, (size_t) size); - XBT_DEBUG("write(%d, %p, %ld);", sock->sd, data, size); + XBT_DEBUG("write(%d, %p, %lu);", sock->sd, data, size); if (status < 0) { #ifdef EWOULDBLOCK @@ -336,7 +336,7 @@ static XBT_INLINE void xbt_trp_tcp_send(xbt_socket_t sock, #endif continue; - THROWF(system_error, 0, "write(%d,%p,%ld) failed: %s", + THROWF(system_error, 0, "write(%d,%p,%lu) failed: %s", sock->sd, data, size, sock_errstr(sock_errno)); } @@ -368,15 +368,15 @@ xbt_trp_tcp_recv_withbuffer(xbt_socket_t sock, while (size > got) { int status = 0; - XBT_DEBUG("read(%d, %p, %ld) got %d so far (%s)", + XBT_DEBUG("read(%d, %p, %lu) got %d so far (%s)", sock->sd, data + got, bufsize, got, hexa_str((unsigned char *) data, got, 0)); status = tcp_read(sock->sd, data + got, (size_t) bufsize); if (status < 0) { THROWF(system_error, 0, - "read(%d,%p,%d) from %s:%d failed: %s; got %d so far", - sock->sd, data + got, (int) size, xbt_socket_peer_name(sock), + "read(%d,%p,%lu) from %s:%d failed: %s; got %d so far", + sock->sd, data + got, size, xbt_socket_peer_name(sock), xbt_socket_peer_port(sock), sock_errstr(sock_errno), got); } XBT_DEBUG("Got %d more bytes (%s)", status, @@ -419,7 +419,7 @@ static void xbt_trp_bufiov_flush(xbt_socket_t sock) int size; #endif xbt_trp_bufdata_t *data = sock->bufdata; - XBT_IN(""); + XBT_IN(); XBT_DEBUG("Flush"); if (data->out == buffering_buf) { @@ -468,15 +468,15 @@ xbt_trp_buf_send(xbt_socket_t sock, xbt_trp_bufdata_t *data = (xbt_trp_bufdata_t *) sock->bufdata; int chunk_pos = 0; - XBT_IN(""); + XBT_IN(); while (chunk_pos < size) { /* size of the chunk to receive in that shot */ long int thissize = min(size - chunk_pos, data->buffsize - data->out_buf.size); - XBT_DEBUG("Set the chars %d..%ld into the buffer; size=%ld, ctn=(%s)", - (int) data->out_buf.size, - ((int) data->out_buf.size) + thissize - 1, size, + XBT_DEBUG("Set the chars %d..%ld into the buffer; size=%lu, ctn=(%s)", + data->out_buf.size, + data->out_buf.size + thissize - 1, size, hexa_str((unsigned char *) chunk, thissize, 0)); memcpy(data->out_buf.data + data->out_buf.size, chunk + chunk_pos, @@ -484,7 +484,7 @@ xbt_trp_buf_send(xbt_socket_t sock, data->out_buf.size += thissize; chunk_pos += thissize; - XBT_DEBUG("New pos = %d; Still to send = %ld of %ld; ctn sofar=(%s)", + XBT_DEBUG("New pos = %d; Still to send = %lu of %lu; ctn sofar=(%s)", data->out_buf.size, size - chunk_pos, size, hexa_str((unsigned char *) chunk, chunk_pos, 0)); @@ -502,7 +502,7 @@ xbt_trp_buf_recv(xbt_socket_t sock, char *chunk, unsigned long int size) xbt_trp_bufdata_t *data = sock->bufdata; long int chunk_pos = 0; - XBT_IN(""); + XBT_IN(); while (chunk_pos < size) { /* size of the chunk to receive in that shot */ @@ -528,7 +528,7 @@ xbt_trp_buf_recv(xbt_socket_t sock, char *chunk, unsigned long int size) data->in_buf.pos += thissize; chunk_pos += thissize; - XBT_DEBUG("New pos = %d; Still to receive = %ld of %ld. Ctn so far=(%s)", + XBT_DEBUG("New pos = %d; Still to receive = %lu of %lu. Ctn so far=(%s)", data->in_buf.pos, size - chunk_pos, size, hexa_str((unsigned char *) chunk, chunk_pos, 0)); } @@ -860,7 +860,7 @@ const char *xbt_wsa_err2string(int err) RETSTR(WSANOTINITIALISED); RETSTR(WSAEDISCON); -#ifdef HAVE_WINSOCK2 +#ifdef HAVE_WINSOCK2_H RETSTR(WSAENOMORE); RETSTR(WSAECANCELLED); RETSTR(WSAEINVALIDPROCTABLE); @@ -871,7 +871,7 @@ const char *xbt_wsa_err2string(int err) RETSTR(WSA_E_NO_MORE); RETSTR(WSA_E_CANCELLED); RETSTR(WSAEREFUSED); -#endif /* HAVE_WINSOCK2 */ +#endif /* HAVE_WINSOCK2_H */ RETSTR(WSAHOST_NOT_FOUND); RETSTR(WSATRY_AGAIN);