From 1a0de6acd03b43a03678b58f47b2f21b5215cc22 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Fri, 26 Aug 2016 15:06:11 -0700 Subject: Fix clang-tidy warnings in art. * Add parentheses around macro parameters, or use NOLINT to suppress warning. Bug: 28705665 Test: build with WITH_TIDY=1 Change-Id: Ifc922c2e66215772042bac372754ea70074f0053 --- runtime/entrypoints_order_test.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'runtime/entrypoints_order_test.cc') diff --git a/runtime/entrypoints_order_test.cc b/runtime/entrypoints_order_test.cc index 004cdc47b9..b102334418 100644 --- a/runtime/entrypoints_order_test.cc +++ b/runtime/entrypoints_order_test.cc @@ -37,7 +37,7 @@ namespace art { // name. #define EXPECT_OFFSET_DIFF(first_type, first_field, second_type, second_field, diff, name) \ CHECKED(OFFSETOF_MEMBER(second_type, second_field) \ - - OFFSETOF_MEMBER(first_type, first_field) == diff, name) + - OFFSETOF_MEMBER(first_type, first_field) == (diff), name) // Helper macro for when the fields are from the same type. #define EXPECT_OFFSET_DIFFNP(type, first_field, second_field, diff) \ @@ -45,15 +45,16 @@ namespace art { type ## _ ## first_field ## _ ## second_field) // Helper macro for when the fields are from the same type and in the same member of said type. +// NOLINT, do not add parentheses around 'prefix'. #define EXPECT_OFFSET_DIFFP(type, prefix, first_field, second_field, diff) \ - EXPECT_OFFSET_DIFF(type, prefix . first_field, type, prefix . second_field, diff, \ + EXPECT_OFFSET_DIFF(type, prefix . first_field, type, prefix . second_field, diff, /* NOLINT */ \ type ## _ ## prefix ## _ ## first_field ## _ ## second_field) // Macro to check whether two fields have at least an expected difference in offsets. The error is // named name. #define EXPECT_OFFSET_DIFF_GT(first_type, first_field, second_type, second_field, diff, name) \ CHECKED(OFFSETOF_MEMBER(second_type, second_field) \ - - OFFSETOF_MEMBER(first_type, first_field) >= diff, name) + - OFFSETOF_MEMBER(first_type, first_field) >= (diff), name) // Helper macro for when the fields are from the same type. #define EXPECT_OFFSET_DIFF_GT3(type, first_field, second_field, diff, name) \ -- cgit v1.2.3-59-g8ed1b