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: Kieran Mansley
Subject: Re: [lwip-devel] Bug in Checksum implementation and ARP fix
Date: Wed, 22 Oct 2003 09:21:43 +0100 (BST)

On Tue, 21 Oct 2003, Kenneth Porter wrote:

> --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.

Would this mean we'd need a macro for every combination of from-type and
to-type?  If so, there could be a very large number of them, and the
macros would be effectively hiding the cast making it harder to see what
was going on.  Someone coming along, reading the code, and seeing
"hbb2hs(var)" is not going to have a clue what it means, whereas
"(u16_t *)var" gives a lot more information.

I'd vote for keeping the casts out in the open, but I feel like I must be
missing something as I still don't really see the problem.

Kieran





reply via email to

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