lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] byte order, packing, optimizations


From: Stéphane Lesage
Subject: Re: [lwip-devel] byte order, packing, optimizations
Date: Mon, 08 Feb 2010 15:43:15 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)


>Stephane,
>In the Wiki LWIP_PLATFORM_HTONS/L has 2 problems:
>1) Cases where HTONS is given a value larger than 0xFFFF. The >> needs an & 0xFF added to it.

well that should not happen, but...

>2) The x in the macro text must be (x). x could be an expression whose precedence doesn't work out with the other operators in the macro.

you're right.

Ok I modified the wiki page
I added a cast to (u32_t) to secure the ((x)>>24) if the macro is given a signed number.

I also added the "use 32 bits add with carry" hint for writing the checksum routine in assembly.















reply via email to

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