|
From: | Kenneth Porter |
Subject: | Re: [lwip-devel] Bug in Checksum implementation and ARP fix |
Date: | Tue, 21 Oct 2003 14:43:40 -0700 |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |