From b5ba581c2490602c9440b26e1fde314fbae7ff59 Mon Sep 17 00:00:00 2001 From: "Ira W. Snyder" Date: Fri, 18 Jan 2008 20:28:27 -0800 Subject: [PATCH] Warning Fixes This adds -Wall to the default build flags, and fixes all of the important warnings. The only ones left have to do with the type of argument for the tomboy keybinder callback functions, and the non-casted pointers in debug_printf() statements. --- Makefile | 2 +- tilda-window.c | 7 +++++-- tilda.c | 3 ++- tilda.h | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e3c574a..f781474 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ GCC=gcc # Normal CFLAGS -CFLAGS=-ggdb -O1 -pipe -DDEBUG=1 +CFLAGS=-ggdb -O1 -pipe -Wall -DDEBUG=1 LDFLAGS=-Wl,-O1 -Wl,--sort-common -Wl,--as-needed #CFLAGS=-ggdb -O1 -pipe -DDEBUG=1 -ffunction-sections -fdata-sections #LDFLAGS=-Wl,--gc-sections -Wl,--print-gc-sections diff --git a/tilda-window.c b/tilda-window.c index 85fa02b..c5ac71a 100644 --- a/tilda-window.c +++ b/tilda-window.c @@ -1,6 +1,9 @@ +#include + #include "tilda.h" #include "tilda-window.h" #include "tilda-window-dbus-glue.h" +#include "tomboykeybinder.h" /** * Find the TildaTerminal corresponding to the currently selected @@ -81,7 +84,7 @@ tilda_window_add_term (TildaWindow *tw) GtkWidget *label = gtk_label_new ("Tilda"); gint index = gtk_notebook_prepend_page (GTK_NOTEBOOK(tw->notebook), tt->hbox, label); gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK(tw->notebook), tt->hbox, TRUE, TRUE, GTK_PACK_END); - //gtk_notebook_set_current_page (GTK_NOTEBOOK(tw->notebook), index); + gtk_notebook_set_current_page (GTK_NOTEBOOK(tw->notebook), index); if (gtk_notebook_get_n_pages (GTK_NOTEBOOK(tw->notebook)) > 1) gtk_notebook_set_show_tabs (GTK_NOTEBOOK(tw->notebook), TRUE); @@ -273,7 +276,7 @@ tilda_window_try_to_bind_key (TildaWindow *self, const gchar *new_key) /* Unbind if we were set */ if (self->key) - tomboy_keybinder_unbind (self->key, tilda_window_keybinding_cb, self); + tomboy_keybinder_unbind (self->key, tilda_window_keybinding_cb); ret = tomboy_keybinder_bind (new_key, tilda_window_keybinding_cb, self); diff --git a/tilda.c b/tilda.c index 7656551..f640eb1 100644 --- a/tilda.c +++ b/tilda.c @@ -4,6 +4,7 @@ #include "tilda.h" #include "tilda-window.h" #include "tilda-terminal.h" +#include "tomboykeybinder.h" DBusGConnection *dbus_connection; GPtrArray *windows; @@ -16,7 +17,7 @@ tilda_initialize_dbus () static const gchar service_name[] = "net.sourceforge.Tilda"; GError *error = NULL; DBusGProxy *driver_proxy; - int request_ret; + guint request_ret; // Initialize the DBus connection dbus_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); diff --git a/tilda.h b/tilda.h index 3262d8c..324d745 100644 --- a/tilda.h +++ b/tilda.h @@ -6,8 +6,8 @@ /* Optional debugging macros */ #ifdef DEBUG - #define debug_enter() do { g_printf ("debug enter: %s\n", __func__); } while (0) - #define debug_printf(args...) do { g_printf ("debug: " args); } while (0) + #define debug_enter() do { g_print ("debug enter: %s\n", __func__); } while (0) + #define debug_printf(args...) do { g_print ("debug: " args); } while (0) #define debug_assert(args...) do { g_assert (args); } while (0) #else #define debug_enter() do { /* nothing */ } while (0) -- 2.34.1