Fix most compiler warnings and various miscellaneous problems
[platform/upstream/at-spi2-core.git] / atspi / atspi-event-listener.c
index e931ba1..1d0d010 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "atspi-private.h"
 #include <string.h>
+#include <ctype.h>
 
 typedef struct
 {
@@ -186,7 +187,7 @@ cache_process_children_changed (AtspiEvent *event)
   {
     event->source->children = g_list_remove (event->source->children, child);
     if (child == child->parent.app->root)
-      g_object_run_dispose (child->parent.app);
+      g_object_run_dispose (G_OBJECT (child->parent.app));
     g_object_unref (child);
   }
 }
@@ -310,7 +311,6 @@ convert_event_type_to_dbus (const char *eventType, char **categoryp, char **name
   gchar *tmp = strdup_and_adjust_for_dbus (eventType);
   char *category = NULL, *name = NULL, *detail = NULL;
   char *saveptr = NULL;
-  char *p;
 
   if (tmp == NULL) return FALSE;
   category = strtok_r (tmp, ":", &saveptr);
@@ -366,7 +366,7 @@ oom:
 static void
 listener_entry_free (EventListenerEntry *e)
 {
-  gpointer callback = (e->callback = remove_datum ? e->user_data : e->callback);
+  gpointer callback = (e->callback == remove_datum ? e->user_data : e->callback);
   g_free (e->category);
   g_free (e->name);
   if (e->detail) g_free (e->detail);
@@ -537,13 +537,13 @@ atspi_event_listener_register_from_callback (AtspiEventListenerCB callback,
     /* TODO: Set error */
   }
 
-  dbus_error_init (&error);
+  dbus_error_init (&d_error);
   message = dbus_message_new_method_call (atspi_bus_registry,
        atspi_path_registry,
        atspi_interface_registry,
        "RegisterEvent");
   if (!message)
-    return;
+    return FALSE;
   dbus_message_append_args (message, DBUS_TYPE_STRING, &event_type, DBUS_TYPE_INVALID);
   reply = _atspi_dbus_send_with_reply_and_block (message, error);
   if (reply)
@@ -602,9 +602,9 @@ atspi_event_listener_deregister (AtspiEventListener *listener,
                                               const gchar              *event_type,
                                               GError **error)
 {
-  atspi_event_listener_deregister_from_callback (listener->callback,
-                                                 listener->user_data,
-                                                 event_type, error);
+  return atspi_event_listener_deregister_from_callback (listener->callback,
+                                                        listener->user_data,
+                                                        event_type, error);
 }
 
 /**
@@ -662,7 +662,7 @@ atspi_event_listener_deregister_from_callback (AtspiEventListenerCB callback,
            atspi_interface_registry,
            "RegisterEvent");
       if (!message)
-      return;
+      return FALSE;
       dbus_message_append_args (message, DBUS_TYPE_STRING, &event_type, DBUS_TYPE_INVALID);
       reply = _atspi_dbus_send_with_reply_and_block (message, error);
       dbus_message_unref (reply);
@@ -774,7 +774,7 @@ atspi_dbus_handle_event (DBusConnection *bus, DBusMessage *message, void *data)
   if (strcmp (signature, "siiv(so)") != 0)
   {
     g_warning (_("Got invalid signature %s for signal %s from interface %s\n"), signature, member, category);
-    return;
+    return DBUS_HANDLER_RESULT_HANDLED;
   }
 
   memset (&e, 0, sizeof (e));