From 6c26a14068f19d63d09a84e52a00528cc206c7fa Mon Sep 17 00:00:00 2001 From: richardbarry Date: Sun, 12 Sep 2010 21:06:00 +0000 Subject: [PATCH] FreeTCPIP - remove compiler warnings. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1094 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../ethernet/FreeTCPIP/apps/httpd/httpd.c | 13 +++++---- .../ethernet/FreeTCPIP/net/pack_struct_end.h | 4 +++ .../FreeTCPIP/net/pack_struct_start.h | 3 ++ Demo/Common/ethernet/FreeTCPIP/net/uip.h | 11 ++++---- Demo/Common/ethernet/FreeTCPIP/psock.c | 28 +++++++++---------- Demo/Common/ethernet/FreeTCPIP/uip_arp.c | 1 - 6 files changed, 34 insertions(+), 26 deletions(-) diff --git a/Demo/Common/ethernet/FreeTCPIP/apps/httpd/httpd.c b/Demo/Common/ethernet/FreeTCPIP/apps/httpd/httpd.c index d40bafe56..99564a93c 100644 --- a/Demo/Common/ethernet/FreeTCPIP/apps/httpd/httpd.c +++ b/Demo/Common/ethernet/FreeTCPIP/apps/httpd/httpd.c @@ -96,6 +96,8 @@ static PT_THREAD( send_file ( struct httpd_state *s ) ) { PSOCK_BEGIN( &s->sout ); + ( void ) PT_YIELD_FLAG; + do { PSOCK_GENERATOR_SEND( &s->sout, generate_part_of_file, s ); @@ -110,7 +112,8 @@ static PT_THREAD( send_file ( struct httpd_state *s ) ) static PT_THREAD( send_part_of_file ( struct httpd_state *s ) ) { PSOCK_BEGIN( &s->sout ); - + ( void ) PT_YIELD_FLAG; + PSOCK_SEND( &s->sout, s->file.data, s->len ); PSOCK_END( &s->sout ); @@ -131,7 +134,7 @@ static PT_THREAD( handle_script ( struct httpd_state *s ) ) char *ptr; PT_BEGIN( &s->scriptpt ); - + ( void ) PT_YIELD_FLAG; while( s->file.len > 0 ) { /* Check if we should start executing a script. */ @@ -202,7 +205,7 @@ static PT_THREAD( send_headers ( struct httpd_state *s, const char *statushdr ) char *ptr; PSOCK_BEGIN( &s->sout ); - + ( void ) PT_YIELD_FLAG; PSOCK_SEND_STR( &s->sout, statushdr ); ptr = strrchr( s->filename, ISO_period ); @@ -244,7 +247,7 @@ static PT_THREAD( handle_output ( struct httpd_state *s ) ) char *ptr; PT_BEGIN( &s->outputpt ); - + ( void ) PT_YIELD_FLAG; if( !httpd_fs_open(s->filename, &s->file) ) { httpd_fs_open( http_404_html, &s->file ); @@ -275,7 +278,7 @@ static PT_THREAD( handle_output ( struct httpd_state *s ) ) static PT_THREAD( handle_input ( struct httpd_state *s ) ) { PSOCK_BEGIN( &s->sin ); - + ( void ) PT_YIELD_FLAG; PSOCK_READTO( &s->sin, ISO_space ); if( strncmp(s->inputbuf, http_get, 4) != 0 ) diff --git a/Demo/Common/ethernet/FreeTCPIP/net/pack_struct_end.h b/Demo/Common/ethernet/FreeTCPIP/net/pack_struct_end.h index ed4523e48..522a859af 100644 --- a/Demo/Common/ethernet/FreeTCPIP/net/pack_struct_end.h +++ b/Demo/Common/ethernet/FreeTCPIP/net/pack_struct_end.h @@ -17,3 +17,7 @@ #endif +#ifdef __ICCRX__ + ; + #pragma pack() +#endif diff --git a/Demo/Common/ethernet/FreeTCPIP/net/pack_struct_start.h b/Demo/Common/ethernet/FreeTCPIP/net/pack_struct_start.h index 2281682aa..94bc0f522 100644 --- a/Demo/Common/ethernet/FreeTCPIP/net/pack_struct_start.h +++ b/Demo/Common/ethernet/FreeTCPIP/net/pack_struct_start.h @@ -19,3 +19,6 @@ #endif +#ifdef __ICCRX__ + #pragma pack(1) +#endif diff --git a/Demo/Common/ethernet/FreeTCPIP/net/uip.h b/Demo/Common/ethernet/FreeTCPIP/net/uip.h index 709535c1e..12e8242e3 100644 --- a/Demo/Common/ethernet/FreeTCPIP/net/uip.h +++ b/Demo/Common/ethernet/FreeTCPIP/net/uip.h @@ -160,7 +160,7 @@ struct uip_eth_addr uip_ipaddr(&addr, 192,168,1,2); uip_sethostaddr(&addr); - + \endcode * \param addr A pointer to an IP address of type uip_ipaddr_t; * @@ -842,7 +842,7 @@ CCIF void uip_send( const void *data, int len ); \code uip_ipaddr_t addr; struct uip_udp_conn *c; - + uip_ipaddr(&addr, 192,168,2,1); c = uip_udp_new(&addr, HTONS(12345)); if(c != NULL) { @@ -929,7 +929,7 @@ CCIF void uip_send( const void *data, int len ); \code uip_ipaddr_t ipaddr; struct uip_conn *c; - + uip_ipaddr(&ipaddr, 192,168,1,2); c = uip_connect(&ipaddr, HTONS(80)); \endcode @@ -1017,7 +1017,7 @@ CCIF void uip_send( const void *data, int len ); * \hideinitializer */ #ifndef uip_ipaddr_copy -#define uip_ipaddr_copy( dest, src ) ( *(dest) = *(src) ) + #define uip_ipaddr_copy( dest, src ) ( ((unsigned long*)dest)[ 0 ] = ((unsigned long *)src)[ 0 ] ) #endif /** @@ -1443,7 +1443,7 @@ struct uip_stats layer. */ uip_stats_t sent; /**< Number of sent packets at the IP layer. */ - uip_stats_t forwarded; /**< Number of forwarded packets at the IP + uip_stats_t forwarded; /**< Number of forwarded packets at the IP layer. */ uip_stats_t drop; /**< Number of dropped packets at the IP layer. */ @@ -1635,7 +1635,6 @@ struct uip_tcpip_hdr u8_t urgp[2]; u8_t optdata[4]; } - #include "net/pack_struct_end.h" /* The ICMP and IP headers. */ diff --git a/Demo/Common/ethernet/FreeTCPIP/psock.c b/Demo/Common/ethernet/FreeTCPIP/psock.c index 6bd1f6aff..1f224b6e1 100644 --- a/Demo/Common/ethernet/FreeTCPIP/psock.c +++ b/Demo/Common/ethernet/FreeTCPIP/psock.c @@ -119,7 +119,7 @@ buf_bufto(register struct psock_buf *buf, u8_t endmarker, ++buf->ptr; --*datalen; --buf->left; - + if(c == endmarker) { return BUF_FOUND; } @@ -133,12 +133,12 @@ buf_bufto(register struct psock_buf *buf, u8_t endmarker, c = **dataptr; --*datalen; ++*dataptr; - + if(c == endmarker) { return BUF_FOUND | BUF_FULL; } } - + return BUF_FULL; } /*---------------------------------------------------------------------------*/ @@ -178,7 +178,7 @@ PT_THREAD(psock_send(register struct psock *s, const char *buf, unsigned int len)) { PT_BEGIN(&s->psockpt); - + ( void ) PT_YIELD_FLAG; /* If there is no data to send, we exit immediately. */ if(len == 0) { PT_EXIT(&s->psockpt); @@ -209,7 +209,7 @@ PT_THREAD(psock_send(register struct psock *s, const char *buf, } s->state = STATE_NONE; - + PT_END(&s->psockpt); } /*---------------------------------------------------------------------------*/ @@ -217,7 +217,7 @@ PT_THREAD(psock_generator_send(register struct psock *s, unsigned short (*generate)(void *), void *arg)) { PT_BEGIN(&s->psockpt); - + ( void ) PT_YIELD_FLAG; /* Ensure that there is a generator function to call. */ if(generate == NULL) { PT_EXIT(&s->psockpt); @@ -228,7 +228,7 @@ PT_THREAD(psock_generator_send(register struct psock *s, s->sendlen = generate(arg); s->sendptr = uip_appdata; - s->state = STATE_NONE; + s->state = STATE_NONE; do { /* Call the generator function again if we are called to perform a retransmission. */ @@ -238,9 +238,9 @@ PT_THREAD(psock_generator_send(register struct psock *s, /* Wait until all data is sent and acknowledged. */ PT_WAIT_UNTIL(&s->psockpt, data_acked(s) & send_data(s)); } while(s->sendlen > 0); - + s->state = STATE_NONE; - + PT_END(&s->psockpt); } /*---------------------------------------------------------------------------*/ @@ -273,9 +273,9 @@ psock_newdata(struct psock *s) PT_THREAD(psock_readto(register struct psock *psock, unsigned char c)) { PT_BEGIN(&psock->psockpt); - + ( void ) PT_YIELD_FLAG; buf_setup(&psock->buf, (unsigned char*)psock->bufptr, psock->bufsize); - + /* XXX: Should add buf_checkmarker() before do{} loop, if incoming data has been handled while waiting for a write. */ @@ -289,7 +289,7 @@ PT_THREAD(psock_readto(register struct psock *psock, unsigned char c)) } while((buf_bufto(&psock->buf, c, &psock->readptr, &psock->readlen) & BUF_FOUND) == 0); - + if(psock_datalen(psock) == 0) { psock->state = STATE_NONE; PT_RESTART(&psock->psockpt); @@ -300,9 +300,9 @@ PT_THREAD(psock_readto(register struct psock *psock, unsigned char c)) PT_THREAD(psock_readbuf(register struct psock *psock)) { PT_BEGIN(&psock->psockpt); - + ( void ) PT_YIELD_FLAG; buf_setup(&psock->buf, (unsigned char * ) psock->bufptr, psock->bufsize); - + /* XXX: Should add buf_checkmarker() before do{} loop, if incoming data has been handled while waiting for a write. */ diff --git a/Demo/Common/ethernet/FreeTCPIP/uip_arp.c b/Demo/Common/ethernet/FreeTCPIP/uip_arp.c index 5124c907e..4f4b06fe9 100644 --- a/Demo/Common/ethernet/FreeTCPIP/uip_arp.c +++ b/Demo/Common/ethernet/FreeTCPIP/uip_arp.c @@ -105,7 +105,6 @@ struct arp_entry }; static const struct uip_eth_addr broadcast_ethaddr = { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } }; -static const u16_t broadcast_ipaddr[2] = { 0xffff, 0xffff }; static struct arp_entry arp_table[UIP_ARPTAB_SIZE]; static uip_ipaddr_t ipaddr; -- 2.39.5