File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -122,9 +122,9 @@ void VMStructs::ready() {
122122 initThreadBridge ();
123123}
124124
125- bool matchAny (const char * target_name, const char ** names) {
126- for (const char ** name = names; *name != nullptr ; name++ ) {
127- if (strcmp (target_name, * name) == 0 ) {
125+ bool matchAny (const char * target_name, std::initializer_list< const char *> names) {
126+ for (const char * name : names) {
127+ if (strcmp (target_name, name) == 0 ) {
128128 return true ;
129129 }
130130 }
Original file line number Diff line number Diff line change 77#ifndef _VMSTRUCTS_H
88#define _VMSTRUCTS_H
99
10+ #include < initializer_list>
1011#include < jvmti.h>
1112#include < stdint.h>
1213#include < string.h>
@@ -46,7 +47,7 @@ inline T* cast_to(const void* ptr) {
4647
4748// MATCH_SYMBOLS macro expands into an nullptr terminated char string array,
4849// that is consumed by matchAny() method
49- #define MATCH_SYMBOLS (...) ( const char *[]) { __VA_ARGS__, nullptr }
50+ #define MATCH_SYMBOLS (...) std::initializer_list< const char *> { __VA_ARGS__ }
5051
5152/* *
5253 * This macro defines a counterpart of a JVM class, e.g. VMKlass -> Klass.
You can’t perform that action at this time.
0 commit comments