From 0eaad1ca9b929ca4b66765e5e0700bd90b1d52a8 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 16 Jul 2008 20:37:56 +0000 Subject: [PATCH] Removed some warnings in unix port --- ports/unix/netif/sio.c | 4 ++++ ports/unix/netif/tunif.c | 1 + ports/unix/proj/unixsim/apps/httpd.c | 4 ++++ ports/unix/sys_arch.c | 25 +++++++++++++++---------- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/ports/unix/netif/sio.c b/ports/unix/netif/sio.c index 4d6d0d0..fbc80a2 100644 --- a/ports/unix/netif/sio.c +++ b/ports/unix/netif/sio.c @@ -68,6 +68,7 @@ static sio_status_t statusar[3]; */ static void signal_handler_IO_0( int status ) { + LWIP_UNUSED_ARG(status); LWIP_DEBUGF(SIO_DEBUG, ("SigHand: rxSignal channel 0\n")); fifoPut( &statusar[0].myfifo, statusar[0].fd ); } @@ -78,6 +79,7 @@ static void signal_handler_IO_0( int status ) */ static void signal_handler_IO_1( int status ) { + LWIP_UNUSED_ARG(status); LWIP_DEBUGF(SIO_DEBUG, ("SigHand: rxSignal channel 1\n")); fifoPut( &statusar[1].myfifo, statusar[1].fd ); } @@ -96,6 +98,7 @@ static int sio_init( char * device, int devnum, sio_status_t * siostat ) struct sigaction saio; /* definition of signal action */ #endif int fd; + LWIP_UNUSED_ARG(siostat); /* open the device to be non-blocking (read will return immediately) */ fd = open( device, O_RDWR | O_NOCTTY | O_NONBLOCK ); @@ -212,6 +215,7 @@ void sio_send_string( u8_t *str, sio_status_t * siostat ) void sio_flush( sio_status_t * siostat ) { + LWIP_UNUSED_ARG(siostat); /* not implemented in unix as it is not needed */ /*sio_status_t * siostat = ((siostruct_t*)netif->state)->sio; */ } diff --git a/ports/unix/netif/tunif.c b/ports/unix/netif/tunif.c index c938c20..315b9e7 100644 --- a/ports/unix/netif/tunif.c +++ b/ports/unix/netif/tunif.c @@ -234,6 +234,7 @@ tunif_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr) { struct tunif *tunif; + LWIP_UNUSED_ARG(ipaddr); tunif = netif->state; diff --git a/ports/unix/proj/unixsim/apps/httpd.c b/ports/unix/proj/unixsim/apps/httpd.c index 557e102..0be8a7c 100644 --- a/ports/unix/proj/unixsim/apps/httpd.c +++ b/ports/unix/proj/unixsim/apps/httpd.c @@ -51,6 +51,7 @@ static void conn_err(void *arg, err_t err) { struct http_state *hs; + LWIP_UNUSED_ARG(err); hs = arg; mem_free(hs); @@ -123,6 +124,7 @@ static err_t http_sent(void *arg, struct tcp_pcb *pcb, u16_t len) { struct http_state *hs; + LWIP_UNUSED_ARG(len); hs = arg; @@ -199,6 +201,8 @@ static err_t http_accept(void *arg, struct tcp_pcb *pcb, err_t err) { struct http_state *hs; + LWIP_UNUSED_ARG(arg); + LWIP_UNUSED_ARG(err); tcp_setprio(pcb, TCP_PRIO_MIN); diff --git a/ports/unix/sys_arch.c b/ports/unix/sys_arch.c index 57f0a8d..987359c 100644 --- a/ports/unix/sys_arch.c +++ b/ports/unix/sys_arch.c @@ -157,7 +157,10 @@ sys_thread_new(char *name, void (* function)(void *arg), void *arg, int stacksiz int code; pthread_t tmp; struct sys_thread *st = NULL; - + LWIP_UNUSED_ARG(name); + LWIP_UNUSED_ARG(stacksize); + LWIP_UNUSED_ARG(prio); + code = pthread_create(&tmp, NULL, (void *(*)(void *)) @@ -180,6 +183,7 @@ struct sys_mbox * sys_mbox_new(int size) { struct sys_mbox *mbox; + LWIP_UNUSED_ARG(size); mbox = malloc(sizeof(struct sys_mbox)); if (mbox != NULL) { @@ -317,7 +321,7 @@ sys_arch_mbox_tryfetch(struct sys_mbox *mbox, void **msg) u32_t sys_arch_mbox_fetch(struct sys_mbox *mbox, void **msg, u32_t timeout) { - u32_t time = 0; + u32_t time_needed = 0; /* The mutex lock is quick so we don't bother with the timeout stuff here. */ @@ -329,9 +333,9 @@ sys_arch_mbox_fetch(struct sys_mbox *mbox, void **msg, u32_t timeout) /* We block while waiting for a mail to arrive in the mailbox. We must be prepared to timeout. */ if (timeout != 0) { - time = sys_arch_sem_wait(mbox->not_empty, timeout); + time_needed = sys_arch_sem_wait(mbox->not_empty, timeout); - if (time == SYS_ARCH_TIMEOUT) { + if (time_needed == SYS_ARCH_TIMEOUT) { return SYS_ARCH_TIMEOUT; } } else { @@ -357,7 +361,7 @@ sys_arch_mbox_fetch(struct sys_mbox *mbox, void **msg, u32_t timeout) sys_sem_signal(mbox->mutex); - return time; + return time_needed; } /*-----------------------------------------------------------------------------------*/ static struct sys_sem * @@ -432,26 +436,26 @@ cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex, u32_t timeout) u32_t sys_arch_sem_wait(struct sys_sem *sem, u32_t timeout) { - u32_t time = 0; + u32_t time_needed = 0; pthread_mutex_lock(&(sem->mutex)); while (sem->c <= 0) { if (timeout > 0) { - time = cond_wait(&(sem->cond), &(sem->mutex), timeout); + time_needed = cond_wait(&(sem->cond), &(sem->mutex), timeout); - if (time == SYS_ARCH_TIMEOUT) { + if (time_needed == SYS_ARCH_TIMEOUT) { pthread_mutex_unlock(&(sem->mutex)); return SYS_ARCH_TIMEOUT; } /* pthread_mutex_unlock(&(sem->mutex)); - return time; */ + return time_needed; */ } else { cond_wait(&(sem->cond), &(sem->mutex), 0); } } sem->c--; pthread_mutex_unlock(&(sem->mutex)); - return time; + return time_needed; } /*-----------------------------------------------------------------------------------*/ void @@ -563,6 +567,7 @@ an operating system. void sys_arch_unprotect(sys_prot_t pval) { + LWIP_UNUSED_ARG(pval); if (lwprot_thread == pthread_self()) { if (--lwprot_count == 0)