This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch][gui] commited last Pointer warning fix.


Hi all,

after clarifying on irc I commit the attached patch.
size_t is the thing we can use for this cast. intptr_t would be better but we do not have it on every system. So we decided to take size_t.


Thanks for the review.

Andreas

2004-10-26 Andreas Tobler <a.tobler@schweiz.ch>

	* jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
	(Java_gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_nativeRun):
	Fix pointer warning.
Index: jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
--- jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c	21 Oct 2004 21:12:19 -0000	1.1.2.2
+++ jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c	26 Oct 2004 07:27:13 -0000
@@ -45,18 +45,18 @@
  * Signature: (J)V
  *
  * Purpose: Run the C function whose function pointer is
- * 
+ *
  */
-JNIEXPORT void JNICALL 
+JNIEXPORT void JNICALL
 Java_gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_nativeRun(JNIEnv *gdk_env __attribute__((unused)), jobject lcl_obj __attribute__((unused)), jlong funcAddr, jlong funcArg)
 {
   /* Convert the function's address back into a pointer to a C function. */
-  void *(*funcPtr)(void *) = (void *(*)(void *)) funcAddr;
-  
+  void *(*funcPtr)(void *) = (void *(*)(void *)) (size_t)funcAddr;
+
   /* We do not need to worry about the return value from funcPtr(); it's
      just thrown away.  That is part of the g_threads spec, so no reason
      to worry about returning it.  */
-  (void) funcPtr((void *) funcArg);
+  (void) funcPtr((void *) (size_t)funcArg);
   /* Fall off the end and terminate the thread of control. */
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]