From: Mark Doffman Date: Tue, 10 Feb 2009 13:12:06 +0000 (+0000) Subject: 2009-02-10 Mark Doffman X-Git-Tag: AT_SPI2_ATK_2_12_0~551 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git;a=commitdiff_plain;h=dc745797c46af3dcf093e75ef0758d8cc433427f 2009-02-10 Mark Doffman Fix some warnings when -Wall used. These included non-void functions with no return values that caused make distcheck to fail. --- diff --git a/atk-adaptor/Makefile.am b/atk-adaptor/Makefile.am index c47cefc..2ae7a74 100644 --- a/atk-adaptor/Makefile.am +++ b/atk-adaptor/Makefile.am @@ -24,7 +24,7 @@ libspiatk_la_SOURCES = \ accessible-register.c \ accessible-register.h \ action-adaptor.c \ - adaptor.h \ + adaptors.h \ application-adaptor.c \ bridge.c \ bridge.h \ diff --git a/atk-adaptor/accessible-register.c b/atk-adaptor/accessible-register.c index af9f752..f92c078 100644 --- a/atk-adaptor/accessible-register.c +++ b/atk-adaptor/accessible-register.c @@ -120,6 +120,7 @@ assign_reference(void) /* Reference of 0 not allowed as used as direct key in hash table */ if (counter == 0) counter++; + return counter; } /* diff --git a/dbind/dbind-any.c b/dbind/dbind-any.c index 83a87ba..0d0ecf9 100644 --- a/dbind/dbind-any.c +++ b/dbind/dbind-any.c @@ -8,15 +8,13 @@ #undef DEBUG -/* Align a value upward to a boundary, expressed as a number of bytes. - E.g. align to an 8-byte boundary with argument of 8. */ - -/* +/* Align a value upward to a boundary, expressed as a number of bytes. + * E.g. align to an 8-byte boundary with argument of 8. + * * (this + boundary - 1) * & * ~(boundary - 1) */ - #define ALIGN_VALUE(this, boundary) \ (( ((gulong)(this)) + (((gulong)(boundary)) -1)) & (~(((gulong)(boundary))-1))) @@ -51,7 +49,7 @@ warn_braces () static unsigned int dbind_find_c_alignment_r (char **type) { - unsigned int retval = 1; + unsigned int retval = 1; char t = **type; (*type)++; @@ -82,7 +80,7 @@ dbind_find_c_alignment_r (char **type) case DBUS_TYPE_SIGNATURE: case DBUS_TYPE_ARRAY: return DBIND_ALIGNOF_DBIND_POINTER; - case DBUS_STRUCT_BEGIN_CHAR: + case DBUS_STRUCT_BEGIN_CHAR: #if DBIND_ALIGNOF_DBIND_STRUCT > 1 retval = MAX (retval, DBIND_ALIGNOF_DBIND_STRUCT); #endif @@ -91,7 +89,7 @@ dbind_find_c_alignment_r (char **type) retval = MAX (retval, elem_align); } (*type)++; - return retval; + return retval; case DBUS_TYPE_STRUCT: case DBUS_TYPE_DICT_ENTRY: warn_braces (); @@ -99,9 +97,9 @@ dbind_find_c_alignment_r (char **type) case '\0': g_assert_not_reached(); break; - default: + default: return 1; - } + } } /*---------------------------------------------------------------------------*/ @@ -110,23 +108,25 @@ dbind_find_c_alignment_r (char **type) static size_t dbind_gather_alloc_info_r (char **type) { - char t = **type; - (*type)++; - if (t == DBUS_TYPE_ARRAY) { - switch (**type) { - case DBUS_STRUCT_BEGIN_CHAR: - while (**type != DBUS_STRUCT_END_CHAR && **type != '\0') (*type)++; - if (**type != '\0') (*type)++; - break; - case '\0': - break; - default: - (*type)++; - break; - } + char t = **type; + (*type)++; + if (t == DBUS_TYPE_ARRAY) + { + switch (**type) + { + case DBUS_STRUCT_BEGIN_CHAR: + while (**type != DBUS_STRUCT_END_CHAR && **type != '\0') (*type)++; + if (**type != '\0') (*type)++; + break; + case '\0': + break; + default: + (*type)++; + break; } + } - switch (t) { + switch (t) { case DBUS_TYPE_BYTE: return sizeof (char); case DBUS_TYPE_BOOLEAN: @@ -167,15 +167,15 @@ dbind_gather_alloc_info_r (char **type) case DBUS_TYPE_STRUCT: case DBUS_TYPE_DICT_ENTRY: warn_braces (); - default: - return 0; - } + default: + return 0; + } } static size_t dbind_gather_alloc_info (char *type) { - return dbind_gather_alloc_info_r (&type); + return dbind_gather_alloc_info_r (&type); } /*---------------------------------------------------------------------------*/ @@ -183,8 +183,6 @@ dbind_gather_alloc_info (char *type) static void dbind_any_free_r (char **type, void **data) { - size_t len; - #ifdef DEBUG fprintf (stderr, "any free '%c' to %p\n", **type, *data); #endif @@ -208,7 +206,7 @@ dbind_any_free_r (char **type, void **data) int i; GArray *vals = **(void ***)data; size_t elem_size, elem_align; - char *saved_child_type, *child_type_string; + char *saved_child_type; (*type)++; saved_child_type = *type; diff --git a/dbind/dbind.c b/dbind/dbind.c index 0103b4b..0b5224f 100644 --- a/dbind/dbind.c +++ b/dbind/dbind.c @@ -54,7 +54,7 @@ dbind_method_call_reentrant_va (DBusConnection *cnx, DBusMessage *msg = NULL, *reply = NULL; DBusMessageIter iter; DBusError *err, real_err; - char *p; + const char *p; if (opt_error) err = opt_error; 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 #include #include +#include #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);