mirror of
https://github.com/ep00ch/lwip-contrib-mac.git
synced 2024-07-04 15:29:30 +00:00
Removed some warnings in unix port
This commit is contained in:
parent
2977846356
commit
0eaad1ca9b
@ -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; */
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user