Start to remove unnecessary 'signed char *' casts from strings that are now just plain char * types.

This commit is contained in:
Richard Barry 2013-12-27 14:43:48 +00:00
parent b4116a7c7d
commit da93f1fc4b
261 changed files with 2822 additions and 2815 deletions

View file

@ -1,8 +1,8 @@
/*
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
@ -11,21 +11,21 @@
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
*
* Author: Adam Dunkels <adam@sics.se>
*
*/
@ -40,7 +40,7 @@
#define archMESG_QUEUE_LENGTH ( 6 )
#define archPOST_BLOCK_TIME_MS ( ( unsigned long ) 10000 )
struct timeoutlist
struct timeoutlist
{
struct sys_timeouts timeouts;
xTaskHandle pid;
@ -84,14 +84,14 @@ sys_mbox_free(sys_mbox_t mbox)
__asm volatile ( "NOP" );
}
vQueueDelete( mbox );
vQueueDelete( mbox );
}
/*-----------------------------------------------------------------------------------*/
// Posts the "msg" to the mailbox.
void
sys_mbox_post(sys_mbox_t mbox, void *data)
{
{
xQueueSend( mbox, &data, ( portTickType ) ( archPOST_BLOCK_TIME_MS / portTICK_RATE_MS ) );
}
@ -110,7 +110,7 @@ sys_mbox_post(sys_mbox_t mbox, void *data)
timeout.
Note that a function with a similar name, sys_mbox_fetch(), is
implemented by lwIP.
implemented by lwIP.
*/
u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout)
{
@ -123,7 +123,7 @@ portTickType StartTime, EndTime, Elapsed;
{
msg = &dummyptr;
}
if( timeout != 0 )
{
if(pdTRUE == xQueueReceive( mbox, &(*msg), timeout ) )
@ -154,7 +154,7 @@ portTickType StartTime, EndTime, Elapsed;
{
Elapsed = 1;
}
return ( Elapsed ); // return time blocked TBD test
return ( Elapsed ); // return time blocked TBD test
}
}
@ -217,7 +217,7 @@ portTickType StartTime, EndTime, Elapsed;
{
Elapsed = 1;
}
return (Elapsed); // return time blocked TBD test
return (Elapsed); // return time blocked TBD test
}
else
{
@ -237,8 +237,8 @@ portTickType StartTime, EndTime, Elapsed;
Elapsed = 1;
}
return ( Elapsed ); // return time blocked
return ( Elapsed ); // return time blocked
}
}
@ -255,7 +255,7 @@ sys_sem_signal(sys_sem_t sem)
void
sys_sem_free(sys_sem_t sem)
{
vQueueDelete( sem );
vQueueDelete( sem );
}
/*-----------------------------------------------------------------------------------*/
@ -283,7 +283,7 @@ sys_init(void)
each thread has a list of timeouts which is represented as a linked
list of sys_timeout structures. The sys_timeouts structure holds a
pointer to a linked list of timeouts. This function is called by
the lwIP timeout scheduler and must not return a NULL value.
the lwIP timeout scheduler and must not return a NULL value.
In a single threaded sys_arch implementation, this function will
simply return a pointer to a global sys_timeouts variable stored in
@ -294,14 +294,14 @@ sys_arch_timeouts(void)
{
int i;
xTaskHandle pid;
struct timeoutlist *tl;
struct timeoutlist *tl;
pid = xTaskGetCurrentTaskHandle( );
pid = xTaskGetCurrentTaskHandle( );
for(i = 0; i < nextthread; i++)
for(i = 0; i < nextthread; i++)
{
tl = &timeoutlist[i];
if(tl->pid == pid)
if(tl->pid == pid)
{
return &(tl->timeouts);
}
@ -313,7 +313,7 @@ struct timeoutlist *tl;
/*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
// TBD
// TBD
/*-----------------------------------------------------------------------------------*/
/*
Starts a new thread with priority "prio" that will begin its execution in the
@ -330,12 +330,12 @@ static int iCall = 0;
if( iCall == 0 )
{
/* The first time this is called we are creating the lwIP handler. */
result = xTaskCreate( thread, ( signed char * ) "lwIP", lwipTCP_STACK_SIZE, arg, prio, &CreatedTask );
result = xTaskCreate( thread, "lwIP", lwipTCP_STACK_SIZE, arg, prio, &CreatedTask );
iCall++;
}
else
{
result = xTaskCreate( thread, ( signed char * ) "WEBSvr", lwipBASIC_SERVER_STACK_SIZE, arg, prio, &CreatedTask );
result = xTaskCreate( thread, "WEBSvr", lwipBASIC_SERVER_STACK_SIZE, arg, prio, &CreatedTask );
}
// For each task created, store the task handle (pid) in the timers array.
@ -378,7 +378,7 @@ sys_prot_t sys_arch_protect(void)
an operating system.
*/
void sys_arch_unprotect(sys_prot_t pval)
{
{
( void ) pval;
vPortExitCritical();
}

View file

@ -91,8 +91,8 @@ unsigned portBASE_TYPE uxPriority;
xNetIf = netif;
/* Initialise the EMAC. This routine contains code that polls status bits.
If the Ethernet cable is not plugged in then this can take a considerable
/* Initialise the EMAC. This routine contains code that polls status bits.
If the Ethernet cable is not plugged in then this can take a considerable
time. To prevent this starving lower priority tasks of processing time we
lower our priority prior to the call, then raise it back again once the
initialisation is complete. */
@ -105,13 +105,13 @@ unsigned portBASE_TYPE uxPriority;
vTaskPrioritySet( NULL, uxPriority );
/* Create the task that handles the EMAC. */
xTaskCreate( ethernetif_input, ( signed char * ) "ETH_INT", netifINTERFACE_TASK_STACK_SIZE, NULL, netifINTERFACE_TASK_PRIORITY, NULL );
xTaskCreate( ethernetif_input, "ETH_INT", netifINTERFACE_TASK_STACK_SIZE, NULL, netifINTERFACE_TASK_PRIORITY, NULL );
}
/*-----------------------------------------------------------*/
/*
* low_level_output(): Should do the actual transmission of the packet. The
* packet is contained in the pbuf that is passed to the function. This pbuf
* low_level_output(): Should do the actual transmission of the packet. The
* packet is contained in the pbuf that is passed to the function. This pbuf
* might be chained.
*/
static err_t low_level_output( struct netif *netif, struct pbuf *p )
@ -137,8 +137,8 @@ err_t xReturn = ERR_OK;
{
for( q = p; q != NULL; q = q->next )
{
/* Send the data from the pbuf to the interface, one pbuf at a
time. The size of the data in each pbuf is kept in the ->len
/* Send the data from the pbuf to the interface, one pbuf at a
time. The size of the data in each pbuf is kept in the ->len
variable. if q->next == NULL then this is the last pbuf in the
chain. */
if( !lEMACSend( q->payload, q->len, ( q->next == NULL ) ) )
@ -149,7 +149,7 @@ err_t xReturn = ERR_OK;
xSemaphoreGive( xTxSemaphore );
}
#if ETH_PAD_SIZE
pbuf_header( p, ETH_PAD_SIZE ); /* reclaim the padding word */
@ -164,8 +164,8 @@ err_t xReturn = ERR_OK;
/*-----------------------------------------------------------*/
/*
* low_level_input(): Should allocate a pbuf and transfer the bytes of the
* incoming packet from the interface into the pbuf.
* low_level_input(): Should allocate a pbuf and transfer the bytes of the
* incoming packet from the interface into the pbuf.
*/
static struct pbuf *low_level_input( struct netif *netif )
{
@ -186,34 +186,34 @@ static xSemaphoreHandle xRxSemaphore = NULL;
{
/* Obtain the size of the packet. */
len = ulEMACInputLength();
if( len )
{
#if ETH_PAD_SIZE
len += ETH_PAD_SIZE; /* allow room for Ethernet padding */
#endif
/* We allocate a pbuf chain of pbufs from the pool. */
p = pbuf_alloc( PBUF_RAW, len, PBUF_POOL );
if( p != NULL )
{
#if ETH_PAD_SIZE
pbuf_header( p, -ETH_PAD_SIZE ); /* drop the padding word */
#endif
/* Let the driver know we are going to read a new packet. */
vEMACRead( NULL, 0, len );
/* We iterate over the pbuf chain until we have read the entire
packet into the pbuf. */
packet into the pbuf. */
for( q = p; q != NULL; q = q->next )
{
/* Read enough bytes to fill this pbuf in the chain. The
/* Read enough bytes to fill this pbuf in the chain. The
available data in the pbuf is given by the q->len variable. */
vEMACRead( q->payload, q->len, len );
}
#if ETH_PAD_SIZE
pbuf_header( p, ETH_PAD_SIZE ); /* reclaim the padding word */
#endif
@ -238,8 +238,8 @@ static xSemaphoreHandle xRxSemaphore = NULL;
/*-----------------------------------------------------------*/
/*
* ethernetif_output(): This function is called by the TCP/IP stack when an
* IP packet should be sent. It calls the function called low_level_output()
* ethernetif_output(): This function is called by the TCP/IP stack when an
* IP packet should be sent. It calls the function called low_level_output()
* to do the actual transmission of the packet.
*/
static err_t ethernetif_output( struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr )
@ -250,8 +250,8 @@ static err_t ethernetif_output( struct netif *netif, struct pbuf *p, struct ip_a
/*-----------------------------------------------------------*/
/*
* ethernetif_input(): This function should be called when a packet is ready to
* be read from the interface. It uses the function low_level_input() that
* ethernetif_input(): This function should be called when a packet is ready to
* be read from the interface. It uses the function low_level_input() that
* should handle the actual reception of bytes from the network interface.
*/
static void ethernetif_input( void * pvParameters )
@ -273,41 +273,41 @@ struct pbuf *p;
if( p == NULL )
{
/* No packet could be read. Wait a for an interrupt to tell us
/* No packet could be read. Wait a for an interrupt to tell us
there is more data available. */
vEMACWaitForInput();
}
} while( p == NULL );
/* points to packet payload, which starts with an Ethernet header */
ethhdr = p->payload;
#if LINK_STATS
lwip_stats.link.recv++;
#endif /* LINK_STATS */
ethhdr = p->payload;
switch( htons( ethhdr->type ) )
{
/* IP packet? */
case ETHTYPE_IP:
/* update ARP table */
etharp_ip_input( xNetIf, p );
/* skip Ethernet header */
pbuf_header( p, (s16_t)-sizeof(struct eth_hdr) );
/* pass to network layer */
xNetIf->input( p, xNetIf );
break;
case ETHTYPE_ARP:
/* pass p to ARP module */
etharp_arp_input( xNetIf, ethernetif->ethaddr, p );
break;
default:
pbuf_free( p );
p = NULL;