From: Simon Horman Date: Mon, 11 Jan 2016 05:00:25 +0000 (+0900) Subject: flow: fix compilation of MINIFLOW_ASSERT X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=e807a1a63d1176bce97071063fa480eb68662dc6 flow: fix compilation of MINIFLOW_ASSERT Often MINIFLOW_ASSERT is a no-op and compilation of code that uses it is optimised out. This patch fixes compilation errors that occur when that is not the case: * FLOWMAP_MAX does not exist. Use MAP_MAP instead. * FLOWMAP_IS_SET does not exist. Use flowmap_is_set instead. Signed-off-by: Simon Horman Acked-by: Jarno Rajahalme --- diff --git a/lib/flow.c b/lib/flow.c index 0ea272400..5668d0c58 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -136,7 +136,7 @@ BUILD_MESSAGE("FLOW_WC_SEQ changed: miniflow_extract() will have runtime " #define ASSERT_FLOWMAP_NOT_SET(FM, IDX) \ { \ MINIFLOW_ASSERT(!((FM)->bits[(IDX) / MAP_T_BITS] & \ - (FLOWMAP_MAX << ((IDX) % MAP_T_BITS)))); \ + (MAP_MAX << ((IDX) % MAP_T_BITS)))); \ for (size_t i = (IDX) / MAP_T_BITS + 1; i < FLOWMAP_UNITS; i++) { \ MINIFLOW_ASSERT(!(FM)->bits[i]); \ } \ @@ -148,8 +148,8 @@ BUILD_MESSAGE("FLOW_WC_SEQ changed: miniflow_extract() will have runtime " flowmap_set(&MF.map, (OFS), 1); \ } -#define miniflow_assert_in_map(MF, OFS) \ - MINIFLOW_ASSERT(FLOWMAP_IS_SET(MF.map, (OFS))); \ +#define miniflow_assert_in_map(MF, OFS) \ + MINIFLOW_ASSERT(flowmap_is_set(&MF.map, (OFS))); \ ASSERT_FLOWMAP_NOT_SET(&MF.map, (OFS) + 1) #define miniflow_push_uint64_(MF, OFS, VALUE) \