[at-spi2-atk] Fix compile-time warnings



commit 17b84f5bd418999040720f012f56abad66055f8a
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jun 13 18:10:02 2012 +0100

    Fix compile-time warnings
    
    Unused variables, assignment used as truth values and unused functions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678045

 atk-adaptor/accessible-cache.c            |    1 -
 atk-adaptor/accessible-leasing.c          |    2 +-
 atk-adaptor/accessible-register.c         |   12 -------
 atk-adaptor/adaptors/accessible-adaptor.c |   10 ------
 atk-adaptor/adaptors/cache-adaptor.c      |    2 -
 atk-adaptor/adaptors/collection-adaptor.c |   32 +++++++------------
 atk-adaptor/adaptors/text-adaptor.c       |   28 +----------------
 atk-adaptor/event.c                       |   47 +++-------------------------
 8 files changed, 19 insertions(+), 115 deletions(-)
---
diff --git a/atk-adaptor/accessible-cache.c b/atk-adaptor/accessible-cache.c
index 20796d5..c997b4a 100644
--- a/atk-adaptor/accessible-cache.c
+++ b/atk-adaptor/accessible-cache.c
@@ -323,7 +323,6 @@ child_added_listener (GSignalInvocationHint * signal_hint,
   SpiCache *cache = spi_global_cache;
   gboolean child_needs_ref = TRUE;
   AtkObject *accessible;
-  AtkObject *child;
 
   const gchar *detail = NULL;
 
diff --git a/atk-adaptor/accessible-leasing.c b/atk-adaptor/accessible-leasing.c
index 4370bff..dcddb0b 100644
--- a/atk-adaptor/accessible-leasing.c
+++ b/atk-adaptor/accessible-leasing.c
@@ -84,7 +84,7 @@ spi_leasing_dispose (GObject * object)
   SpiLeasing *leasing = SPI_LEASING (object);
 
   ExpiryElement *head;
-  while (head = g_queue_pop_head (leasing->expiry_queue))
+  while ((head = g_queue_pop_head (leasing->expiry_queue)))
     {
       g_object_unref (head->object);
       g_slice_free (ExpiryElement, head);
diff --git a/atk-adaptor/accessible-register.c b/atk-adaptor/accessible-register.c
index 14f256f..7ca416f 100644
--- a/atk-adaptor/accessible-register.c
+++ b/atk-adaptor/accessible-register.c
@@ -72,9 +72,6 @@ static guint register_signals[LAST_SIGNAL] = { 0 };
 static void
 spi_register_finalize (GObject * object);
 
-static void
-spi_register_dispose (GObject * object);
-
 /*---------------------------------------------------------------------------*/
 
 G_DEFINE_TYPE (SpiRegister, spi_register, G_TYPE_OBJECT)
@@ -86,7 +83,6 @@ static void spi_register_class_init (SpiRegisterClass * klass)
   spi_register_parent_class = g_type_class_ref (G_TYPE_OBJECT);
 
   object_class->finalize = spi_register_finalize;
-  object_class->dispose = spi_register_dispose;
 
   register_signals [OBJECT_REGISTERED] =
       g_signal_new ("object-registered",
@@ -145,14 +141,6 @@ spi_register_finalize (GObject * object)
   G_OBJECT_CLASS (spi_register_parent_class)->finalize (object);
 }
 
-static void
-spi_register_dispose (GObject * object)
-{
-  SpiRegister *reg = SPI_REGISTER (object);
-
-  G_OBJECT_CLASS (spi_register_parent_class)->dispose (object);
-}
-
 /*---------------------------------------------------------------------------*/
 
 /*
diff --git a/atk-adaptor/adaptors/accessible-adaptor.c b/atk-adaptor/adaptors/accessible-adaptor.c
index ec21fc3..25d7823 100644
--- a/atk-adaptor/adaptors/accessible-adaptor.c
+++ b/atk-adaptor/adaptors/accessible-adaptor.c
@@ -328,7 +328,6 @@ impl_GetRelationSet (DBusConnection * bus,
       for (j = 0; j < target->len; j++)
         {
           AtkObject *obj = target->pdata[j];
-          char *path;
           if (!obj)
             continue;
           spi_object_append_reference (&iter_targets, obj);
@@ -363,15 +362,6 @@ impl_GetRole (DBusConnection * bus, DBusMessage * message, void *user_data)
   return reply;
 }
 
-static char *
-impl_get_role_str (void *datum)
-{
-  g_return_val_if_fail (ATK_IS_OBJECT (datum), g_strdup (""));
-  return g_strdup_printf ("%d",
-                          spi_accessible_role_from_atk_role
-                          (atk_object_get_role ((AtkObject *) datum)));
-}
-
 static DBusMessage *
 impl_GetRoleName (DBusConnection * bus,
                   DBusMessage * message, void *user_data)
diff --git a/atk-adaptor/adaptors/cache-adaptor.c b/atk-adaptor/adaptors/cache-adaptor.c
index 8bd49af..79a9e6a 100644
--- a/atk-adaptor/adaptors/cache-adaptor.c
+++ b/atk-adaptor/adaptors/cache-adaptor.c
@@ -152,7 +152,6 @@ append_cache_item (AtkObject * obj, gpointer data)
         for (i = 0; i < childcount; i++)
           {
             AtkObject *child;
-            gchar *child_path;
 
             child = atk_object_ref_accessible_child (obj, i);
             spi_object_append_reference (&iter_sub_array, child);
@@ -252,7 +251,6 @@ emit_cache_remove (SpiCache *cache, GObject * obj)
                                           "RemoveAccessible")))
     {
       DBusMessageIter iter;
-      gchar *path;
 
       dbus_message_iter_init_append (message, &iter);
 
diff --git a/atk-adaptor/adaptors/collection-adaptor.c b/atk-adaptor/adaptors/collection-adaptor.c
index c227079..5633a5d 100644
--- a/atk-adaptor/adaptors/collection-adaptor.c
+++ b/atk-adaptor/adaptors/collection-adaptor.c
@@ -650,8 +650,6 @@ read_mr (DBusMessageIter * iter, MatchRulePrivate * mrp)
   int array_count;
   AtkAttribute *attr;
   int i;
-  const char *str;
-  char *interfaces = NULL;
 
   dbus_message_iter_recurse (iter, &iter_struct);
 
@@ -768,19 +766,18 @@ GetMatchesFrom (DBusMessage * message,
   GList *ls = NULL;
   AtkObject *parent;
   glong index = atk_object_get_index_in_parent (current_object);
-  gint kount = 0;
 
   ls = g_list_append (ls, current_object);
 
   if (!isrestrict)
     {
       parent = atk_object_get_parent (current_object);
-      kount = query_exec (mrp, sortby, ls, 0, count, parent, index,
-                          FALSE, NULL, TRUE, traverse);
+      query_exec (mrp, sortby, ls, 0, count, parent, index,
+                  FALSE, NULL, TRUE, traverse);
     }
   else
-    kount = query_exec (mrp, sortby, ls, 0, count,
-                        current_object, 0, FALSE, NULL, TRUE, traverse);
+    query_exec (mrp, sortby, ls, 0, count,
+                current_object, 0, FALSE, NULL, TRUE, traverse);
 
   ls = g_list_remove (ls, ls->data);
 
@@ -840,14 +837,13 @@ GetMatchesInOrder (DBusMessage * message,
 {
   GList *ls = NULL;
   AtkObject *obj;
-  gint kount = 0;
 
   ls = g_list_append (ls, current_object);
 
   obj = ATK_OBJECT(spi_register_path_to_object (spi_global_register, dbus_message_get_path (message)));
 
-  kount = inorder (obj, mrp, ls, 0, count,
-                   current_object, TRUE, NULL, traverse);
+  inorder (obj, mrp, ls, 0, count,
+           current_object, TRUE, NULL, traverse);
 
   ls = g_list_remove (ls, ls->data);
 
@@ -872,14 +868,13 @@ GetMatchesInBackOrder (DBusMessage * message,
 {
   GList *ls = NULL;
   AtkObject *collection;
-  gint kount = 0;
 
   ls = g_list_append (ls, current_object);
 
   collection = ATK_OBJECT(spi_register_path_to_object (spi_global_register, dbus_message_get_path (message)));
 
-  kount = sort_order_rev_canonical (mrp, ls, 0, count, current_object,
-                                    FALSE, collection);
+  sort_order_rev_canonical (mrp, ls, 0, count, current_object,
+                            FALSE, collection);
 
   ls = g_list_remove (ls, ls->data);
 
@@ -901,20 +896,19 @@ GetMatchesTo (DBusMessage * message,
 {
   GList *ls = NULL;
   AtkObject *obj;
-  gint kount = 0;
   ls = g_list_append (ls, current_object);
 
   if (recurse)
     {
       obj = ATK_OBJECT (atk_object_get_parent (current_object));
-      kount = query_exec (mrp, sortby, ls, 0, count,
-                          obj, 0, TRUE, current_object, TRUE, traverse);
+      query_exec (mrp, sortby, ls, 0, count,
+                  obj, 0, TRUE, current_object, TRUE, traverse);
     }
   else
     {
       obj = ATK_OBJECT (spi_register_path_to_object (spi_global_register, dbus_message_get_path (message)));
-      kount = query_exec (mrp, sortby, ls, 0, count,
-                          obj, 0, TRUE, current_object, TRUE, traverse);
+      query_exec (mrp, sortby, ls, 0, count,
+                  obj, 0, TRUE, current_object, TRUE, traverse);
 
     }
 
@@ -939,7 +933,6 @@ impl_GetMatchesFrom (DBusConnection * bus, DBusMessage * message,
   dbus_uint32_t tree;
   dbus_int32_t count;
   dbus_bool_t traverse;
-  GList *ls = NULL;
   const char *signature;
 
   signature = dbus_message_get_signature (message);
@@ -1002,7 +995,6 @@ impl_GetMatchesTo (DBusConnection * bus, DBusMessage * message,
   dbus_bool_t recurse;
   dbus_int32_t count;
   dbus_bool_t traverse;
-  GList *ls = NULL;
   const char *signature;
 
   signature = dbus_message_get_signature (message);
diff --git a/atk-adaptor/adaptors/text-adaptor.c b/atk-adaptor/adaptors/text-adaptor.c
index 5600ed0..5b48a18 100644
--- a/atk-adaptor/adaptors/text-adaptor.c
+++ b/atk-adaptor/adaptors/text-adaptor.c
@@ -324,31 +324,6 @@ impl_GetAttributeValue (DBusConnection * bus, DBusMessage * message,
   return reply;
 }
 
-static char *
-_string_from_attribute_set (AtkAttributeSet * set)
-{
-  gchar *attributes, *tmp, *tmp2;
-  GSList *cur_attr;
-  AtkAttribute *at;
-
-  attributes = g_strdup ("");
-  cur_attr = (GSList *) set;
-  while (cur_attr)
-    {
-      at = (AtkAttribute *) cur_attr->data;
-      tmp = g_strdup_printf ("%s%s:%s%s",
-                             ((GSList *) (set) == cur_attr) ? "" : " ",
-                             at->name, at->value,
-                             (cur_attr->next) ? ";" : "");
-      tmp2 = g_strconcat (attributes, tmp, NULL);
-      g_free (tmp);
-      g_free (attributes);
-      attributes = tmp2;
-      cur_attr = cur_attr->next;
-    }
-  return attributes;
-}
-
 static DBusMessage *
 impl_GetAttributes (DBusConnection * bus, DBusMessage * message,
                     void *user_data)
@@ -746,8 +721,7 @@ impl_GetAttributeRun (DBusConnection * bus, DBusMessage * message,
   gint intstart_offset = 0, intend_offset = 0;
   DBusMessage *reply;
   AtkAttributeSet *attributes = NULL;
-  AtkAttribute *attr = NULL;
-  DBusMessageIter iter, iterArray;
+  DBusMessageIter iter;
 
   g_return_val_if_fail (ATK_IS_TEXT (user_data),
                         droute_not_yet_handled_error (message));
diff --git a/atk-adaptor/event.c b/atk-adaptor/event.c
index 22f817d..2875ffd 100644
--- a/atk-adaptor/event.c
+++ b/atk-adaptor/event.c
@@ -233,23 +233,6 @@ spi_atk_bridge_key_listener (AtkKeyEventStruct * event, gpointer data)
 
 /*---------------------------------------------------------------------------*/
 
-static gchar *
-convert_signal_name (const gchar * s)
-{
-  gchar *ret = g_strdup (s);
-  gchar *t;
-
-  if (!ret)
-    return NULL;
-  ret[0] = toupper (ret[0]);
-  while ((t = strchr (ret, '-')) != NULL)
-    {
-      memmove (t, t + 1, strlen (t));
-      *t = toupper (*t);
-    }
-  return ret;
-}
-
 static const void *
 validate_for_dbus (const gint type,
               const void *val)
@@ -373,7 +356,6 @@ static gboolean
 signal_is_needed (const gchar *klass, const gchar *major, const gchar *minor)
 {
   gchar *data [4];
-  GList *iter;
   event_data *evdata;
   gboolean ret = FALSE;
   GList *list;
@@ -458,9 +440,9 @@ emit_event (AtkObject  *obj,
   const char *path;
   char *minor_dbus;
 
-  gchar *cname, *t;
+  gchar *cname;
   DBusMessage *sig;
-  DBusMessageIter iter, iter_struct;
+  DBusMessageIter iter;
   
   if (!klass) klass = "";
   if (!major) major = "";
@@ -537,7 +519,7 @@ property_event_listener (GSignalInvocationHint * signal_hint,
   const gchar *pname = NULL;
 
   AtkObject *otemp;
-  const gchar *s1, s2;
+  const gchar *s1;
   gint i;
 
   accessible = g_value_get_object (&param_values[0]);
@@ -734,7 +716,7 @@ bounds_event_listener (GSignalInvocationHint * signal_hint,
   AtkObject *accessible;
   AtkRectangle *atk_rect;
   GSignalQuery signal_query;
-  const gchar *name, *s;
+  const gchar *name;
 
   g_signal_query (signal_hint->signal_id, &signal_query);
   name = signal_query.signal_name;
@@ -766,7 +748,7 @@ active_descendant_event_listener (GSignalInvocationHint * signal_hint,
   AtkObject *accessible;
   AtkObject *child;
   GSignalQuery signal_query;
-  const gchar *name, *minor;
+  const gchar *name;
   gint detail1;
 
   g_signal_query (signal_hint->signal_id, &signal_query);
@@ -775,7 +757,6 @@ active_descendant_event_listener (GSignalInvocationHint * signal_hint,
   accessible = ATK_OBJECT (g_value_get_object (&param_values[0]));
   child = ATK_OBJECT (g_value_get_pointer (&param_values[1]));
   g_return_val_if_fail (ATK_IS_OBJECT (child), TRUE);
-  minor = g_quark_to_string (signal_hint->detail);
 
   detail1 = atk_object_get_index_in_parent (child);
 
@@ -1047,24 +1028,6 @@ children_changed_event_listener (GSignalInvocationHint * signal_hint,
 
 /*---------------------------------------------------------------------------*/
 
-static void
-toplevel_added_event_listener (AtkObject * accessible,
-                               guint index, AtkObject * child)
-{
-  emit_event (accessible, ITF_EVENT_OBJECT, "children-changed", "add", index, 0,
-              "(so)", child, append_object);
-}
-
-static void
-toplevel_removed_event_listener (AtkObject * accessible,
-                                 guint index, AtkObject * child)
-{
-  emit_event (accessible, ITF_EVENT_OBJECT, "children-changed", "remove", index, 0,
-              "(so)", child, append_object);
-}
-
-/*---------------------------------------------------------------------------*/
-
 /*
  * Generic signal converter and forwarder.
  *



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