summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@localhost.(none)>2008-10-10 20:43:07 -0400
committerSøren Sandmann Pedersen <ssp@localhost.(none)>2008-10-10 20:43:07 -0400
commit2befa55b0eefdfa6bf243c536b71d2875f0e005b (patch)
tree162d8b0a1d58c997cab7f25e847864d82ded796a
parenta16f6533140dc47a5d302b6c6d3153faf24d5865 (diff)
Put watch into the nul namespace
-rw-r--r--configure.ac8
-rw-r--r--dbw.c40
-rw-r--r--libffi/doc/libffi.info30
-rw-r--r--libnul.h38
-rw-r--r--watch.c23
5 files changed, 69 insertions, 70 deletions
diff --git a/configure.ac b/configure.ac
index 7a1a2f2..04d4993 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,12 +34,8 @@ AC_PROG_LIBTOOL
dnl Only use -Wall if we have gcc
if test "x$GCC" = "xyes"; then
- if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
- CFLAGS="$CFLAGS -Wall"
- fi
- if test -z "`echo "$CFLAGS" | grep "\-Wmissing\-declarations" 2> /dev/null`"; then
- CFLAGS="$CFLAGS -Wmissing-declarations"
- fi
+ CFLAGS="$CFLAGS -Wall -Wmissing-declarations -Wformat -Wformat-nonliteral"
+ CFLAGS="$CFLAGS -Wformat-security"
fi
AC_C_CHAR_UNSIGNED
diff --git a/dbw.c b/dbw.c
index 11b4639..4bbf9ce 100644
--- a/dbw.c
+++ b/dbw.c
@@ -159,7 +159,7 @@ update_fd (int fd)
int enabled, flags;
GList *watches, *list;
- watches = fd_get_data (fd);
+ watches = nul_fd_get_data (fd);
enabled = FALSE;
flags = 0;
@@ -177,25 +177,25 @@ update_fd (int fd)
if (enabled)
{
- fd_set_error_callback (fd, on_hangup);
- fd_set_hangup_callback (fd, on_error);
+ nul_fd_set_error_callback (fd, on_hangup);
+ nul_fd_set_hangup_callback (fd, on_error);
if (flags & DBUS_WATCH_READABLE)
- fd_set_read_callback (fd, on_read);
+ nul_fd_set_read_callback (fd, on_read);
else
- fd_set_read_callback (fd, NULL);
+ nul_fd_set_read_callback (fd, NULL);
if (flags & DBUS_WATCH_WRITABLE)
- fd_set_write_callback (fd, on_write);
+ nul_fd_set_write_callback (fd, on_write);
else
- fd_set_write_callback (fd, NULL);
+ nul_fd_set_write_callback (fd, NULL);
}
else
{
- fd_set_error_callback (fd, NULL);
- fd_set_hangup_callback (fd, NULL);
- fd_set_read_callback (fd, NULL);
- fd_set_write_callback (fd, NULL);
+ nul_fd_set_error_callback (fd, NULL);
+ nul_fd_set_hangup_callback (fd, NULL);
+ nul_fd_set_read_callback (fd, NULL);
+ nul_fd_set_write_callback (fd, NULL);
}
}
@@ -210,17 +210,17 @@ add_watch (DBusWatch *watch, void *data)
/* DBus apparently will create multiple watches for
* the same fd.
*/
- if (fd_is_watched (fd))
+ if (nul_fd_is_watched (fd))
{
- GList *watches = fd_get_data (fd);
+ GList *watches = nul_fd_get_data (fd);
watches = g_list_prepend (watches, watch);
- fd_set_data (fd, watches);
+ nul_fd_set_data (fd, watches);
}
else
{
- fd_add_watch (fd, g_list_prepend (NULL, watch));
+ nul_fd_add_watch (fd, g_list_prepend (NULL, watch));
}
update_fd (fd);
@@ -232,17 +232,17 @@ static void
remove_watch (DBusWatch *watch, void *data)
{
int fd = dbus_watch_get_unix_fd (watch);
- GList *watches = fd_get_data (fd);
+ GList *watches = nul_fd_get_data (fd);
watches = g_list_remove (watches, watch);
if (!watches)
{
- fd_remove_watch (fd);
+ nul_fd_remove_watch (fd);
}
else
{
- fd_set_data (fd, watches);
+ nul_fd_set_data (fd, watches);
update_fd (fd);
}
}
@@ -632,6 +632,7 @@ static const DBusObjectPathVTable vtable =
{
unregister_connection,
message_function,
+ NULL,
};
static GPtrArray *
@@ -1198,7 +1199,8 @@ dbw_invoke (DbwService *service,
g_return_if_fail (service != NULL);
- decode_method_desc (method_desc, &object_str, &interface_str, &method_str);
+ if (!decode_method_desc (method_desc, &object_str, &interface_str, &method_str))
+ return;
object = find_object (service, object_str);
interface = find_interface (object, interface_str);
diff --git a/libffi/doc/libffi.info b/libffi/doc/libffi.info
index dc7f02c..6321aae 100644
--- a/libffi/doc/libffi.info
+++ b/libffi/doc/libffi.info
@@ -1,5 +1,5 @@
-This is ../libffi/doc/libffi.info, produced by makeinfo version 4.11
-from ../libffi/doc/libffi.texi.
+This is doc/libffi.info, produced by makeinfo version 4.11 from
+./doc/libffi.texi.
This manual is for Libffi, a portable foreign-function interface
library.
@@ -516,18 +516,18 @@ Index

Tag Table:
-Node: Top688
-Node: Introduction1424
-Node: Using libffi3060
-Node: The Basics3495
-Node: Simple Example6102
-Node: Types7129
-Node: Primitive Types7412
-Node: Structures9232
-Node: Type Example10092
-Node: Multiple ABIs11315
-Node: The Closure API11686
-Node: Missing Features14606
-Node: Index15099
+Node: Top670
+Node: Introduction1406
+Node: Using libffi3042
+Node: The Basics3477
+Node: Simple Example6084
+Node: Types7111
+Node: Primitive Types7394
+Node: Structures9214
+Node: Type Example10074
+Node: Multiple ABIs11297
+Node: The Closure API11668
+Node: Missing Features14588
+Node: Index15081

End Tag Table
diff --git a/libnul.h b/libnul.h
index 85b4d2e..3b73934 100644
--- a/libnul.h
+++ b/libnul.h
@@ -90,25 +90,25 @@ void nul_fun_def_free (nul_fun_def_t *fun);
*/
typedef void (* WatchCallback) (gpointer data);
-void fd_add_watch (int fd,
- gpointer data);
-gpointer fd_get_data (int fd);
-void fd_set_data (int fd,
- gpointer data);
-void fd_set_read_callback (int fd,
- WatchCallback read_cb);
-void fd_set_write_callback (int fd,
- WatchCallback write_cb);
-void fd_set_hangup_callback (int fd,
- WatchCallback hangup_cb);
-void fd_set_error_callback (int fd,
- WatchCallback error_cb);
-void fd_set_priority_callback (int fd,
- WatchCallback priority_cb);
-void fd_set_poll_handler (int fd,
- WatchCallback poll_handler);
-void fd_remove_watch (int fd);
-gboolean fd_is_watched (int fd);
+void nul_fd_add_watch (int fd,
+ gpointer data);
+gpointer nul_fd_get_data (int fd);
+void nul_fd_set_data (int fd,
+ gpointer data);
+void nul_fd_set_read_callback (int fd,
+ WatchCallback read_cb);
+void nul_fd_set_write_callback (int fd,
+ WatchCallback write_cb);
+void nul_fd_set_hangup_callback (int fd,
+ WatchCallback hangup_cb);
+void nul_fd_set_error_callback (int fd,
+ WatchCallback error_cb);
+void nul_fd_set_priority_callback (int fd,
+ WatchCallback priority_cb);
+void nul_fd_set_poll_handler (int fd,
+ WatchCallback poll_handler);
+void nul_fd_remove_watch (int fd);
+gboolean nul_fd_is_watched (int fd);
/* Implementing a service */
diff --git a/watch.c b/watch.c
index dca6c03..9602f39 100644
--- a/watch.c
+++ b/watch.c
@@ -197,7 +197,7 @@ update_poll_mask (Watch *watch)
}
void
-fd_add_watch (gint fd,
+nul_fd_add_watch (gint fd,
gpointer data)
{
static GSourceFuncs watch_funcs = {
@@ -205,6 +205,7 @@ fd_add_watch (gint fd,
watch_check,
watch_dispatch,
watch_finalize,
+ NULL,
};
Watch *watch = lookup_watch (fd);
@@ -231,7 +232,7 @@ fd_add_watch (gint fd,
}
gpointer
-fd_get_data (gint fd)
+nul_fd_get_data (gint fd)
{
Watch *watch = lookup_watch (fd);
@@ -242,7 +243,7 @@ fd_get_data (gint fd)
}
void
-fd_set_data (gint fd,
+nul_fd_set_data (gint fd,
gpointer data)
{
Watch *watch = lookup_watch (fd);
@@ -254,7 +255,7 @@ fd_set_data (gint fd,
}
void
-fd_set_read_callback (gint fd,
+nul_fd_set_read_callback (gint fd,
WatchCallback read_cb)
{
Watch *watch = lookup_watch (fd);
@@ -270,7 +271,7 @@ fd_set_read_callback (gint fd,
}
void
-fd_set_write_callback (gint fd,
+nul_fd_set_write_callback (gint fd,
WatchCallback write_cb)
{
Watch *watch = lookup_watch (fd);
@@ -286,7 +287,7 @@ fd_set_write_callback (gint fd,
}
void
-fd_set_hangup_callback (gint fd,
+nul_fd_set_hangup_callback (gint fd,
WatchCallback hangup_cb)
{
Watch *watch = lookup_watch (fd);
@@ -302,7 +303,7 @@ fd_set_hangup_callback (gint fd,
}
void
-fd_set_error_callback (gint fd,
+nul_fd_set_error_callback (gint fd,
WatchCallback error_cb)
{
Watch *watch = lookup_watch (fd);
@@ -318,7 +319,7 @@ fd_set_error_callback (gint fd,
}
void
-fd_set_priority_callback (gint fd,
+nul_fd_set_priority_callback (gint fd,
WatchCallback priority_cb)
{
Watch *watch = lookup_watch (fd);
@@ -334,7 +335,7 @@ fd_set_priority_callback (gint fd,
}
void
-fd_set_poll_handler (gint fd,
+nul_fd_set_poll_handler (gint fd,
WatchCallback poll_cb)
{
Watch *watch = lookup_watch (fd);
@@ -350,7 +351,7 @@ fd_set_poll_handler (gint fd,
}
void
-fd_remove_watch (gint fd)
+nul_fd_remove_watch (gint fd)
{
Watch *watch = lookup_watch (fd);
@@ -364,7 +365,7 @@ fd_remove_watch (gint fd)
}
gboolean
-fd_is_watched (gint fd)
+nul_fd_is_watched (gint fd)
{
g_return_val_if_fail (fd > 0, FALSE);