diff --git a/src/jnienv.cpp b/src/jnienv.cpp index ccec728982..5f0d3a0a67 100644 --- a/src/jnienv.cpp +++ b/src/jnienv.cpp @@ -102,7 +102,7 @@ GetStringChars(Thread* t, jstring s, jboolean* isCopy) jchar* chars = static_cast (t->m->heap->allocate((stringLength(t, *s) + 1) * sizeof(jchar), false)); - stringChars(t, *s, reinterpret_cast(chars)); + stringChars(t, *s, chars); if (isCopy) *isCopy = true; return chars; diff --git a/src/machine.cpp b/src/machine.cpp index 8e3a8e2af9..ed53790c60 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -2154,7 +2154,7 @@ stringChars(Thread* t, object string, char* chars) } void -stringChars(Thread* t, object string, wchar_t* chars) +stringChars(Thread* t, object string, uint16_t* chars) { object data = stringData(t, string); if (objectClass(t, data) @@ -2166,7 +2166,7 @@ stringChars(Thread* t, object string, wchar_t* chars) } else { memcpy(chars, &charArrayBody(t, data, stringOffset(t, string)), - stringLength(t, string) * sizeof(wchar_t)); + stringLength(t, string) * sizeof(uint16_t)); } chars[stringLength(t, string)] = 0; } diff --git a/src/machine.h b/src/machine.h index 74d753b9b2..2197de677e 100644 --- a/src/machine.h +++ b/src/machine.h @@ -1704,7 +1704,7 @@ void stringChars(Thread* t, object string, char* chars); void -stringChars(Thread* t, object string, wchar_t* chars); +stringChars(Thread* t, object string, uint16_t* chars); bool isAssignableFrom(Thread* t, object a, object b);