diff options
author | Mark Doffman <mdoff@silver-wind.(none)> | 2009-02-10 13:12:06 +0000 |
---|---|---|
committer | Mark Doffman <mdoff@silver-wind.(none)> | 2009-02-10 20:59:21 +0000 |
commit | dc745797c46af3dcf093e75ef0758d8cc433427f (patch) | |
tree | 7017e099503fb7d978468ba07d1e0ddf36a027db /droute | |
parent | 2db1353c28700fa75c8fa11a6d660046c189a151 (diff) | |
download | at-spi2-atk-dc745797c46af3dcf093e75ef0758d8cc433427f.tar.gz |
2009-02-10 Mark Doffman <mark.doffman@codethink.co.uk>
Fix some warnings when -Wall used.
These included non-void functions with
no return values that caused make distcheck to fail.
Diffstat (limited to 'droute')
-rw-r--r-- | droute/Makefile.am | 12 | ||||
-rw-r--r-- | droute/droute-pairhash.c | 8 | ||||
-rw-r--r-- | droute/droute-pairhash.h | 2 | ||||
-rw-r--r-- | droute/droute-test.c | 9 | ||||
-rw-r--r-- | droute/droute.c | 8 |
5 files changed, 19 insertions, 20 deletions
diff --git a/droute/Makefile.am b/droute/Makefile.am index 9ce04f1..8d7e957 100644 --- a/droute/Makefile.am +++ b/droute/Makefile.am @@ -8,7 +8,7 @@ libdroute_la_CFLAGS = $(DBUS_GLIB_CFLAGS) \ libdrouteinclude_HEADERS = \ droute.h droute-variant.h -libdrouteincludedir=$(includedir)/dbind-0.1 +libdrouteincludedir=$(includedir)/droute libdroute_la_SOURCES =\ droute.c\ @@ -20,14 +20,12 @@ libdroute_la_SOURCES =\ TESTS = droute-test -droute_test_CFLAGS = $(DBUS_GLIB_CFLAGS) \ - -I$(top_builddir) - check_PROGRAMS = droute-test droute_test_SOURCES = droute-test.c -droute_test_CPPFLAGS = $(DBUS_GLIB_CFLAGS) \ - -I$(top_builddir)\ - -DTEST_INTROSPECTION_DIRECTORY=\"$(top_srcdir)/droute\" +droute_test_CFLAGS = $(DBUS_GLIB_CFLAGS) \ + -I$(top_builddir)\ + -I$(top_srcdir)\ + -DTEST_INTROSPECTION_DIRECTORY=\"$(top_srcdir)/droute\" droute_test_LDFLAGS = $(top_builddir)/dbind/libdbind.la\ libdroute.la\ diff --git a/droute/droute-pairhash.c b/droute/droute-pairhash.c index 0c4ace5..f3b8da2 100644 --- a/droute/droute-pairhash.c +++ b/droute/droute-pairhash.c @@ -25,7 +25,7 @@ /*---------------------------------------------------------------------------*/ static guint -str_hash (guint32 h, const signed char *p) +str_hash (guint32 h, const char *p) { for (p += 1; *p != '\0'; p++) h = (h << 5) - h + *p; @@ -46,15 +46,15 @@ str_pair_new (const gchar *one, const gchar *two) return pair; } -gint +guint str_pair_hash (gconstpointer key) { StrPair *pair = (StrPair *) key; guint hash = 0; /*g_return_val_if_fail (pair != NULL, 0); - g_return_val_if_fail (pair->one != NULL, 0); - g_return_val_if_fail (pair->two != NULL, 0); + g_return_val_if_fail (pair->one != NULL, 0); + g_return_val_if_fail (pair->two != NULL, 0); */ if (*(pair->two) != '\0') diff --git a/droute/droute-pairhash.h b/droute/droute-pairhash.h index 50d4b34..1491c2d 100644 --- a/droute/droute-pairhash.h +++ b/droute/droute-pairhash.h @@ -34,7 +34,7 @@ struct _StrPair StrPair *str_pair_new (const gchar *one, const gchar *two); -gint str_pair_hash (gconstpointer key); +guint str_pair_hash (gconstpointer key); gboolean str_pair_equal (gconstpointer a, gconstpointer b); diff --git a/droute/droute-test.c b/droute/droute-test.c index 1895fb6..8b3fb7c 100644 --- a/droute/droute-test.c +++ b/droute/droute-test.c @@ -2,6 +2,7 @@ #include <glib.h> #include <string.h> #include <droute/droute.h> +#include <dbind/dbind.h> #include "dbus/dbus-glib-lowlevel.h" @@ -37,9 +38,7 @@ static gboolean success = TRUE; static DBusMessage * impl_null (DBusConnection *bus, DBusMessage *message, void *user_data) { - AnObject *object = (AnObject *) user_data; DBusMessage *reply; - DBusError error; reply = dbus_message_new_method_return (message); return reply; @@ -107,7 +106,6 @@ impl_setString (DBusConnection *bus, DBusMessage *message, void *user_data) static DBusMessage * impl_getInterfaceOne (DBusConnection *bus, DBusMessage *message, void *user_data) { - AnObject *object = (AnObject *) user_data; DBusMessage *reply; DBusError error; gchar *itf = TEST_INTERFACE_ONE; @@ -122,7 +120,6 @@ impl_getInterfaceOne (DBusConnection *bus, DBusMessage *message, void *user_data static DBusMessage * impl_getInterfaceTwo (DBusConnection *bus, DBusMessage *message, void *user_data) { - AnObject *object = (AnObject *) user_data; DBusMessage *reply; DBusError error; gchar *itf = TEST_INTERFACE_TWO; @@ -161,8 +158,8 @@ static DRouteProperty test_properties[] = { gboolean do_tests_func (gpointer data) { - DBusError error; - gchar *bus_name; + DBusError error; + const gchar *bus_name; gchar *expected_string; gchar *result_string; diff --git a/droute/droute.c b/droute/droute.c index 3b4d9e3..5b749ae 100644 --- a/droute/droute.c +++ b/droute/droute.c @@ -34,7 +34,7 @@ #if defined DROUTE_DEBUG #define _DROUTE_DEBUG(format, args...) g_print (format , ## args) #else - #define _DROUTE_DEBUG + #define _DROUTE_DEBUG(format, args...) #endif struct _DRouteContext @@ -129,6 +129,8 @@ droute_new (DBusConnection *bus, const char *introspect_dir) cnx->bus = bus; cnx->registered_paths = g_ptr_array_new (); cnx->introspect_dir = g_strdup(introspect_dir); + + return cnx; } void @@ -162,10 +164,12 @@ droute_add_one (DRouteContext *cnx, const void *data) { DRoutePath *new_path; + gboolean registered; new_path = path_new (cnx, (void *) data, NULL); - if (!dbus_connection_register_object_path (cnx->bus, path, &droute_vtable, new_path)) + registered = dbus_connection_register_object_path (cnx->bus, path, &droute_vtable, new_path); + if (!registered) oom(); g_ptr_array_add (cnx->registered_paths, new_path); |