mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-18 17:19:18 +08:00
jni.cc (wrap_value<jobject>, [...]): Removed.
* jni.cc (wrap_value<jobject>, wrap_value<jclass>): Removed. (wrap_value<T*>): New specialization. (_Jv_JNI_PopLocalFrame): Update env->locals. From-SVN: r41157
This commit is contained in:
parent
67916302b5
commit
80a44e089f
@ -1,3 +1,9 @@
|
||||
2001-04-06 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* jni.cc (wrap_value<jobject>, wrap_value<jclass>): Removed.
|
||||
(wrap_value<T*>): New specialization.
|
||||
(_Jv_JNI_PopLocalFrame): Update env->locals.
|
||||
|
||||
2001-04-05 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* libtool-version: Updated current.
|
||||
|
@ -335,6 +335,9 @@ _Jv_JNI_PopLocalFrame (JNIEnv *env, jobject result, int stop)
|
||||
rf = n;
|
||||
}
|
||||
|
||||
// Update the local frame information.
|
||||
env->locals = rf;
|
||||
|
||||
return result == NULL ? NULL : _Jv_JNI_NewLocalRef (env, result);
|
||||
}
|
||||
|
||||
@ -369,20 +372,15 @@ wrap_value (JNIEnv *, T value)
|
||||
return value;
|
||||
}
|
||||
|
||||
template<>
|
||||
static jobject
|
||||
wrap_value (JNIEnv *env, jobject value)
|
||||
{
|
||||
return value == NULL ? value : _Jv_JNI_NewLocalRef (env, value);
|
||||
}
|
||||
|
||||
template<>
|
||||
static jclass
|
||||
wrap_value (JNIEnv *env, jclass value)
|
||||
// This specialization is used for jobject, jclass, jstring, jarray,
|
||||
// etc.
|
||||
template<typename T>
|
||||
static T *
|
||||
wrap_value (JNIEnv *env, T *value)
|
||||
{
|
||||
return (value == NULL
|
||||
? value
|
||||
: (jclass) _Jv_JNI_NewLocalRef (env, (jobject) value));
|
||||
: (T *) _Jv_JNI_NewLocalRef (env, (jobject) value));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user