Fix misc-macro-parentheses warnings.
* Add parentheses to fix warnings.
* Use NOLINT to suppress wrong clang-tidy warnings.
Bug: 28705665
Change-Id: Icc8bc9b59583dee0ea17ab83e0ff0383b8599c3e
diff --git a/runtime/dex_instruction.cc b/runtime/dex_instruction.cc
index 3f62124..300e618 100644
--- a/runtime/dex_instruction.cc
+++ b/runtime/dex_instruction.cc
@@ -69,11 +69,11 @@
int const Instruction::kInstructionSizeInCodeUnits[] = {
#define INSTRUCTION_SIZE(opcode, c, p, format, r, i, a, v) \
- ((opcode == NOP) ? -1 : \
- ((format >= k10x) && (format <= k10t)) ? 1 : \
- ((format >= k20t) && (format <= k25x)) ? 2 : \
- ((format >= k32x) && (format <= k3rc)) ? 3 : \
- (format == k51l) ? 5 : -1),
+ (((opcode) == NOP) ? -1 : \
+ (((format) >= k10x) && ((format) <= k10t)) ? 1 : \
+ (((format) >= k20t) && ((format) <= k25x)) ? 2 : \
+ (((format) >= k32x) && ((format) <= k3rc)) ? 3 : \
+ ((format) == k51l) ? 5 : -1),
#include "dex_instruction_list.h"
DEX_INSTRUCTION_LIST(INSTRUCTION_SIZE)
#undef DEX_INSTRUCTION_LIST