2007-01-24 Kjartan Maraas <kmaraas@gnome.org>
authorkmaraas <kmaraas@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 24 Jan 2007 19:16:59 +0000 (19:16 +0000)
committerkmaraas <kmaraas@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 24 Jan 2007 19:16:59 +0000 (19:16 +0000)
* cspi/bonobo/cspi-bonobo-listener.h:
* cspi/bonobo/cspi-bonobo.c: (cspi_init):
* cspi/spi_hypertext.c: (AccessibleHypertext_getLink):
* cspi/spi_main.c: (SPI_eventIsReady):
* cspi/spi_streamablecontent.c: (AccessibleStreamableContent_read):
* libspi/streamablecontent.c:
* libspi/util.c: (spi_re_entrant_list_delete_link):
* login-helper/login-helper.c:
* registryd/deviceeventcontroller.c:
(spi_controller_update_key_grabs), (isEvent):
* registryd/registry.c:
* test/key-listener-test.c: (simple_at_exit):
* test/login-helper-server-test.c: (test_set_wm_dock),
(test_post_window):
Fix a bunch of warnings from sparse:
- ANSIfication of function declarations
- NULL vs 0
- Add some prototypes
- make some stuff static

git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@882 e2bd861d-eb25-0410-b326-f6ed22b6b98c

12 files changed:
cspi/bonobo/cspi-bonobo-listener.h
cspi/bonobo/cspi-bonobo.c
cspi/spi_hypertext.c
cspi/spi_main.c
cspi/spi_streamablecontent.c
libspi/streamablecontent.c
libspi/util.c
login-helper/login-helper.c
registryd/deviceeventcontroller.c
registryd/registry.c
test/key-listener-test.c
test/login-helper-server-test.c

index 08d74b7..a3e1321 100644 (file)
@@ -56,6 +56,8 @@ typedef struct {
 } CSpiDeviceListener;
 typedef SpiDeviceListenerClass CSpiDeviceListenerClass;
 
