[kaffe] CVS kaffe (robilad): Fixed 21 compiler warnings
Kaffe CVS
cvs-commits at kaffe.org
Sun Feb 6 20:17:23 PST 2005
PatchSet 5494
Date: 2005/02/07 04:12:40
Author: robilad
Branch: HEAD
Tag: (none)
Log:
Fixed 21 compiler warnings
2005-02-07 Dalibor Topic <robilad at kaffe.org>
* libraries/clib/native/Method.c
(Java_java_lang_reflect_Method_invoke0) Use a jmethodID
when invoking JNI functions instead of Method *. Fixes
21 compiler warnings.
Members:
ChangeLog:1.3539->1.3540
libraries/clib/native/Method.c:1.39->1.40
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3539 kaffe/ChangeLog:1.3540
--- kaffe/ChangeLog:1.3539 Mon Feb 7 01:27:56 2005
+++ kaffe/ChangeLog Mon Feb 7 04:12:40 2005
@@ -1,5 +1,12 @@
2005-02-07 Dalibor Topic <robilad at kaffe.org>
+ * libraries/clib/native/Method.c
+ (Java_java_lang_reflect_Method_invoke0) Use a jmethodID
+ when invoking JNI functions instead of Method *. Fixes
+ 21 compiler warnings.
+
+2005-02-07 Dalibor Topic <robilad at kaffe.org>
+
* kaffe/kaffevm/exception.c (vmExcept_isJNIFrame,
vmExcept_setSyncObj, vmExcept_getSyncObj, vmExcept_setPC,
vmExcept_getPC): Clarified asserts.
Index: kaffe/libraries/clib/native/Method.c
diff -u kaffe/libraries/clib/native/Method.c:1.39 kaffe/libraries/clib/native/Method.c:1.40
--- kaffe/libraries/clib/native/Method.c:1.39 Mon Dec 20 03:40:03 2004
+++ kaffe/libraries/clib/native/Method.c Mon Feb 7 04:12:45 2005
@@ -126,6 +126,7 @@
jobject arg;
jclass argc;
Method* meth;
+ jmethodID methID;
jint slot;
jvalue args[255]; /* should this be allocated dynamically? */
jvalue ret;
@@ -162,6 +163,8 @@
* would be returned by JNIEnv::GetMethodID for this method.
*/
meth = &CLASS_METHODS(clazz)[slot];
+ methID = (*env)->FromReflectedMethod(env, _this);
+
len = argobj ? obj_length(argobj) : 0;
rettype = *METHOD_RET_TYPE(meth);
@@ -207,7 +210,7 @@
/* invoke proper method via JNI CallStatic<Type>MethodA */
#define CallStaticTypeMethodA(type) \
- (*env)->CallStatic##type##MethodA(env, clazz, meth, args)
+ (*env)->CallStatic##type##MethodA(env, clazz, methID, args)
case 'V': CallStaticTypeMethodA(Void); break;
case 'J': ret.j = CallStaticTypeMethodA(Long); break;
@@ -229,7 +232,7 @@
/*
* This if applies if we are called from Constructor.newInstance
*/
- ret.l = (*env)->NewObjectA(env, clazz, meth, args);
+ ret.l = (*env)->NewObjectA(env, clazz, methID, args);
/* override return type parsed from signature */
rettype = 'L';
}
@@ -246,7 +249,7 @@
* target object will occur.
*/
#define CallTypeMethodA(type) \
- (*env)->Call##type##MethodA(env, obj, meth, args)
+ (*env)->Call##type##MethodA(env, obj, methID, args)
case 'V': CallTypeMethodA(Void); break;
case 'J': ret.j = CallTypeMethodA(Long); break;
More information about the kaffe
mailing list