Author: mturk
Date: Tue Aug 24 06:07:28 2010
New Revision: 988395
URL: http://svn.apache.org/viewvc?rev=988395&view=rev
Log:
Fix 'dereferencing type-punned pointer will break strict-aliasing rules' warning
Modified:
tomcat/native/trunk/native/src/jnilib.c
Modified: tomcat/native/trunk/native/src/jnilib.c
URL:
http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/jnilib.c?rev=988395&r1=988394&r2=988395&view=diff
==============================================================================
--- tomcat/native/trunk/native/src/jnilib.c (original)
+++ tomcat/native/trunk/native/src/jnilib.c Tue Aug 24 06:07:28 2010
@@ -49,15 +49,16 @@ int tcn_parent_pid = 0;
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved)
{
JNIEnv *env;
+ void *ppe;
apr_version_t apv;
int apvn;
UNREFERENCED(reserved);
- if ((*vm)->GetEnv(vm, (void **)&env, JNI_VERSION_1_4)) {
+ if ((*vm)->GetEnv(vm, &ppe, JNI_VERSION_1_4)) {
return JNI_ERR;
}
tcn_global_vm = vm;
-
+ env = (JNIEnv *)ppe;
/* Before doing anything else check if we have a valid
* APR version. We need version 1.4.0 as minimum.
*/
@@ -102,13 +103,15 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM
JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved)
{
JNIEnv *env;
+ void *ppe;
UNREFERENCED(reserved);
- if ((*vm)->GetEnv(vm, (void **)&env, JNI_VERSION_1_2)) {
+ if ((*vm)->GetEnv(vm, &ppe, JNI_VERSION_1_2)) {
return;
}
if (tcn_global_pool) {
+ env = (JNIEnv *)ppe;
TCN_UNLOAD_CLASS(env, jString_class);
TCN_UNLOAD_CLASS(env, jFinfo_class);
TCN_UNLOAD_CLASS(env, jAinfo_class);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]