lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] ioctl() plus compiler warnings/errors


From: Zschocke, Florian
Subject: [lwip-users] ioctl() plus compiler warnings/errors
Date: Mon, 17 Feb 2003 11:35:18 +0100

Hi!

I would like to propose to change the ioctl function to use an unsigned long
instead of a long as the second parameter. Due to the nature of the ioctl
commands these are unsigned numbers and the lwip_ioctl() function should
respect this. Some compilers produce out-of-range errors when using signed
longs:

diff -r1.1.2.1 sockets.h
188c188
< int lwip_ioctl(int s, long cmd, void *argp);
---
> int lwip_ioctl(int s, unsigned long cmd, void *argp);

diff -r1.1.2.1 sockets.c
1014c1014
< int lwip_ioctl(int s, long cmd, void *argp)
---
> int lwip_ioctl(int s, unsigned long cmd, void *argp)


Also, I have added some changes which quiets the same compiler errors (for
the Diab compiler) when assigning bit complements to char or short
variables. These are just simple casts:

diff -r1.1.2.1 tcp_out.c
377c377
<     pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
---
>     pcb->flags &= (u8_t)~(TF_ACK_DELAY | TF_ACK_NOW);
439c439
<       pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
---
>       pcb->flags &= (u8_t)~(TF_ACK_DELAY | TF_ACK_NOW);

diff -r1.1.2.1 tcp_in.c
455c455
<       pcb->flags &= ~TF_ACK_DELAY;
---
>       pcb->flags &= (u8_t)~TF_ACK_DELAY;
669c669
<       pcb->flags &= ~TF_INFR;
---
>       pcb->flags &= (u8_t)~TF_INFR;

diff -r1.1.2.1 tcp.c
634c634
<       pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
---
>       pcb->flags &= (u8_t)~(TF_ACK_DELAY | TF_ACK_NOW);

diff -r1.1.2.2 tcp.h
361c361
<                             (pcb)->flags &= ~TF_ACK_DELAY; \
---
>                             (pcb)->flags &= (u8_t)~TF_ACK_DELAY; \





reply via email to

[Prev in Thread] Current Thread [Next in Thread]