ofp-util: Rewrite action decoding to improve compiler warnings.
authorBen Pfaff <blp@nicira.com>
Fri, 5 Aug 2011 22:48:45 +0000 (15:48 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 8 Aug 2011 17:21:13 +0000 (10:21 -0700)
commit51cb6e0c654e0954e12c8f171b5215ccad6185eb
tree433fa70a9d0d25293347e59b6a89fa3ecd99fa24
parent6c2d2a9f8318fea11250a7624144cb06436f91a4
ofp-util: Rewrite action decoding to improve compiler warnings.

The previous implementation of ofputil_decode_action() had two weaknesses.
First, the action lengths in its tables were written as literal integers
instead of using "sizeof".  Second, it used arrays for tables instead of
switch statements, which meant that GCC didn't warn when someone added a
new action type but forgot to add an entry to the tables.

This rewrite fixes both of those problems.

Suggested-by: Ethan Jackson <ethan@nicira.com>
lib/ofp-util.c