ofproto-dpif-xlate: Initialize 'ctx' all in one place.
authorBen Pfaff <blp@nicira.com>
Thu, 23 Jul 2015 23:24:29 +0000 (16:24 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 31 Jul 2015 20:14:53 +0000 (13:14 -0700)
commitbb00fdefa6cbaf33a95f4d79cda16fe51370c981
treed5beaace2e19fb715e209ef576924d09ec56e4b8
parent8812f224fd3d5da88a7a4270f9d9027b21bcd980
ofproto-dpif-xlate: Initialize 'ctx' all in one place.

As I see it, this has two benefits.  First, by using an initializer
rather than a series of assignment statements, the reader can be
assured that everything in the structure is actually initialized.
Second, previously the initialization of 'ctx' was scattered in
a few places in this function, which made it a little harder to be
sure that any given member was not just initialized but actually
initialized before the statement that one was looking at.

It's also nice to get rid of the stub members in xlate_ctx, since
nothing outside of xlate_actions() itself needs direct access to
them.  (This is pretty much necessary if we're going to use an
initializer for struct xlate_ctx, because otherwise the compiler
would initialize the whole stub, which is too expensive.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
ofproto/ofproto-dpif-xlate.c