[java-atk-wrapper] Fix gcc warnings



commit e12d40776d336f8444527190e6989f796e0a42f6
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Sat Jun 1 20:15:25 2019 +0200

    Fix gcc warnings

 jni/src/AtkWrapper.c   |  9 ++++++---
 jni/src/jawhyperlink.c |  1 -
 jni/src/jawobject.c    |  8 ++++++--
 jni/src/jawtoplevel.c  |  3 ---
 jni/src/jawutil.c      | 15 +++++++++------
 5 files changed, 21 insertions(+), 15 deletions(-)
---
diff --git a/jni/src/AtkWrapper.c b/jni/src/AtkWrapper.c
index d0f5717..a8434d1 100644
--- a/jni/src/AtkWrapper.c
+++ b/jni/src/AtkWrapper.c
@@ -132,7 +132,7 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_loadAtkBridge(void)
 
   GThread *thread;
   GError *err;
-  char * message;
+  const char * message;
   message = "JNI main loop";
   err = NULL;
 
@@ -145,7 +145,7 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_loadAtkBridge(void)
   jni_main_context = g_main_context_new();
   jni_main_loop = g_main_loop_new (jni_main_context, FALSE); /*main loop NOT running*/
   atk_bridge_set_event_context(jni_main_context);
-  thread = g_thread_new(message, jni_loop_callback, (void *) jni_main_loop);
+  thread = g_thread_try_new(message, jni_loop_callback, (void *) jni_main_loop, &err);
   if(thread == NULL)
   {
     if (jaw_debug)
@@ -802,7 +802,7 @@ signal_emit_handler (gpointer p)
       gint curCount = atk_text_get_character_count(ATK_TEXT(jaw_obj));
 
       g_hash_table_insert(jaw_obj->storedData,
-                          "Previous_Count",
+                          (gpointer) "Previous_Count",
                           GINT_TO_POINTER(curCount));
 
       if (curCount > prevCount)
@@ -821,6 +821,8 @@ signal_emit_handler (gpointer p)
       }
       break;
     }
+    case Sig_Text_Property_Changed_Replace:
+      // TODO
     default:
       break;
   }
