changeset 2070:f39bb84d8383

* tests/server_test.c: use socklen_t. * tests/nc_test_slave.c: use socklen_t and diag_print type fixes to stop warnings with gcc4.x * tests/tcp_echo.c: use socklen_t and diag_print type fixes to stop warnings with gcc4.x * tests/ping_test.c: use socklen_t. * tests/dhcp_test.c: use socklen_t.
author asl
date Fri, 16 Sep 2005 15:15:14 +0000
parents e400ce1dbe07
children e2b325763b2d
files packages/net/common/current/ChangeLog packages/net/common/current/tests/dhcp_test.c packages/net/common/current/tests/flood.c packages/net/common/current/tests/ftp_test.c packages/net/common/current/tests/nc_test_slave.c packages/net/common/current/tests/ping_test.c packages/net/common/current/tests/server_test.c packages/net/common/current/tests/tcp_echo.c
diffstat 8 files changed, 34 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/packages/net/common/current/ChangeLog
+++ b/packages/net/common/current/ChangeLog
@@ -1,3 +1,13 @@
+2005-09-16  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* tests/server_test.c: use socklen_t.
+	* tests/nc_test_slave.c: use socklen_t and diag_print type fixes
+	to stop warnings with gcc4.x
+	* tests/tcp_echo.c: use socklen_t and diag_print type fixes to
+	stop warnings with gcc4.x
+	* tests/ping_test.c: use socklen_t.
+	* tests/dhcp_test.c: use socklen_t.
+	
 2005-09-05  David Vrabel  <dvrabel@arcom.com>
             Andrew Lunn   <andrew.lunn@ascom.ch>
 	
