changed tcpip static temporaries to stack vars

A number of local variables in tcpip.c were declared with static
storage for no good reason (they do not ever preserve state between
function calls).

This patch removes static declaration from these variables.
This commit is contained in:
Billy Kozak 2015-08-12 09:51:26 -06:00
parent 902b21a326
commit 9cd439d8c0

View File

@ -249,7 +249,7 @@ tcp_connect(const uip_ipaddr_t *ripaddr, uint16_t port, void *appstate)
void void
tcp_unlisten(uint16_t port) tcp_unlisten(uint16_t port)
{ {
static unsigned char i; unsigned char i;
struct listenport *l; struct listenport *l;
l = s.listenports; l = s.listenports;
@ -267,7 +267,7 @@ tcp_unlisten(uint16_t port)
void void
tcp_listen(uint16_t port) tcp_listen(uint16_t port)
{ {
static unsigned char i; unsigned char i;
struct listenport *l; struct listenport *l;
l = s.listenports; l = s.listenports;
@ -371,7 +371,7 @@ static void
eventhandler(process_event_t ev, process_data_t data) eventhandler(process_event_t ev, process_data_t data)
{ {
#if UIP_TCP #if UIP_TCP
static unsigned char i; unsigned char i;
register struct listenport *l; register struct listenport *l;
#endif /*UIP_TCP*/ #endif /*UIP_TCP*/
struct process *p; struct process *p;
@ -764,7 +764,7 @@ tcpip_uipcall(void)
#if UIP_TCP #if UIP_TCP
{ {
static unsigned char i; unsigned char i;
struct listenport *l; struct listenport *l;
/* If this is a connection request for a listening port, we must /* If this is a connection request for a listening port, we must
@ -798,7 +798,7 @@ PROCESS_THREAD(tcpip_process, ev, data)
#if UIP_TCP #if UIP_TCP
{ {
static unsigned char i; unsigned char i;
for(i = 0; i < UIP_LISTENPORTS; ++i) { for(i = 0; i < UIP_LISTENPORTS; ++i) {
s.listenports[i].port = 0; s.listenports[i].port = 0;