From 84d0f38364670e1bdba18fc4361b282f12bf97d6 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Wed, 23 Oct 2019 03:39:26 +0200 Subject: [PATCH] target bad pointer type warnings --- jni/dc_wrapper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jni/dc_wrapper.c b/jni/dc_wrapper.c index 1448bd5ac..08198ba9f 100644 --- a/jni/dc_wrapper.c +++ b/jni/dc_wrapper.c @@ -189,7 +189,7 @@ static dc_context_t* get_dc_context(JNIEnv *env, jobject obj) fid = (*env)->GetFieldID(env, cls, "contextCPtr", "J" /*Signature, J=long*/); } if (fid) { - return (dc_chat_t*)(*env)->GetLongField(env, obj, fid); + return (dc_context_t*)(*env)->GetLongField(env, obj, fid); } return NULL; } @@ -205,7 +205,7 @@ static uintptr_t s_context_callback_(dc_context_t* context, int event, uintptr_t return 0; /* may happen on startup */ } - (*jnicontext->jvm)->GetEnv(jnicontext->jvm, &env, JNI_VERSION_1_6); // as this function may be called from _any_ thread, we cannot use a static pointer to JNIEnv + (*jnicontext->jvm)->GetEnv(jnicontext->jvm, (void**)&env, JNI_VERSION_1_6); // as this function may be called from _any_ thread, we cannot use a static pointer to JNIEnv if (env==NULL) { return 0; /* may happen on startup */ }