commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r982567 - /commons/proper/daemon/trunk/src/native/unix/native/java.c
Date Thu, 05 Aug 2010 12:17:34 GMT
Author: mturk
Date: Thu Aug  5 12:17:34 2010
New Revision: 982567

URL: http://svn.apache.org/viewvc?rev=982567&view=rev
Log:
Fix compile time warnings on SunCC by using explicit type casting

Modified:
    commons/proper/daemon/trunk/src/native/unix/native/java.c

Modified: commons/proper/daemon/trunk/src/native/unix/native/java.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/unix/native/java.c?rev=982567&r1=982566&r2=982567&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/unix/native/java.c (original)
+++ commons/proper/daemon/trunk/src/native/unix/native/java.c Thu Aug  5 12:17:34 2010
@@ -102,6 +102,8 @@ char *java_library(arg_data *args, home_
     return libf;
 }
 
+typedef jint (*jvm_create_t)(JavaVM **, JNIEnv **, JavaVMInitArgs *);
+
 /* Initialize the JVM and its environment, loading libraries and all */
 bool java_init(arg_data *args, home_data *data)
 {
@@ -110,7 +112,7 @@ bool java_init(arg_data *args, home_data
     char appf[1024];
     struct stat sb;
 #endif /* ifdef OS_DARWIN */
-    jint(*symb) (JavaVM **, JNIEnv **, JavaVMInitArgs *);
+    jvm_create_t symb = NULL;
     JNINativeMethod nativemethods[2];
     JavaVMOption *opt = NULL;
     dso_handle libh   = NULL;
@@ -186,10 +188,10 @@ bool java_init(arg_data *args, home_data
 #if defined(OSD_POSIX) || defined(HAVE_KAFFEVM)
     /* BS2000 and kaffe does not allow to call JNI_CreateJavaVM indirectly */
 #else
-    symb = dso_symbol(libh, "JNI_CreateJavaVM");
+    symb = (jvm_create_t)dso_symbol(libh, "JNI_CreateJavaVM");
     if (symb == NULL) {
 #ifdef OS_DARWIN
-        symb = dso_symbol(apph, "JNI_CreateJavaVM");
+        symb = (jvm_create_t)dso_symbol(apph, "JNI_CreateJavaVM");
         if (symb == NULL) {
 #endif /* ifdef OS_DARWIN */
             log_error("Cannot find JVM library entry point");
@@ -235,7 +237,7 @@ bool java_init(arg_data *args, home_data
     }
     opt[x].optionString = strdup("abort");
     jsvc_xlate_to_ascii(opt[x].optionString);
-    opt[x].extraInfo = java_abort123;
+    opt[x].extraInfo = (void *)java_abort123;
     arg.options = opt;
 
     /* Do some debugging */
@@ -283,12 +285,12 @@ bool java_init(arg_data *args, home_data
     nativemethods[0].name = shutdownmethod;
     jsvc_xlate_to_ascii(shutdownparams);
     nativemethods[0].signature = shutdownparams;
-    nativemethods[0].fnPtr = shutdown;
+    nativemethods[0].fnPtr = (void *)shutdown;
     jsvc_xlate_to_ascii(failedmethod);
     nativemethods[1].name = failedmethod;
     jsvc_xlate_to_ascii(failedparams);
     nativemethods[1].signature = failedparams;
-    nativemethods[1].fnPtr = failed;
+    nativemethods[1].fnPtr = (void *)failed;
 
     if ((*env)->RegisterNatives(env, cls, nativemethods, 2) != 0) {
         log_error("Cannot register native methods");



Mime
View raw message