diff options
author | Tom Gilbert <gilbertt@tomgilbert.freeserve.co.uk> | 2000-01-28 03:16:36 +0000 |
---|---|---|
committer | Tom Gilbert <tgil@src.gnome.org> | 2000-01-28 03:16:36 +0000 |
commit | d8261a2bd2307ee476f8d73ce7961bdc32eeb6c2 (patch) | |
tree | 174d277282becc2fc9bfb9b8cb51c7fe6d454908 /battery | |
parent | 92a8c78f8790acfdbe74a8c3a1ea83cb2b5770cd (diff) |
On an anti-warning hunt using CFLAGS="-O6 -g -W -Wall -Wmissing-prototypes
Sat Jan 29 00:42:13 2000 Tom Gilbert <gilbertt@tomgilbert.freeserve.co.uk>
* On an anti-warning hunt using CFLAGS="-O6 -g -W -Wall
-Wmissing-prototypes -Wmissing-declarations". Don't mind me.
There's a Changelog entry like this in a few applets now. I started a
warning hunt. I am an anal retentive when it comes to warnings. Sorry =)
I will get to them all in time, this is just all I have so far...
I am rooting out little warnings, so important ones stand out. I highly
recommend that anyone about to commit their code to cvs first tries
compiling using:
CFLAGS="-O6 -g -W -Wall -Wmissing-prototypes -Wmissing-declarations" ./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --enable-static --enable-shared --enable-maintainer-mode
Or something similar. Don't let any creep through if you can avoid it.
I am not fixing unused variable warnings. That's for the applet maintainer
to decide. They may be placeholders for future features, etc. Even so, try
to remove these yourselves, if you can.
If I break anything, or am too anal, let me know ;)
Tom.
Diffstat (limited to 'battery')
-rw-r--r-- | battery/battery.c | 18 | ||||
-rw-r--r-- | battery/properties.c | 13 | ||||
-rw-r--r-- | battery/session.c | 2 |
3 files changed, 31 insertions, 2 deletions
diff --git a/battery/battery.c b/battery/battery.c index f5d41192b..5aeaaa838 100644 --- a/battery/battery.c +++ b/battery/battery.c @@ -496,6 +496,8 @@ battery_expose_handler (GtkWidget * widget, GdkEventExpose * expose, } return FALSE; + widget = NULL; + expose = NULL; } /* battery_expose_handler */ /* This handler gets called whenever the panel changes orientations. @@ -508,6 +510,8 @@ battery_orient_handler (GtkWidget * w, PanelOrientType o, gpointer data) /* FIXME: What do we do here? */ return FALSE; + w = NULL; + o = (PanelOrientType) 0; } /* battery_orient_handler */ gint @@ -524,6 +528,8 @@ battery_configure_handler (GtkWidget *widget, GdkEventConfigure *event, battery_update ( (gpointer) bat); return TRUE; + widget = NULL; + event = NULL; } /* battery_configure_handler */ /* Whenever the mode changes, and when the applet first starts up, @@ -614,13 +620,17 @@ battery_button_press_handler (GtkWidget * w, GdkEventButton * ev, battery_change_mode (bat); return TRUE; + w = NULL; + ev = NULL; } /* battery_button_press_handler */ GtkWidget * applet_start_new_applet (const gchar *goad_id, const char **params, int nparams) { - return make_new_battery_applet (goad_id); + return make_new_battery_applet (goad_id); + params = NULL; + nparams = 0; } /* applet_start_new_applet */ /* This is the function that actually creates the display widgets */ @@ -649,7 +659,7 @@ make_new_battery_applet (const gchar *goad_id) "Make sure that your kernel was " "built with APM support.")); gnome_dialog_run (GNOME_DIALOG (d)); - applet_widget_remove (bat->applet); + applet_widget_remove (APPLET_WIDGET(bat->applet)); gtk_exit (1); } @@ -835,6 +845,8 @@ void destroy_about (GtkWidget *w, gpointer data) { BatteryData *bat = data; + return; + w = NULL; } /* destroy_about */ void @@ -858,6 +870,8 @@ about_cb (AppletWidget *widget, gpointer data) GTK_SIGNAL_FUNC (destroy_about), bat); gtk_widget_show (bat->about_box); + return; + widget = NULL; } /* about_cb */ void diff --git a/battery/properties.c b/battery/properties.c index c9d02215f..e503d40e6 100644 --- a/battery/properties.c +++ b/battery/properties.c @@ -350,6 +350,8 @@ battery_properties_window (AppletWidget * applet, gpointer data) gtk_widget_show_all (GTK_WIDGET (bat->prop_win)); + return; + applet = NULL; } /* battery_properties_window */ @@ -364,6 +366,7 @@ prop_cancel (GtkWidget * w, gpointer data) BatteryData * bat = data; return FALSE; + w = NULL; } /* prop_cancel */ static void @@ -490,6 +493,9 @@ prop_apply (GtkWidget *w, int page, gpointer data) /* Make the panel save our config */ applet_widget_sync_config (APPLET_WIDGET (bat->applet)); + return; + w = NULL; + page = 0; } /* prop_apply */ /* @@ -505,6 +511,8 @@ adj_value_changed_cb ( GtkAdjustment * ignored, gpointer data ) BatteryData * bat = data; gnome_property_box_changed (GNOME_PROPERTY_BOX (bat->prop_win)); + return; + ignored = NULL; } /* value_changed_cb */ void @@ -513,6 +521,8 @@ toggle_value_changed_cb ( GtkToggleButton * ignored, gpointer data ) BatteryData * bat = data; gnome_property_box_changed (GNOME_PROPERTY_BOX (bat->prop_win)); + return; + ignored = NULL; } /* value_changed_cb */ void @@ -522,5 +532,8 @@ col_value_changed_cb ( GtkObject * ignored, guint arg1, guint arg2, BatteryData * bat = data; gnome_property_box_changed (GNOME_PROPERTY_BOX (bat->prop_win)); + return; + arg1 = arg2 = arg3 = arg4 = 0; + ignored = NULL; } /* value_changed_cb */ diff --git a/battery/session.c b/battery/session.c index 9bc8bc48d..826b22650 100644 --- a/battery/session.c +++ b/battery/session.c @@ -164,6 +164,8 @@ battery_session_save(GtkWidget * w, gnome_config_drop_all (); return FALSE; + w = NULL; + globcfgpath = NULL; } /* battery_session_save */ void |