[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: warning cleanups in gtk code

Kaffe CVS cvs-commits at kaffe.org
Wed Oct 27 14:27:45 PDT 2004


PatchSet 5373 
Date: 2004/10/27 21:23:32
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: warning cleanups in gtk code

2004-10-27  Dalibor Topic  <robilad at kaffe.org>

        * libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c:
        Resynced with GNU Classpath.

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

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
        (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Use the
        GTK_TEXT_VIEW macro.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
        (connect_awt_hook_cb): Mark unused variable unused.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
        (selection_get): Do the cast right.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
        (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create): According to
        the gtk API gtk_combo_box_new_text actually returns a GtkWidget.
        Remove unused var menu.
        (selection_changed): Remove unused value.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
        (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_setNativeBounds): Fix pointer
        warning with using an intermediate variable.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
        (area_updated): Fix unused var warning for BE archs.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
        (Java_gnu_java_awt_peer_gtk_GdkGraphics_connectSignals): Remove unused
        var.
        (realize_cb): Mark unused variable unused.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
        (seek_glyphstring_idx): Fix a C90 warning.

Members: 
	ChangeLog:1.2925->1.2926 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c:1.1->1.2 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c:1.2->1.3 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c:1.2->1.3 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c:1.5->1.6 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2925 kaffe/ChangeLog:1.2926
--- kaffe/ChangeLog:1.2925	Wed Oct 27 19:08:23 2004
+++ kaffe/ChangeLog	Wed Oct 27 21:23:32 2004
@@ -1,5 +1,46 @@
 2004-10-27  Dalibor Topic  <robilad at kaffe.org>
 
+	* libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c:
+	Resynced with GNU Classpath.
+
+	2004-10-26  Andreas Tobler  <a.tobler at schweiz.ch>
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
+        (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Use the
+        GTK_TEXT_VIEW macro.
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+        (connect_awt_hook_cb): Mark unused variable unused.
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
+        (selection_get): Do the cast right.
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
+        (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create): According to
+        the gtk API gtk_combo_box_new_text actually returns a GtkWidget.
+        Remove unused var menu.
+        (selection_changed): Remove unused value.
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+        (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_setNativeBounds): Fix pointer
+        warning with using an intermediate variable.
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
+        (area_updated): Fix unused var warning for BE archs.
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
+        (Java_gnu_java_awt_peer_gtk_GdkGraphics_connectSignals): Remove unused
+        var.
+        (realize_cb): Mark unused variable unused.
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
+        (seek_glyphstring_idx): Fix a C90 warning.
+
+2004-10-27  Dalibor Topic  <robilad at kaffe.org>
+
 	* libraries/javalib/java/awt/Choice.java:
         Resynced with GNU Classpath.
 
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c:1.1 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c:1.2
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c:1.1	Thu Jul 22 19:04:01 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c	Wed Oct 27 21:23:40 2004
@@ -45,19 +45,18 @@
  * Signature: (J)V
  *
  * Purpose: Run the C function whose function pointer is
- * 
+ *
  */
-JNIEXPORT void JNICALL 
-Java_gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_nativeRun(JNIEnv *gdk_env, jobject lcl_obj, 
-					 jlong funcAddr, jlong funcArg)
+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: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c:1.2 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c:1.3
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c:1.2	Sat Oct  9 22:18:25 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c	Wed Oct 27 21:23:40 2004
@@ -42,7 +42,7 @@
 #include <gdk/gdkx.h>
 
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontMetrics_getPeerFontMetrics
-   (JNIEnv *env, jclass clazz, jobject java_font, jdoubleArray java_metrics)
+   (JNIEnv *env, jclass clazz __attribute__ ((unused)), jobject java_font, jdoubleArray java_metrics)
 {
   struct peerfont *pfont = NULL;
   jdouble *native_metrics = NULL;
@@ -75,7 +75,7 @@
 }
 
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontMetrics_getPeerTextMetrics
-   (JNIEnv *env, jclass clazz, jobject java_font, jstring str, jdoubleArray java_metrics)
+   (JNIEnv *env, jclass clazz __attribute__ ((unused)), jobject java_font, jstring str, jdoubleArray java_metrics)
 {
   struct peerfont *pfont = NULL;
   const char *cstr = NULL;
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c:1.2 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c:1.3
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c:1.2	Sun Sep 12 15:10:53 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c	Wed Oct 27 21:23:40 2004
@@ -58,8 +58,8 @@
   NSA_GV_INIT (env, clazz);
 }
 
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_initState 
-  (JNIEnv *env, jobject self, jobject font, jobject ctx)
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_initState
+  (JNIEnv *env, jobject self, jobject font, jobject ctx __attribute__ ((unused)))
 {
   struct glyphvec *vec = NULL;
   struct peerfont *pfont = NULL;
@@ -114,12 +114,13 @@
 {
   GList *i = NULL;
   PangoGlyphItem *gi = NULL;
+  int begin = 0;
 
   g_assert (list != NULL);
   g_assert (gs != NULL);
   g_assert (nidx != NULL);
 
-  int begin = 0;
+ 
   for (i = g_list_first (list); i != NULL; i = g_list_next (i))
     {
       g_assert (i->data != NULL);
@@ -330,8 +331,8 @@
 }
 
 
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setGlyphCodes 
-  (JNIEnv *env, jobject self, jintArray codes)
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setGlyphCodes
+  (JNIEnv *env, jobject self, jintArray codes __attribute__ ((unused)))
 {
   struct glyphvec *vec = NULL;
 
@@ -398,8 +399,8 @@
 }
 
 
-JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphCharIndex 
-  (JNIEnv *env, jobject self, jint idx)
+JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphCharIndex
+(JNIEnv *env __attribute__ ((unused)), jobject self  __attribute__ ((unused)), jint idx)
 {
   /* 
      FIXME: this is not correct, rather it assumes a (broken) 1:1
@@ -625,7 +626,7 @@
 
 
 JNIEXPORT jboolean JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphIsHorizontal 
-  (JNIEnv *env, jobject self, jint idx)
+(JNIEnv *env, jobject self, jint idx  __attribute__ ((unused)))
 {
   struct glyphvec *vec = NULL;
   PangoDirection dir;
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c:1.5 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c:1.6
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c:1.5	Sat Oct  9 22:18:26 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c	Wed Oct 27 21:23:40 2004
@@ -127,10 +127,9 @@
    This function extracts the filename from the GtkFileFilterInfo object,
    and passes it to the Java method.  The Java method will call the filter's
    accept() method and will give back the return value. */
-gboolean filenameFilterCallback (const GtkFileFilterInfo *filter_info,
-                                 gpointer obj)
+static gboolean filenameFilterCallback (const GtkFileFilterInfo *filter_info,
+					gpointer obj)
 {
-  gchar* dirname;
   jclass cx;
   jmethodID id;
   jstring *filename;
@@ -151,7 +150,7 @@
 
 JNIEXPORT void JNICALL 
 Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetFilenameFilter
-    (JNIEnv *env, jobject obj, jobject filter_obj)
+    (JNIEnv *env, jobject obj, jobject filter_obj __attribute__((unused)))
 {
   void *ptr;
   GtkFileFilter *filter;
@@ -161,11 +160,8 @@
   gdk_threads_enter ();
 
   filter = gtk_file_filter_new();
-  gtk_file_filter_add_custom(filter,
-                             GTK_FILE_FILTER_FILENAME,
-                             G_CALLBACK(filenameFilterCallback),
-                             obj,
-                             NULL);
+  gtk_file_filter_add_custom(filter, GTK_FILE_FILTER_FILENAME,
+			     filenameFilterCallback, obj, NULL);
 
   gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(ptr), filter);
 
@@ -220,7 +216,7 @@
   static jmethodID disposeID;
   void *ptr;
   G_CONST_RETURN gchar *fileName;
-  jstring str_fileName;
+  jstring str_fileName = NULL;
 
   /* We only need this for the case when the user closed the window,
      or clicked ok or cancel. */
@@ -252,8 +248,6 @@
   if (responseId == GTK_RESPONSE_OK) {
     fileName = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (GTK_WIDGET (ptr)));
     str_fileName = (*gdk_env)->NewStringUTF (gdk_env, fileName);
-  } else if (responseId == GTK_RESPONSE_CANCEL) {
-    str_fileName = NULL;
   }
 
   if (!isIDSet)




More information about the kaffe mailing list