From 8a4a8c455aaa95a7ff15d8d46f52b24740d3ce88 Mon Sep 17 00:00:00 2001 From: Sirshak Das Date: Mon, 11 Jun 2018 11:40:17 -0500 Subject: Fix clang compilation on aarch64: extraneous parentheses Fixes clang error: equality comparison with extraneous parentheses Changing all the #defines to inlines. Change-Id: I30a931679ac3325b23b249b1ae28c7c8cf54b012 Signed-off-by: Sirshak Das --- src/plugins/lb/lb.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/plugins/lb/lb.h b/src/plugins/lb/lb.h index 1526298b0fa..c6773a4108f 100644 --- a/src/plugins/lb/lb.h +++ b/src/plugins/lb/lb.h @@ -312,17 +312,27 @@ typedef struct { #define lb_vip_is_gre6(vip) ((vip)->type == LB_VIP_TYPE_IP6_GRE6 \ || (vip)->type == LB_VIP_TYPE_IP4_GRE6) -#define lb_vip_is_l3dsr(vip) ((vip)->type == LB_VIP_TYPE_IP4_L3DSR) - -#define lb_vip_is_nat4(vip) ((vip)->type == LB_VIP_TYPE_IP4_NAT4) - -#define lb_vip_is_nat6(vip) ((vip)->type == LB_VIP_TYPE_IP6_NAT6) - #define lb_encap_is_ip4(vip) ((vip)->type == LB_VIP_TYPE_IP6_GRE4 \ || (vip)->type == LB_VIP_TYPE_IP4_GRE4 \ || (vip)->type == LB_VIP_TYPE_IP4_L3DSR \ || (vip)->type == LB_VIP_TYPE_IP4_NAT4 ) +always_inline bool +lb_vip_is_l3dsr(const lb_vip_t *vip) +{ + return vip->type == LB_VIP_TYPE_IP4_L3DSR; +} +always_inline bool +lb_vip_is_nat4(const lb_vip_t *vip) +{ + return vip->type == LB_VIP_TYPE_IP4_NAT4; +} +always_inline bool +lb_vip_is_nat6(const lb_vip_t *vip) +{ + return vip->type == LB_VIP_TYPE_IP6_NAT6; +} + format_function_t format_lb_vip; format_function_t format_lb_vip_detailed; -- cgit 1.2.3-korg