lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Bug in Checksum implementation and ARP fix


From: Kenneth Porter
Subject: Re: [lwip-devel] Bug in Checksum implementation and ARP fix
Date: Tue, 21 Oct 2003 14:43:40 -0700

--On Tuesday, October 21, 2003 10:19 AM +0100 Kieran Mansley <address@hidden> wrote:

I'm not sure I understand this concept (the different types of casts - not
using macros!).  Can you explain what the difference's might be between
the macros for the different types of casts?

In the example given, the code is attempting to extract a 16-bit native value from a byte buffer with native endianness and no alignment, so the macro might be hbb2hs (host byte buffer to host short). Horrible name, I agree, and I'm open to suggestions.

Using a raw cast to do this gives no information to the maintainer about what's really being attempted, or what assumptions are being made. The cast is an implementation detail, not the design. It's an ambiguous and error-prone idiom.






reply via email to

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