Hello everybody, this is is my first time using jni and i�m getting a few warnings which i would like to fix if possible.
I have this C function, Getdata (char * Getdata(char *q, char *t)) and i want to send its return value to the
java side doing this
JNIEXPORT void JNICALL Java_DBtools_execute_1upd
(JNIEnv *env, jobject obj, jstring query, jstring table)
{
const char *query_c = (*env)->GetStringUTFChars(env, query, 0);
const char *table_c = (*env)->GetStringUTFChars(env, table, 0);
jclass cls = (*env)->GetObjectClass(env, obj);
jmethodID mid = (*env)->GetMethodID(env, cls, "print_upd",
"(Ljava/lang/String;Ljava/lang/String
V");
if (mid == 0) {
return;
}
(*env)->CallVoidMethod(env,obj,mid,
(*env)->NewStringUTF(env,Getdata(query_c,table_c)),
(*env)->NewStringUTF(env,get_writeset()));
}
but i get two warnings (warning C4090) saying that there are different const qualifiers and it points to the CallVoidMethod line, because of query_c and table_c variables. Is this an important warning? How do i fix it?
Thanks!
[ November 24, 2004: Message edited by: Gus Spain ]
[ November 24, 2004: Message edited by: Gus Spain ]