Refactor fragile msg macro W and W2 to not burry return control flow.

Instead, have them accept and assign a return paramter leaving
the return control flow up to the caller.  Clean up otherwise
misleading returns present even after "NOT REACHED" comments.

Change-Id: I0861921f73ab65d55b95eabd27514f0129152723
Signed-off-by: Jon Loeliger <jdl@netgate.com>
This commit is contained in:
Jon Loeliger
2017-02-01 12:31:41 -06:00
committed by Dave Barach
parent 1f9191f6ef
commit 56c7b01e16
13 changed files with 699 additions and 577 deletions

View File

@ -150,6 +150,7 @@ static int api_" plugin-name "_enable_disable (vat_main_t * vam)
int enable_disable = 1;
u32 sw_if_index = ~0;
vl_api_" plugin-name "_enable_disable_t * mp;
int ret;
/* Parse args required to build the message */
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) {
@ -177,7 +178,8 @@ static int api_" plugin-name "_enable_disable (vat_main_t * vam)
S(mp);
/* Wait for a reply... */
W;
W (ret);
return ret;
}
/*