Fix clang compilation on aarch64: extraneous parentheses 60/12860/7
authorSirshak Das <sirshak.das@arm.com>
Mon, 11 Jun 2018 16:40:17 +0000 (11:40 -0500)
committerDamjan Marion <dmarion@me.com>
Wed, 13 Jun 2018 08:00:59 +0000 (08:00 +0000)
Fixes clang error: equality comparison with extraneous parentheses
Changing all the #defines to inlines.

Change-Id: I30a931679ac3325b23b249b1ae28c7c8cf54b012
Signed-off-by: Sirshak Das<sirshak.das@arm.com>
src/plugins/lb/lb.h

index 1526298..c6773a4 100644 (file)
@@ -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;