Fix some warnings when -Wall used.
These included non-void functions with
no return values that caused make distcheck to fail.
accessible-register.c \
accessible-register.h \
action-adaptor.c \
- adaptor.h \
+ adaptors.h \
application-adaptor.c \
bridge.c \
bridge.h \
/* Reference of 0 not allowed as used as direct key in hash table */
if (counter == 0)
counter++;
+ return counter;
}
/*
#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)))
static unsigned int
dbind_find_c_alignment_r (char **type)
{
- unsigned int retval = 1;
+ unsigned int retval = 1;
char t = **type;
(*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
retval = MAX (retval, elem_align);
}
(*type)++;
- return retval;
+ return retval;
case DBUS_TYPE_STRUCT:
case DBUS_TYPE_DICT_ENTRY:
warn_braces ();
case '\0':
g_assert_not_reached();
break;
- default:
+ default:
return 1;
- }
+ }
}
/*---------------------------------------------------------------------------*/
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:
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);
}
/*---------------------------------------------------------------------------*/
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
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;
DBusMessage *msg = NULL, *reply = NULL;
DBusMessageIter iter;
DBusError *err, real_err;
- char *p;
+ const char *p;
if (opt_error)
err = opt_error;
libdrouteinclude_HEADERS = \
droute.h
droute-variant.h
-libdrouteincludedir=$(includedir)/dbind-0.1
+libdrouteincludedir=$(includedir)/droute
libdroute_la_SOURCES =\
droute.c\
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\
/*---------------------------------------------------------------------------*/
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;
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')
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);
#include <glib.h>
#include <string.h>
#include <droute/droute.h>
+#include <dbind/dbind.h>
#include "dbus/dbus-glib-lowlevel.h"
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;
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;
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;
gboolean
do_tests_func (gpointer data)
{
- DBusError error;
- gchar *bus_name;
+ DBusError error;
+ const gchar *bus_name;
gchar *expected_string;
gchar *result_string;
#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
cnx->bus = bus;
cnx->registered_paths = g_ptr_array_new ();
cnx->introspect_dir = g_strdup(introspect_dir);
+
+ return cnx;
}
void
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);