ART: Fix macro parentheses warnings
Change code for types. Add NOLINT where there's no better way.
Bug: 32619234
Test: m
Change-Id: Ie5d9cc576b72c4a1bb1d9e4b439333702800abb9
diff --git a/openjdkjvmti/ti_method.cc b/openjdkjvmti/ti_method.cc
index 8f72714..35f2f0c 100644
--- a/openjdkjvmti/ti_method.cc
+++ b/openjdkjvmti/ti_method.cc
@@ -31,6 +31,8 @@
#include "ti_method.h"
+#include <type_traits>
+
#include "art_jvmti.h"
#include "art_method-inl.h"
#include "base/enums.h"
@@ -1012,11 +1014,11 @@
#undef JNI_TYPE_CHAR
-#define RW_JVALUE(type, prim, id) \
- template<> void ReadJvalue<type>(jvalue in, type* out) { \
+#define RW_JVALUE(srctype, prim, id) \
+ template<> void ReadJvalue<srctype>(jvalue in, std::add_pointer<srctype>::type out) { \
*out = in.id; \
} \
- template<> void WriteJvalue<type>(type in, jvalue* out) { \
+ template<> void WriteJvalue<srctype>(srctype in, jvalue* out) { \
out->id = in; \
}
@@ -1058,9 +1060,17 @@
}
}
-#define GET_SET_LV(type, prim, id) \
- template jvmtiError MethodUtil::GetLocalVariable<type>(jvmtiEnv*, jthread, jint, jint, type*); \
- template jvmtiError MethodUtil::SetLocalVariable<type>(jvmtiEnv*, jthread, jint, jint, type);
+#define GET_SET_LV(srctype, prim, id) \
+ template jvmtiError MethodUtil::GetLocalVariable<srctype>(jvmtiEnv*, \
+ jthread, \
+ jint, \
+ jint, \
+ std::add_pointer<srctype>::type); \
+ template jvmtiError MethodUtil::SetLocalVariable<srctype>(jvmtiEnv*, \
+ jthread, \
+ jint, \
+ jint, \
+ srctype);
FOR_JVMTI_JVALUE_TYPES(GET_SET_LV);