ofpbuf: New function ofpbuf_const_initializer().
authorBen Pfaff <blp@ovn.org>
Thu, 18 Feb 2016 23:13:09 +0000 (15:13 -0800)
committerBen Pfaff <blp@ovn.org>
Sat, 20 Feb 2016 00:15:44 +0000 (16:15 -0800)
commit0a2869d524fc3612b4b77a9df4991bff2aa3b465
treec38541ea9f2fb165344974356de31b92c4c872b3
parentde658847fd5703ac7ac6413ec29ecf7f4db91421
ofpbuf: New function ofpbuf_const_initializer().

A number of times I've looked at code and thought that it would be easier
to understand if I could write an initializer instead of
ofpbuf_use_const().  This commit adds a function for that purpose and
adapts a lot of code to use it, in the places where I thought it made
the code better.

In theory this could improve code generation since the new function can
be inlined whereas ofpbuf_use_const() isn't.  But I guess that's probably
insignificant; the intent of this change is code readability.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
14 files changed:
lib/dpif-netlink.c
lib/learning-switch.c
lib/netdev-windows.c
lib/netlink-socket.c
lib/nx-match.c
lib/ofp-actions.c
lib/ofp-errors.c
lib/ofp-msgs.c
lib/ofp-print.c
lib/ofp-util.c
lib/ofpbuf.h
ofproto/ofproto-dpif-xlate.c
ofproto/ofproto.c
utilities/ovs-ofctl.c