This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: fix type of jni_env
- From: Tom Tromey <tromey at redhat dot com>
- To: GCJ-patches <java-patches at gcc dot gnu dot org>
- Date: 16 Jan 2007 16:26:12 -0700
- Subject: Patch: FYI: fix type of jni_env
- Reply-to: tromey at redhat dot com
I'm checking this in.
There was no reason for natThread::jni_env to be declared as void*.
I fixed this and removed a couple casts as a result.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* java/lang/natThread.cc (finalize_native): Remove cast.
(_Jv_GetCurrentJNIEnv): Likewise.
* include/jvm.h (struct natThread) <jni_env>: Declare as
_Jv_JNIEnv*.
Index: include/jvm.h
===================================================================
--- include/jvm.h (revision 120843)
+++ include/jvm.h (working copy)
@@ -1,6 +1,6 @@
// jvm.h - Header file for private implementation information. -*- c++ -*-
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
This file is part of libgcj.
@@ -762,7 +762,7 @@
_Jv_Thread_t *thread;
// Each thread has its own JNI object.
- void *jni_env;
+ _Jv_JNIEnv *jni_env;
};
#endif /* __JAVA_JVM_H__ */
Index: java/lang/natThread.cc
===================================================================
--- java/lang/natThread.cc (revision 120843)
+++ java/lang/natThread.cc (working copy)
@@ -1,6 +1,6 @@
// natThread.cc - Native part of Thread class.
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2006 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2006, 2007 Free Software Foundation
This file is part of libgcj.
@@ -441,7 +441,7 @@
java::lang::Thread *t = _Jv_ThreadCurrent ();
if (t == NULL)
return NULL;
- return (JNIEnv *)((natThread *) t->data)->jni_env;
+ return ((natThread *) t->data)->jni_env;
}
void