@@ -868,6 +870,7 @@ JNICALL Java_org_GNOME_Accessibility_AtkWrapper_emitSignal(JNIEnv *jniEnv,
     case Sig_Object_Property_Change_Accessible_Table_Row_Description:
     case Sig_Table_Model_Changed:
     case Sig_Text_Property_Changed:
+    default:
       break;
     case Sig_Object_Children_Changed_Add:
     {
diff --git a/jni/src/jawhyperlink.c b/jni/src/jawhyperlink.c
index b69873f..b802202 100644
--- a/jni/src/jawhyperlink.c
+++ b/jni/src/jawhyperlink.c
@@ -22,7 +22,6 @@
 #include "jawutil.h"
 #include "jawimpl.h"
 
-static void                    jaw_hyperlink_class_init                (JawHyperlinkClass      *klass);
 static void                    jaw_hyperlink_dispose                   (GObject                *gobject);
 static void                    jaw_hyperlink_finalize                  (GObject                *gobject);
 
diff --git a/jni/src/jawobject.c b/jni/src/jawobject.c
index d0c31d4..98f7827 100644
--- a/jni/src/jawobject.c
+++ b/jni/src/jawobject.c
@@ -29,8 +29,6 @@
 extern "C" {
 #endif
 
-static void jaw_object_class_init(JawObjectClass *klass);
-static void jaw_object_init(JawObject *object);
 static void jaw_object_initialize(AtkObject *jaw_obj, gpointer data);
 static void jaw_object_dispose(GObject *gobject);
 static void jaw_object_finalize(GObject *gobject);
@@ -332,6 +330,8 @@ static void jaw_object_set_name (AtkObject *atk_obj, const gchar *name)
     return;
   }
 
+  /* FIXME: this is not actually using the name parameter */
+
   atk_obj->name = (gchar *)ATK_OBJECT_CLASS (parent_class)->get_name (atk_obj);
 
   jclass classAccessibleContext = (*jniEnv)->FindClass(jniEnv,
@@ -340,6 +340,7 @@ static void jaw_object_set_name (AtkObject *atk_obj, const gchar *name)
                                           classAccessibleContext,
                                           "setAccessibleName",
                                           "(Ljava/lang/String;)");
+  /* FIXME: this should be CallVoidMethod, and be passed the name */
   jstring jstr = (*jniEnv)->CallObjectMethod( jniEnv, ac, jmid );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
 
@@ -411,12 +412,15 @@ static void jaw_object_set_description (AtkObject *atk_obj, const gchar *descrip
     return;
   }
 
+  /* FIXME: this is not actually using the description parameter */
+
   jclass classAccessibleContext = (*jniEnv)->FindClass( jniEnv,
                                                        "javax/accessibility/AccessibleContext" );
   jmethodID jmid = (*jniEnv)->GetMethodID(jniEnv,
                                           classAccessibleContext,
                                           "setAccessibleDescription",
                                           "(Ljava/lang/String;)");
+  /* FIXME: this should be CallVoidMethod, and be passed the description */
   jstring jstr = (*jniEnv)->CallObjectMethod( jniEnv, ac, jmid );
   (*jniEnv)->DeleteGlobalRef(jniEnv, ac);
 
diff --git a/jni/src/jawtoplevel.c b/jni/src/jawtoplevel.c
index db8de88..eeacda5 100644
--- a/jni/src/jawtoplevel.c
+++ b/jni/src/jawtoplevel.c
@@ -23,9 +23,6 @@
 #include <glib.h>
 #include "jawtoplevel.h"
 
-static void jaw_toplevel_class_init(JawToplevelClass *klass);
-static void jaw_toplevel_init(JawToplevel *toplevel);
-
 static void jaw_toplevel_initialize(AtkObject *accessible, gpointer data);
 static void jaw_toplevel_object_finalize(GObject *obj);
 
diff --git a/jni/src/jawutil.c b/jni/src/jawutil.c
index 0c25101..59e7dd6 100644
--- a/jni/src/jawutil.c
+++ b/jni/src/jawutil.c
@@ -33,7 +33,7 @@ extern "C" {
 #endif
 
 /* AtkUtil */
-static void jaw_util_class_init(JawUtilClass *klass);
+static void jaw_util_class_init(JawUtilClass *klass, void *klass_data);
 
 static guint jaw_util_add_key_event_listener(AtkKeySnoopFunc listener,
                                              gpointer data);
@@ -72,7 +72,7 @@ jaw_util_get_type(void)
 }
 
 static void
-jaw_util_class_init(JawUtilClass *kclass)
+jaw_util_class_init(JawUtilClass *kclass, void *klass_data)
 {
   AtkUtilClass *atk_class;
   gpointer data;
@@ -202,10 +202,10 @@ jaw_util_get_tflag_from_jobj(JNIEnv *jniEnv, jobject jObj)
     ac = jObj;
   } else if((*jniEnv)->IsInstanceOf(jniEnv, jObj, classAccessible))
   {
-    jmethodID jmid = (*jniEnv)->GetMethodID(jniEnv,
-                                            classAccessible,
-                                            "getAccessibleContext",
-                                            "()Ljavax/accessibility/AccessibleContext;");
+    jmid = (*jniEnv)->GetMethodID(jniEnv,
+                                  classAccessible,
+                                  "getAccessibleContext",
+                                  "()Ljavax/accessibility/AccessibleContext;");
     ac = (*jniEnv)->CallObjectMethod(jniEnv, jObj, jmid);
   } else {
     return 0;
@@ -368,6 +368,9 @@ jaw_util_get_jni_env(void)
     case JNI_EVERSION:
       g_printerr(" *** Version error *** \n");
       break;
+    default:
+      g_printerr(" *** Unknown result %d *** \n", res);
+      break;
   }
 
   fflush(stderr);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]