lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t)


From: Bill Auerbach
Subject: [lwip-devel] [bug #27352] Change ip_addr from struct to typedef (u32_t)
Date: Fri, 05 Feb 2010 21:45:46 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)

Follow-up Comment #33, bug #27352 (project lwip):

Another reason for these macros, and htonl and ntohl versions as macros is
that both can be useful with constant data.  In the NIOS, we used ntohl and
htonl operations as custom opcodes.  It was still nicer to use macro versions
in some cases because the compiler can get the 32-bit value for free.

By the way, if I understood right, Simon mentioned macros with constants
"should be improved by the compiler".  I have yet to see a compiler, even with
no optimizer at all, that doesn't do constant folding.  This makes IP4_ADDR
always evaluate to a single constant with no runtime code.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27352>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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