From ba21a8bd212c3336cfcfc7b9a36186f32966e701 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Tue, 5 Jan 2010 07:08:17 +0000 Subject: [PATCH] Build cleanly on -Wall --- src/Makefile.am | 2 +- src/config_file.c | 7 ++++++- src/display_cow.c | 2 ++ src/xcowsayd.c | 3 +-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 6db46a4..b0b29b7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ bin_PROGRAMS = xcowsay bin_SCRIPTS = xcowfortune xcowdream xcowthink -AM_CFLAGS = $(XCOWSAY_CFLAGS) +AM_CFLAGS = $(XCOWSAY_CFLAGS) -Wall LDADD = $(XCOWSAY_LIBS) xcowsay_SOURCES = xcowsay.c display_cow.c display_cow.h floating_shape.h \ diff --git a/src/config_file.c b/src/config_file.c index 4c52eae..461748f 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -15,6 +15,11 @@ * along with this program. If not, see . */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define _GNU_SOURCE #include #include #include @@ -162,7 +167,7 @@ static char *config_file_name(void) const char *home = getenv("HOME"); if (NULL == home) - return; + return NULL; char *fname = NULL; const char *xdg_config_home = getenv("XDG_CONFIG_HOME"); diff --git a/src/display_cow.c b/src/display_cow.c index 9b0b135..1b93fba 100644 --- a/src/display_cow.c +++ b/src/display_cow.c @@ -15,10 +15,12 @@ * along with this program. If not, see . */ +#define _GNU_SOURCE #include #include #include #include +#include #include #include diff --git a/src/xcowsayd.c b/src/xcowsayd.c index 1c6e70a..3d67c71 100644 --- a/src/xcowsayd.c +++ b/src/xcowsayd.c @@ -153,7 +153,7 @@ static void cowsayd_init(Cowsay *server) { GError *error = NULL; DBusGProxy *driver_proxy; - int request_ret; + guint request_ret; // Initialise the DBus connection server->connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error); @@ -247,7 +247,6 @@ void run_cowsay_daemon(bool debug, int argc, char **argv) cowsay_init(&argc, &argv); g_type_init(); - Cowsay *server = g_object_new(cowsayd_get_type(), NULL); GThread *displ = g_thread_create(cow_display_thread, (gpointer)&debug, FALSE, NULL); g_assert(displ); -- 2.39.2