Warning Fixes
authorIra W. Snyder <devel@irasnyder.com>
Sat, 19 Jan 2008 04:28:27 +0000 (20:28 -0800)
committerIra W. Snyder <devel@irasnyder.com>
Sat, 19 Jan 2008 04:28:27 +0000 (20:28 -0800)
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
tilda-window.c
tilda.c
tilda.h

index e3c574a..f781474 100644 (file)
--- 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
index 85fa02b..c5ac71a 100644 (file)
@@ -1,6 +1,9 @@
+#include <string.h>
+
 #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 (file)
--- 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 (file)
--- 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)