+CORBA_Object
+cspi_device_listener_get_corba (AccessibleDeviceListener *listener);
 GType cspi_device_listener_get_type (void);
 gpointer cspi_device_listener_new (void);
 void cspi_device_listener_add_cb (AccessibleDeviceListener  *al,
index 13b1aa3..797f361 100644 (file)
@@ -145,12 +145,11 @@ cspi_get_registry_ior (void)
 CORBA_Object
 cspi_init (void)
 {
-  char *obj_id;
-  CORBA_Object registry;
+  CORBA_Object registry = NULL;
   CORBA_Environment ev;
   char *ior =  NULL;
 
-  if (!bonobo_init (0, NULL))
+  if (!bonobo_init (NULL, NULL))
     {
       g_error ("Could not initialize Bonobo");
     }
index aaa20a8..35a64af 100644 (file)
@@ -94,7 +94,7 @@ AccessibleHypertext_getLink (AccessibleHypertext *obj,
 {
   AccessibleHyperlink *retval;
        
-  cspi_return_val_if_fail (obj != NULL, FALSE);
+  cspi_return_val_if_fail (obj != NULL, NULL);
 
   retval = cspi_object_add (
     Accessibility_Hypertext_getLink (CSPI_OBJREF (obj),
index 9bb2e32..b8e11bd 100644 (file)
@@ -35,7 +35,7 @@
 
 #undef DEBUG_OBJECTS
 
-static CORBA_Environment ev = { 0 };
+static CORBA_Environment ev = { NULL };
 static Accessibility_Registry registry = CORBA_OBJECT_NIL;
 static GHashTable *live_refs = NULL;
 static GQueue *exception_handlers = NULL;
@@ -430,7 +430,7 @@ SPI_event_quit (void)
  *
  **/
 SPIBoolean
-SPI_eventIsReady ()
+SPI_eventIsReady (void)
 {
   return FALSE;
 }
index d79aa64..6c69b75 100644 (file)
@@ -400,7 +400,7 @@ AccessibleStreamableContent_read (AccessibleStreamableContent *obj,
   cached = g_hash_table_lookup (get_streams (), CSPI_OBJREF (obj));
   if (cached)
     {
-      CORBA_long len_read;
+      CORBA_long len_read = 0;
       stream = cached->stream;
       if (stream != CORBA_OBJECT_NIL)
        {
index 785bf3a..cbe0686 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <config.h>
 #include <stdio.h>
+#include <string.h>
 #include <libspi/accessible.h>
 #include <libspi/component.h>
 #include <libspi/streamablecontent.h>
index 5c77669..a95b781 100644 (file)
@@ -66,7 +66,7 @@ spi_re_entrant_list_delete_link (GList * const *element_ptr)
   next = element->next;
   first_item = (element->prev == NULL);
 
-  g_list_remove_link (NULL, element);
+  element = g_list_remove_link (NULL, element);
 
   for (l = working_list; l; l = l->next)
     {
index de3a9a7..180ea93 100644 (file)
@@ -38,7 +38,7 @@ login_helper_finalize (GObject *object)
   (G_OBJECT_CLASS (bonobo_object_parent_class))->finalize (object);
 }
 
-gboolean
+static gboolean
 login_helper_set_safe (LoginHelper *helper, gboolean safe)
 {
   LoginHelperClass *klass = LOGIN_HELPER_GET_CLASS (helper);
@@ -59,7 +59,7 @@ impl_login_helper_set_safe (PortableServer_Servant servant,
   return login_helper_set_safe (helper, safe);
 }
 
-LoginHelperDeviceReqFlags
+static LoginHelperDeviceReqFlags
 login_helper_get_device_reqs (LoginHelper *helper)
 {
   LoginHelperClass *klass = LOGIN_HELPER_GET_CLASS (helper);
@@ -143,7 +143,7 @@ impl_login_helper_get_device_reqs (PortableServer_Servant servant,
   return list;
 }
 
-Window*
+static Window*
 login_helper_get_raise_windows (LoginHelper *helper)
 {
   LoginHelperClass *klass = LOGIN_HELPER_GET_CLASS (helper);
index 66cc323..9f6572d 100644 (file)
@@ -83,7 +83,7 @@ static unsigned int _numlock_physical_mask = Mod2Mask; /* a guess, will be reset
 
 static GQuark spi_dec_private_quark = 0;
 
-int (*x_default_error_handler) (Display *display, XErrorEvent *error_event);
+static int (*x_default_error_handler) (Display *display, XErrorEvent *error_event);
 
 typedef enum {
   SPI_DEVICE_TYPE_KBD,
@@ -1236,7 +1236,7 @@ global_filter_fn (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
   return GDK_FILTER_CONTINUE;
 }
 
-int
+static int
 _spi_controller_device_error_handler (Display *display, XErrorEvent *error)
 {
   if (error->error_code == BadAccess) 
@@ -1677,7 +1677,7 @@ spi_controller_update_key_grabs (SpiDEController           *controller,
 {
   GList *l, *next;
   gboolean   update_failed = FALSE;
-  KeyCode keycode;
+  KeyCode keycode = 0;
   
   g_return_val_if_fail (controller != NULL, FALSE);
 
@@ -2435,15 +2435,12 @@ spi_device_event_controller_class_init (SpiDEControllerClass *klass)
 }
 
 #ifdef HAVE_XEVIE
-Bool isEvent(dpy,event,arg)
-     Display *dpy;
-     XEvent *event;
-     char *arg;
+static Bool isEvent(Display *dpy, XEvent *event, char *arg)
 {
    return TRUE;
 }
 
-gboolean
+static gboolean
 handle_io (GIOChannel *source,
            GIOCondition condition,
            gpointer data) 
index d3f1c6d..5639f13 100644 (file)
@@ -81,7 +81,7 @@ spi_registry_set_debug (const char *debug_flag_string)
     _dbg = (int) g_ascii_strtod (debug_flag_string, NULL);
 }
 
-SpiListenerStruct *
+static SpiListenerStruct *
 spi_listener_struct_new (Accessibility_EventListener listener, CORBA_Environment *ev)
 {
   SpiListenerStruct *retval = g_malloc (sizeof (SpiListenerStruct));
@@ -90,7 +90,7 @@ spi_listener_struct_new (Accessibility_EventListener listener, CORBA_Environment
 }
 
 
-void
+static void
 spi_listener_struct_free (SpiListenerStruct *ls, CORBA_Environment *ev)
 {
   bonobo_object_release_unref (ls->listener, ev);
index c731d61..5c7d43d 100644 (file)
@@ -114,7 +114,7 @@ main (int argc, char **argv)
 }
 
 static void
-simple_at_exit ()
+simple_at_exit (void)
 {
   SPI_deregisterAccessibleKeystrokeListener (command_key_listener, SPI_KEYMASK_ALT | SPI_KEYMASK_CONTROL);
   AccessibleKeystrokeListener_unref         (command_key_listener);
index c7b2679..bfa8c20 100644 (file)
@@ -126,7 +126,7 @@ test_get_raise_windows (LoginHelper *helper)
 
 
 void
-test_set_wm_dock ()
+test_set_wm_dock (void)
 {
   Atom atom_type[1], atom_window_type;
 
@@ -149,7 +149,7 @@ test_set_wm_dock ()
 }
 
 static void
-test_post_window ()
+test_post_window (void)
 {
         mainwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);