diff --git a/src/classpath-openjdk.cpp b/src/classpath-openjdk.cpp index 33c7095807..bbdb4a547e 100644 --- a/src/classpath-openjdk.cpp +++ b/src/classpath-openjdk.cpp @@ -2960,10 +2960,10 @@ EXPORT(JVM_ArrayCopy)(Thread* t, jclass, jobject src, jint srcOffset, jobject dst, jint dstOffset, jint length) { uintptr_t arguments[] = { reinterpret_cast(src), - srcOffset, + static_cast(srcOffset), reinterpret_cast(dst), - dstOffset, - length }; + static_cast(dstOffset), + static_cast(length) }; run(t, jvmArrayCopy, arguments); } @@ -3238,7 +3238,8 @@ jvmGetStackTraceElement(Thread* t, uintptr_t* arguments) extern "C" JNIEXPORT jobject JNICALL EXPORT(JVM_GetStackTraceElement)(Thread* t, jobject throwable, jint index) { - uintptr_t arguments[] = { reinterpret_cast(throwable), index }; + uintptr_t arguments[] = { reinterpret_cast(throwable), + static_cast(index) }; return reinterpret_cast(run(t, jvmGetStackTraceElement, arguments)); } @@ -3646,7 +3647,7 @@ extern "C" JNIEXPORT jobject JNICALL EXPORT(JVM_GetArrayElement)(Thread* t, jobject array, jint index) { uintptr_t arguments[] = { reinterpret_cast(array), - index }; + static_cast(index) }; return reinterpret_cast(run(t, jvmGetArrayElement, arguments)); } @@ -3740,7 +3741,7 @@ extern "C" JNIEXPORT jobject JNICALL EXPORT(JVM_NewArray)(Thread* t, jclass elementClass, jint length) { uintptr_t arguments[] = { reinterpret_cast(elementClass), - length }; + static_cast(length) }; return reinterpret_cast(run(t, jvmNewArray, arguments)); } @@ -3946,7 +3947,7 @@ EXPORT(JVM_DefineClass)(Thread* t, const char*, jobject loader, { uintptr_t arguments[] = { reinterpret_cast(loader), reinterpret_cast(data), - length }; + static_cast(length) }; return reinterpret_cast(run(t, jvmDefineClass, arguments)); } @@ -4710,7 +4711,8 @@ jvmConstantPoolGetUTF8At(Thread* t, uintptr_t* arguments) extern "C" JNIEXPORT jstring JNICALL EXPORT(JVM_ConstantPoolGetUTF8At)(Thread* t, jobject, jobject pool, jint index) { - uintptr_t arguments[] = { reinterpret_cast(pool), index }; + uintptr_t arguments[] = { reinterpret_cast(pool), + static_cast(index) }; return reinterpret_cast (run(t, jvmConstantPoolGetUTF8At, arguments)); diff --git a/src/interpret.cpp b/src/interpret.cpp index c36ebde450..fe166dedcd 100644 --- a/src/interpret.cpp +++ b/src/interpret.cpp @@ -158,7 +158,7 @@ peekObject(Thread* t, unsigned index) assert(t, index < stackSizeInWords(t) / 2); assert(t, t->stack[index * 2] == ObjectTag); - return *reinterpret_cast(t->stack + (index * 2) + 1); + return reinterpret_cast(t->stack[(index * 2) + 1]); } inline uint32_t @@ -2706,7 +2706,8 @@ interpret(Thread* t) while (true) { bool success = false; - uintptr_t arguments[] = { base, reinterpret_cast(&success) }; + uintptr_t arguments[] = { static_cast(base), + reinterpret_cast(&success) }; uint64_t r = run(t, interpret2, arguments); if (success) {