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]

gtk-peer compile fixes for gcc-2.95


Hi,

The following fixes make the gtk-peers compile again with gcc-2.95 in
Classpath.

2004-03-25  Mark Wielaard  <mark@klomp.org>
 
        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
        (item_activate): Declare label before use.
        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
        (gtkSetFont): Removed unused variable label.
        (addExposeFilter): Declare variables before use.
        (removeExposeFilter): Likewise.
        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
        (ok_clicked): Declare str_fileName before use.

Also OK for libgcj main?

Cheers,

Mark
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c,v
retrieving revision 1.6
diff -u -r1.6 gnu_java_awt_peer_gtk_GtkChoicePeer.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c	10 Jan 2004 22:42:19 -0000	1.6
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c	25 Mar 2004 17:34:14 -0000
@@ -249,9 +249,10 @@
 item_activate (GtkItem *item __attribute__((unused)),
 	       struct item_event_hook_info *ie)
 {
+  jstring label;
   gdk_threads_leave ();
 
-  jstring label = (*gdk_env)->NewStringUTF (gdk_env, ie->label);
+  label = (*gdk_env)->NewStringUTF (gdk_env, ie->label);
   (*gdk_env)->CallVoidMethod (gdk_env, ie->peer_obj,
 			      choicePostItemEventID,
 			      label,
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c,v
retrieving revision 1.20
diff -u -r1.20 gnu_java_awt_peer_gtk_GtkComponentPeer.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c	19 Mar 2004 22:25:16 -0000	1.20
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c	25 Mar 2004 17:34:14 -0000
@@ -386,7 +386,6 @@
 {
   const char *font_name;
   void *ptr;
-  GtkWidget *label;
   PangoFontDescription *font_desc;
 
   ptr = NSA_GET_PTR (env, obj);
@@ -632,12 +631,13 @@
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_addExposeFilter
   (JNIEnv *env, jobject obj)
 {
-  void *ptr = NSA_GET_PTR (env, obj);
-  jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
-  g_assert (gref);
   GtkObject *filterobj;
   GtkWidget *vbox, *layout;
   GList *children;
+  void *ptr = NSA_GET_PTR (env, obj);
+  jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
+
+  g_assert (gref);
 
   gdk_threads_enter ();
 
@@ -675,12 +675,13 @@
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_removeExposeFilter
   (JNIEnv *env, jobject obj)
 {
-  void *ptr = NSA_GET_PTR (env, obj);
-  jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
-  g_assert (gref);
   GtkObject *filterobj;
   GtkWidget *vbox, *layout;
   GList *children;
+  void *ptr = NSA_GET_PTR (env, obj);
+  jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
+
+  g_assert (gref);
 
   gdk_threads_enter ();
 
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c,v
retrieving revision 1.6
diff -u -r1.6 gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c	26 Jan 2004 15:41:09 -0000	1.6
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c	25 Mar 2004 17:34:14 -0000
@@ -186,6 +186,7 @@
   static jmethodID hideID;
   void *ptr;
   G_CONST_RETURN gchar *fileName;
+  jstring str_fileName;
 
   ptr = NSA_GET_PTR (gdk_env, peer_obj);
   
@@ -204,7 +205,7 @@
   gdk_threads_leave ();
   
   /* Set the Java object field 'file' with this value. */
-  jstring str_fileName = (*gdk_env)->NewStringUTF (gdk_env, fileName);
+  str_fileName = (*gdk_env)->NewStringUTF (gdk_env, fileName);
   (*gdk_env)->CallVoidMethod (gdk_env, peer_obj, gtkSetFilenameID, str_fileName);
 
   /* We can hide the dialog now (and unblock show) */

Attachment: signature.asc
Description: This is a digitally signed message part


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