diff options
author | t00fcxen <t00fcxen@9df1edf5-d72c-5b5f-11c0-5f5209eb73f7> | 2012-09-07 17:17:21 +0000 |
---|---|---|
committer | t00fcxen <t00fcxen@9df1edf5-d72c-5b5f-11c0-5f5209eb73f7> | 2012-09-07 17:17:21 +0000 |
commit | dafd8955085808979e9571e8884c3849e08c569c (patch) | |
tree | 644693014303eefb8100239a603472196c1b3b31 /programs/tsctp.c | |
parent | 22898d3252f8fbc128067c26700a8f65df336e16 (diff) | |
download | usrsctp-dafd8955085808979e9571e8884c3849e08c569c.tar.gz |
Address more warnings.
Diffstat (limited to 'programs/tsctp.c')
-rw-r--r-- | programs/tsctp.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/programs/tsctp.c b/programs/tsctp.c index 2cc52a34..3d81f5f3 100644 --- a/programs/tsctp.c +++ b/programs/tsctp.c @@ -119,7 +119,7 @@ gettimeofday(struct timeval *tv, void *ignore) struct timeb tb; ftime(&tb); - tv->tv_sec = tb.time; + tv->tv_sec = (long)tb.time; tv->tv_usec = tb.millitm * 1000; } #endif @@ -128,7 +128,7 @@ static void* handle_connection(void *arg) { ssize_t n; - unsigned long long sum = 0; + unsigned long long sum = 0, first_length = 0; char *buf; #ifdef _WIN32 HANDLE tid; @@ -141,7 +141,6 @@ handle_connection(void *arg) unsigned long messages = 0; unsigned long recv_calls = 0; unsigned long notifications = 0; - unsigned int first_length; int flags; struct sockaddr_in addr; socklen_t len; @@ -169,7 +168,6 @@ handle_connection(void *arg) &infolen, &infotype, &flags); gettimeofday(&start_time, NULL); - first_length = 0; while (n > 0) { recv_calls++; if (flags & MSG_NOTIFICATION) { @@ -206,7 +204,7 @@ handle_connection(void *arg) gettimeofday(&now, NULL); timersub(&now, &start_time, &diff_time); seconds = diff_time.tv_sec + (double)diff_time.tv_usec/1000000.0; - printf("%u, %lu, %lu, %lu, %llu, %f, %f\n", + printf("%llu, %lu, %lu, %lu, %llu, %f, %f\n", first_length, messages, recv_calls, notifications, sum, seconds, (double)first_length * (double)messages / seconds); fflush(stdout); usrsctp_close(conn_sock); |