--- a/packages/net/common/current/tests/dhcp_test.c
+++ b/packages/net/common/current/tests/dhcp_test.c
@@ -166,7 +166,8 @@ ping_host(int s, struct sockaddr_in *hos
     cyg_tick_count_t *tp;
     long *dp;
     struct sockaddr_in from;
-    int i, len, fromlen;
+    int i, len;
+    socklen_t fromlen;
 
     ok_recv = 0;
     bogus_recv = 0;
--- a/packages/net/common/current/tests/flood.c
+++ b/packages/net/common/current/tests/flood.c
@@ -216,7 +216,8 @@ floodrecv(cyg_addrword_t p)
 {
     unsigned char pkt[MAX_PACKET];
     struct sockaddr_in from;
-    int len, fromlen;
+    int len; 
+    socklen_t fromlen;
 
     diag_printf("PING listener...\n" );
     for (;;) {
--- a/packages/net/common/current/tests/ftp_test.c
+++ b/packages/net/common/current/tests/ftp_test.c
@@ -54,7 +54,8 @@ pexit(char *s)
 static void
 ftp_test(struct bootp *bp)
 {
-    int s, len, slen;
+    int s, slen;
+    socklen_t len;
     struct sockaddr_in host, local;
     struct servent *sent;
     char buf[256];
--- a/packages/net/common/current/tests/nc_test_slave.c
+++ b/packages/net/common/current/tests/nc_test_slave.c
@@ -290,7 +290,8 @@ do_read(int fd, void *buf, int buflen)
 static void
 do_tcp_test(int s1, struct nc_request *req, struct sockaddr_in *master)
 {
-    int i, s, len, td_len, seq, seq_errors, lost, test_chan, res;
+    int i, s, td_len, seq, seq_errors, lost, test_chan, res;
+    socklen_t len;
     struct sockaddr_in test_chan_slave, test_chan_master;
     struct nc_test_results results;
     struct nc_test_data *tdp;
@@ -427,7 +428,8 @@ do_tcp_test(int s1, struct nc_request *r
 static void
 nc_slave(test_param_t param)
 {
-    int s, masterlen;
+    int s;
+    socklen_t masterlen;
     struct sockaddr_in my_addr, master;
     struct nc_request req;
     struct nc_reply reply;
@@ -603,7 +605,7 @@ calibrate_load(int desired_load)
         load_idle = idle_thread_count;
         start_load(0);                         // Shut down background load
         percent_load = 100 - ((load_idle * 100) / no_load_idle);
-        diag_printf("High Load[%d] = %d => %d%%\n", load_thread_level, 
+        diag_printf("High Load[%ld] = %d => %d%%\n", load_thread_level, 
                     (int)idle_thread_count, percent_load);
         if ( percent_load > desired_load )
             break; // HIGH level is indeed higher
@@ -622,7 +624,7 @@ calibrate_load(int desired_load)
         load_idle = idle_thread_count;
         start_load(0);                         // Shut down background load
         percent_load = 100 - ((load_idle * 100) / no_load_idle);
-        diag_printf("Load[%d] = %d => %d%%\n", load_thread_level, 
+        diag_printf("Load[%ld] = %d => %d%%\n", load_thread_level, 
                     (int)idle_thread_count, percent_load);
         if (((high-low) <= 1) || (abs(desired_load-percent_load) <= 2)) break;
         if (percent_load < desired_load) {
@@ -644,7 +646,7 @@ calibrate_load(int desired_load)
     load_idle = idle_thread_count;
     start_load(0);                         // Shut down background load
     percent_load = 100 - ((load_idle * 100) / no_load_idle);
-    diag_printf("Final load[%d] = %d => %d%%\n", load_thread_level, 
+    diag_printf("Final load[%ld] = %d => %d%%\n", load_thread_level, 
                 (int)idle_thread_count, percent_load);
 //    no_load_idle_count_1_second = no_load_idle;
 }
--- a/packages/net/common/current/tests/ping_test.c
+++ b/packages/net/common/current/tests/ping_test.c
@@ -172,7 +172,8 @@ ping_host(int s, struct sockaddr_in *hos
     cyg_tick_count_t *tp;
     long *dp;
     struct sockaddr_in from;
-    int i, len, fromlen;
+    int i, len;
+    socklen_t fromlen;
 
     ok_recv = 0;
     bogus_recv = 0;
--- a/packages/net/common/current/tests/server_test.c
+++ b/packages/net/common/current/tests/server_test.c
@@ -55,7 +55,8 @@ pexit(char *s)
 static void
 server_test(struct bootp *bp)
 {
-    int s, client, client_len;
+    int s, client;
+    socklen_t client_len;
     struct sockaddr_in client_addr, local;
     char buf[256];
     int one = 1;
--- a/packages/net/common/current/tests/tcp_echo.c
+++ b/packages/net/common/current/tests/tcp_echo.c
@@ -216,7 +216,7 @@ calibrate_load(int desired_load)
         load_idle = idle_thread_count;
         start_load(0);                         // Shut down background load
         percent_load = 100 - ((load_idle * 100) / no_load_idle);
-        diag_printf("High Load[%d] = %d => %d%%\n", load_thread_level, 
+        diag_printf("High Load[%ld] = %d => %d%%\n", load_thread_level, 
                     (int)idle_thread_count, percent_load);
         if ( percent_load > desired_load )
             break; // HIGH level is indeed higher
@@ -235,7 +235,7 @@ calibrate_load(int desired_load)
         load_idle = idle_thread_count;
         start_load(0);                         // Shut down background load
         percent_load = 100 - ((load_idle * 100) / no_load_idle);
-        diag_printf("Load[%d] = %d => %d%%\n", load_thread_level, 
+        diag_printf("Load[%ld] = %d => %d%%\n", load_thread_level, 
                     (int)idle_thread_count, percent_load);
         if (((high-low) <= 1) || (abs(desired_load-percent_load) <= 2)) break;
         if (percent_load < desired_load) {
@@ -257,7 +257,7 @@ calibrate_load(int desired_load)
     load_idle = idle_thread_count;
     start_load(0);                         // Shut down background load
     percent_load = 100 - ((load_idle * 100) / no_load_idle);
-    diag_printf("Final load[%d] = %d => %d%%\n", load_thread_level, 
+    diag_printf("Final load[%ld] = %d => %d%%\n", load_thread_level, 
                 (int)idle_thread_count, percent_load);
     no_load_idle_count_1_second = no_load_idle;
 }
@@ -359,7 +359,8 @@ echo_test(cyg_addrword_t p)
     struct sockaddr_in e_source_addr, e_sink_addr, local;
     int one = 1;
     fd_set in_fds;
-    int i, num, len;
+    int i, num;
+    socklen_t len;
     struct test_params params,nparams;
     struct test_status status,nstatus;
 
@@ -443,7 +444,7 @@ echo_test(cyg_addrword_t p)
     params.bufsize = ntohl(nparams.bufsize);
     params.load = ntohl(nparams.load);
   
-    diag_printf("Using %d buffers of %d bytes each, %d%% background load\n", 
+    diag_printf("Using %ld buffers of %ld bytes each, %ld%% background load\n", 
                 params.nbufs, params.bufsize, params.load);
 
     // Tell the sink what the parameters are
@@ -517,7 +518,7 @@ echo_test(cyg_addrword_t p)
     cyg_semaphore_wait(&idle_thread_sem);  // Stop idle thread
     start_load(0);                         // Shut down background load
     i = 100 - ((idle_thread_count * 100) / no_load_idle_count_1_second );
-    diag_printf("Final load[%d] = %d => %d%%\n", load_thread_level, 
+    diag_printf("Final load[%ld] = %d => %d%%\n", load_thread_level, 
                 (int)idle_thread_count, i);
 
 //#ifdef CYGDBG_USE_ASSERTS