gnome-power-manager r3157 - in trunk: . src



Author: rhughes
Date: Thu Jan 15 11:44:44 2009
New Revision: 3157
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=3157&view=rev

Log:
2009-01-15  Richard Hughes  <richard hughsie com>

* configure.ac:
* src/Makefile.am:
* src/egg-array-float.c: (egg_array_float_compute_gaussian),
(egg_array_float_convolve), (egg_array_float_compute_integral):
* src/egg-array-float.h:
* src/egg-color.c:
* src/egg-console-kit.c:
* src/egg-dbus-monitor.c:
* src/egg-dbus-proxy.c:
* src/egg-debug.h:
* src/egg-obj-list.c: (egg_obj_list_remove_index),
(egg_obj_list_index):
* src/egg-precision.c:
* src/egg-precision.h:
* src/egg-test.c: (egg_test_elapsed), (egg_test_get_data_file):
* src/egg-test.h:
* src/egg-unique.c: (egg_unique_message_cb):
* src/gpm-brightness-hal.c: (gpm_brightness_hal_set_hw),
(gpm_brightness_hal_dim_hw_step), (gpm_brightness_hal_down):
* src/gpm-brightness-kbd.c: (gpm_brightness_kbd_set_hw),
(gpm_brightness_kbd_dim_hw_step), (gpm_brightness_kbd_down):
* src/gpm-brightness-xrandr.c:
(gpm_brightness_xrandr_output_set_internal),
(gpm_brightness_xrandr_output_set),
(gpm_brightness_xrandr_foreach_resource),
(gpm_brightness_xrandr_update_cache):
* src/gpm-button.c:
* src/gpm-control.c:
* src/gpm-dpms.c:
* src/gpm-engine.c: (phone_device_added_cb),
(phone_device_removed_cb), (phone_device_refresh_cb):
* src/gpm-feedback-widget.c:
* src/gpm-graph-widget.c: (gpm_get_axis_label),
(gpm_graph_widget_get_y_label_max_width),
(gpm_graph_widget_draw_legend),
(gpm_graph_widget_legend_calculate_size):
* src/gpm-inhibit.c: (gpm_inhibit_get_requests),
(gpm_inhibit_remove_dbus), (gpm_inhibit_get_message):
* src/gpm-light-sensor.c: (gpm_light_sensor_get_hw):
* src/gpm-load.c:
* src/gpm-manager.c: (gpm_manager_get_time_until_action_text):
* src/gpm-phone.c: (gpm_phone_get_present),
(gpm_phone_get_percentage), (gpm_phone_get_on_ac),
(gpm_phone_battery_state_changed), (phone_device_refresh_cb):
* src/gpm-prefs-core.c:
* src/gpm-refcount.c:
* src/gpm-screensaver.c:
* src/gpm-screensaver.h:
* src/gpm-statistics.c: (gpm_stats_set_title),
(gpm_stats_devices_treeview_clicked_cb), (main):
* src/gpm-tray-icon.c: (gpm_tray_icon_activate_cb):
Enable way more compiler warnings, and fix up all the failures.


Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/src/Makefile.am
   trunk/src/egg-array-float.c
   trunk/src/egg-array-float.h
   trunk/src/egg-color.c
   trunk/src/egg-console-kit.c
   trunk/src/egg-dbus-monitor.c
   trunk/src/egg-dbus-proxy.c
   trunk/src/egg-debug.h
   trunk/src/egg-obj-list.c
   trunk/src/egg-precision.c
   trunk/src/egg-precision.h
   trunk/src/egg-test.c
   trunk/src/egg-test.h
   trunk/src/egg-unique.c
   trunk/src/gpm-brightness-hal.c
   trunk/src/gpm-brightness-kbd.c
   trunk/src/gpm-brightness-xrandr.c
   trunk/src/gpm-button.c
   trunk/src/gpm-control.c
   trunk/src/gpm-dpms.c
   trunk/src/gpm-engine.c
   trunk/src/gpm-feedback-widget.c
   trunk/src/gpm-graph-widget.c
   trunk/src/gpm-inhibit.c
   trunk/src/gpm-light-sensor.c
   trunk/src/gpm-load.c
   trunk/src/gpm-manager.c
   trunk/src/gpm-phone.c
   trunk/src/gpm-prefs-core.c
   trunk/src/gpm-refcount.c
   trunk/src/gpm-screensaver.c
   trunk/src/gpm-screensaver.h
   trunk/src/gpm-statistics.c
   trunk/src/gpm-tray-icon.c

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Thu Jan 15 11:44:44 2009
@@ -21,10 +21,45 @@
 dnl ---------------------------------------------------------------------------
 dnl - Extra verbose warning switches
 dnl ---------------------------------------------------------------------------
+#CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES"
+CPPFLAGS="$CPPFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED"
+#CPPFLAGS="$CPPFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
+
 if test "$GCC" = "yes"; then
-    CPPFLAGS="$CPPFLAGS -Werror -Wcast-align -Wno-uninitialized"
-    CPPFLAGS="$CPPFLAGS -Wall -Wformat-security"
+	WARNINGFLAGS="$WARNINGFLAGS -Wall"
+	WARNINGFLAGS="$WARNINGFLAGS -Werror"
+	WARNINGFLAGS="$WARNINGFLAGS -Wcast-align -Wno-uninitialized"
+	WARNINGFLAGS="$WARNINGFLAGS -Wmissing-declarations"
+	WARNINGFLAGS="$WARNINGFLAGS -Wredundant-decls"
+	WARNINGFLAGS="$WARNINGFLAGS -Wmissing-noreturn"
+	WARNINGFLAGS="$WARNINGFLAGS -Wpointer-arith"
+	WARNINGFLAGS="$WARNINGFLAGS -Wcast-align"
+	WARNINGFLAGS="$WARNINGFLAGS -Wwrite-strings"
+	WARNINGFLAGS="$WARNINGFLAGS -Winit-self"
+	WARNINGFLAGS="$WARNINGFLAGS -Wreturn-type"
+	WARNINGFLAGS="$WARNINGFLAGS -Wformat-nonliteral"
+	WARNINGFLAGS="$WARNINGFLAGS -Wformat-security"
+	WARNINGFLAGS="$WARNINGFLAGS -Wmissing-include-dirs"
+	WARNINGFLAGS="$WARNINGFLAGS -Wmissing-format-attribute"
+	WARNINGFLAGS="$WARNINGFLAGS -Wclobbered"
+	WARNINGFLAGS="$WARNINGFLAGS -Wempty-body"
+	WARNINGFLAGS="$WARNINGFLAGS -Wignored-qualifiers"
+	WARNINGFLAGS="$WARNINGFLAGS -Wsign-compare"
+	WARNINGFLAGS="$WARNINGFLAGS -Wtype-limits"
+	WARNINGFLAGS="$WARNINGFLAGS -Wuninitialized"
+	WARNINGFLAGS="$WARNINGFLAGS -Waggregate-return"
+	WARNINGFLAGS="$WARNINGFLAGS -Wdeclaration-after-statement"
+	WARNINGFLAGS="$WARNINGFLAGS -Wshadow"
+	WARNINGFLAGS="$WARNINGFLAGS -Winline"
+#	WARNINGFLAGS="$WARNINGFLAGS -Wswitch-enum"
+	WARNINGFLAGS="$WARNINGFLAGS -Wmissing-parameter-type"
+	WARNINGFLAGS="$WARNINGFLAGS -Woverride-init"
+else
+	WARNINGFLAGS=""
+	WARNINGFLAGS=""
 fi
+AC_SUBST(WARNINGFLAGS)
+AC_SUBST(WARNINGFLAGS)
 
 dnl ---------------------------------------------------------------------------
 dnl - Debugging switches (uncomment this if you want to use gdb)
@@ -39,13 +74,6 @@
 #LDFLAGS="$LDFLAGS -pg"
 
 dnl ---------------------------------------------------------------------------
-dnl - Code checks
-dnl ---------------------------------------------------------------------------
-#CPPFLAGS="$CPPFLAGS -DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES"
-CPPFLAGS="$CPPFLAGS -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
-CPPFLAGS="$CPPFLAGS -DG_DISABLE_DEPRECATED"
-
-dnl ---------------------------------------------------------------------------
 dnl - gettext stuff
 dnl ---------------------------------------------------------------------------
 GETTEXT_PACKAGE=AC_PACKAGE_NAME

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Thu Jan 15 11:44:44 2009
@@ -98,6 +98,10 @@
 	$(NULL)
 endif
 
+gnome_power_statistics_CFLAGS =				\
+	$(WARNINGFLAGS)					\
+	$(NULL)
+
 endif
 
 gnome_power_preferences_SOURCES =			\
@@ -137,6 +141,10 @@
 	$(LOCAL_LIBHAL_LIBS)				\
 	$(NULL)
 
+gnome_power_preferences_CFLAGS =			\
+	$(WARNINGFLAGS)					\
+	$(NULL)
+
 if HAVE_UNIQUE
 gnome_power_preferences_LDADD +=			\
 	$(UNIQUE_LIBS)
@@ -254,6 +262,10 @@
 	$(DEVKIT_POWER_LIBS)
 endif
 
+gnome_power_manager_CFLAGS =				\
+	$(WARNINGFLAGS)					\
+	$(NULL)
+
 gnome_power_self_test_SOURCES =				\
 	egg-color.h					\
 	egg-color.c					\

Modified: trunk/src/egg-array-float.c
==============================================================================
--- trunk/src/egg-array-float.c	(original)
+++ trunk/src/egg-array-float.c	Thu Jan 15 11:44:44 2009
@@ -137,23 +137,23 @@
 egg_array_float_compute_gaussian (guint length, gfloat sigma)
 {
 	EggArrayFloat *array;
-	gint half_length;
+	guint half_length;
 	guint i;
-	gfloat div;
+	gfloat division;
 
 	array = egg_array_float_new (length);
 
 	/* array positions 0..10, has to be an odd number */
 	half_length = (length / 2) + 1;
 	for (i=0; i<half_length; i++) {
-		div = half_length - (i + 1);
-		g_array_index (array, gfloat, i) = egg_array_float_guassian_value (div, sigma);
+		division = half_length - (i + 1);
+		g_array_index (array, gfloat, i) = egg_array_float_guassian_value (division, sigma);
 	}
 
 	/* no point working these out, we can just reflect the gaussian */
 	for (i=half_length; i<length; i++) {
-		div = g_array_index (array, gfloat, length-(i+1));
-		g_array_index (array, gfloat, i) = div;
+		division = g_array_index (array, gfloat, length-(i+1));
+		g_array_index (array, gfloat, i) = division;
 	}
 	return array;
 }
@@ -217,7 +217,7 @@
 	gfloat value;
 	gint i;
 	gint j;
-	gint index;
+	gint idx;
 
 	length_data = data->len;
 	length_kernel = kernel->len;
@@ -228,12 +228,12 @@
 	for (i=0;i<length_data;i++) {
 		value = 0;
 		for (j=0;j<length_kernel;j++) {
-			index = i+j-(length_kernel/2);
-			if (index < 0)
-				index = 0;
-			else if (index >= length_data)
-				index = length_data - 1;
-			value += g_array_index (data, gfloat, index) * g_array_index (kernel, gfloat, j);
+			idx = i+j-(length_kernel/2);
+			if (idx < 0)
+				idx = 0;
+			else if (idx >= length_data)
+				idx = length_data - 1;
+			value += g_array_index (data, gfloat, idx) * g_array_index (kernel, gfloat, j);
 		}
 		g_array_index (result, gfloat, i) = value;
 	}
@@ -251,7 +251,7 @@
 egg_array_float_compute_integral (EggArrayFloat *array, guint x1, guint x2)
 {
 	gfloat value;
-	gint i;
+	guint i;
 
 	g_return_val_if_fail (x2 >= x1, 0.0);
 

Modified: trunk/src/egg-array-float.h
==============================================================================
--- trunk/src/egg-array-float.h	(original)
+++ trunk/src/egg-array-float.h	Thu Jan 15 11:44:44 2009
@@ -41,9 +41,9 @@
 gboolean	 egg_array_float_print			(EggArrayFloat	*array);
 EggArrayFloat	*egg_array_float_convolve		(EggArrayFloat	*data,
 							 EggArrayFloat	*kernel);
-inline gfloat	 egg_array_float_get			(EggArrayFloat	*array,
+gfloat	 egg_array_float_get				(EggArrayFloat	*array,
 							 guint		 i);
-inline void	 egg_array_float_set			(EggArrayFloat	*array,
+void	 egg_array_float_set				(EggArrayFloat	*array,
 							 guint		 i,
 							 gfloat		 value);
 

Modified: trunk/src/egg-color.c
==============================================================================
--- trunk/src/egg-color.c	(original)
+++ trunk/src/egg-color.c	Thu Jan 15 11:44:44 2009
@@ -20,6 +20,7 @@
  */
 
 #include <glib.h>
+#include "egg-color.h"
 
 /**
  * egg_color_from_rgb:

Modified: trunk/src/egg-console-kit.c
==============================================================================
--- trunk/src/egg-console-kit.c	(original)
+++ trunk/src/egg-console-kit.c	Thu Jan 15 11:44:44 2009
@@ -31,8 +31,6 @@
 #include "egg-debug.h"
 #include "egg-console-kit.h"
 
-static void     egg_console_kit_class_init	(EggConsoleKitClass	*klass);
-static void     egg_console_kit_init		(EggConsoleKit		*console_kit);
 static void     egg_console_kit_finalize	(GObject		*object);
 
 #define EGG_CONSOLE_KIT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EGG_TYPE_CONSOLE_KIT, EggConsoleKitPrivate))

Modified: trunk/src/egg-dbus-monitor.c
==============================================================================
--- trunk/src/egg-dbus-monitor.c	(original)
+++ trunk/src/egg-dbus-monitor.c	Thu Jan 15 11:44:44 2009
@@ -32,8 +32,6 @@
 #include "egg-debug.h"
 #include "egg-dbus-monitor.h"
 
-static void     egg_dbus_monitor_class_init	(EggDbusMonitorClass	*klass);
-static void     egg_dbus_monitor_init		(EggDbusMonitor		*dbus_monitor);
 static void     egg_dbus_monitor_finalize	(GObject		*object);
 
 #define EGG_DBUS_MONITOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EGG_TYPE_DBUS_MONITOR, EggDbusMonitorPrivate))

Modified: trunk/src/egg-dbus-proxy.c
==============================================================================
--- trunk/src/egg-dbus-proxy.c	(original)
+++ trunk/src/egg-dbus-proxy.c	Thu Jan 15 11:44:44 2009
@@ -30,8 +30,6 @@
 #include "egg-dbus-monitor.h"
 #include "egg-dbus-proxy.h"
 
-static void     egg_dbus_proxy_class_init (EggDbusProxyClass *klass);
-static void     egg_dbus_proxy_init       (EggDbusProxy      *proxy);
 static void     egg_dbus_proxy_finalize   (GObject        *object);
 
 #define EGG_DBUS_PROXY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EGG_TYPE_DBUS_PROXY, EggDbusProxyPrivate))

Modified: trunk/src/egg-debug.h
==============================================================================
--- trunk/src/egg-debug.h	(original)
+++ trunk/src/egg-debug.h	Thu Jan 15 11:44:44 2009
@@ -76,7 +76,7 @@
 void		egg_error_real			(const gchar	*func,
 						 const gchar	*file,
 						 int		 line,
-						 const gchar	*format, ...) __attribute__((format (printf,4,5)));
+						 const gchar	*format, ...) G_GNUC_NORETURN __attribute__((format (printf,4,5)));
 
 G_END_DECLS
 

Modified: trunk/src/egg-obj-list.c
==============================================================================
--- trunk/src/egg-obj-list.c	(original)
+++ trunk/src/egg-obj-list.c	Thu Jan 15 11:44:44 2009
@@ -403,14 +403,14 @@
 /**
  * egg_obj_list_remove_index:
  * @list: a valid #EggObjList instance
- * @index: the number to remove
+ * @idx: the number to remove
  *
  * Return value: TRUE is we removed something
  *
  * Removes an item from a list
  **/
 gboolean
-egg_obj_list_remove_index (EggObjList *list, guint index)
+egg_obj_list_remove_index (EggObjList *list, guint idx)
 {
 	gpointer obj;
 
@@ -418,7 +418,7 @@
 	g_return_val_if_fail (list->priv->func_free != NULL, FALSE);
 
 	/* get the object */
-	obj = g_ptr_array_remove_index (list->priv->array, index);
+	obj = g_ptr_array_remove_index (list->priv->array, idx);
 	if (obj == NULL)
 		return FALSE;
 	list->priv->func_free (obj);
@@ -555,18 +555,18 @@
 /**
  * egg_obj_list_index:
  * @list: a valid #EggObjList instance
- * @index: the element to return
+ * @idx: the element to return
  *
  * Gets an object from the list
  **/
 gconstpointer
-egg_obj_list_index (const EggObjList *list, guint index)
+egg_obj_list_index (const EggObjList *list, guint idx)
 {
 	gconstpointer obj;
 
 	g_return_val_if_fail (EGG_IS_OBJ_LIST (list), NULL);
 
-	obj = g_ptr_array_index (list->priv->array, index);
+	obj = g_ptr_array_index (list->priv->array, idx);
 	return obj;
 }
 

Modified: trunk/src/egg-precision.c
==============================================================================
--- trunk/src/egg-precision.c	(original)
+++ trunk/src/egg-precision.c	Thu Jan 15 11:44:44 2009
@@ -23,7 +23,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <glib.h>
+
 #include "egg-debug.h"
+#include "egg-precision.h"
 
 /**
  * egg_precision_round_up:

Modified: trunk/src/egg-precision.h
==============================================================================
--- trunk/src/egg-precision.h	(original)
+++ trunk/src/egg-precision.h	Thu Jan 15 11:44:44 2009
@@ -26,9 +26,9 @@
 
 G_BEGIN_DECLS
 
-guint		 egg_precision_round_up			(gfloat		 value,
+gint		 egg_precision_round_up			(gfloat		 value,
 							 gint		 smallest);
-guint		 egg_precision_round_down		(gfloat		 value,
+gint		 egg_precision_round_down		(gfloat		 value,
 							 gint		 smallest);
 
 G_END_DECLS

Modified: trunk/src/egg-test.c
==============================================================================
--- trunk/src/egg-test.c	(original)
+++ trunk/src/egg-test.c	Thu Jan 15 11:44:44 2009
@@ -158,9 +158,9 @@
 guint
 egg_test_elapsed (EggTest *test)
 {
-	gdouble time;
-	time = g_timer_elapsed (test->timer, NULL);
-	return (guint) (time * 1000.0f);
+	gdouble time_s;
+	time_s = g_timer_elapsed (test->timer, NULL);
+	return (guint) (time_s * 1000.0f);
 }
 
 /**
@@ -320,17 +320,23 @@
 	/* check to see if we are being run in the build root */
 	full = g_build_filename ("..", "data", "tests", filename, NULL);
 	ret = g_file_test (full, G_FILE_TEST_EXISTS);
-	if (ret) {
+	if (ret)
 		return full;
-	}
 	g_free (full);
 
-	/* check to see if we are being run in make check */
+	/* check to see if we are being run in the build root */
 	full = g_build_filename ("..", "..", "data", "tests", filename, NULL);
 	ret = g_file_test (full, G_FILE_TEST_EXISTS);
-	if (ret) {
+	if (ret)
 		return full;
-	}
+	g_free (full);
+
+	/* check to see if we are being run in make check */
+	full = g_build_filename ("..", "..", "..", "data", "tests", filename, NULL);
+	ret = g_file_test (full, G_FILE_TEST_EXISTS);
+	if (ret)
+		return full;
+	g_print ("[WARN] failed to find '%s'\n", full);
 	g_free (full);
 	return NULL;
 }

Modified: trunk/src/egg-test.h
==============================================================================
--- trunk/src/egg-test.h	(original)
+++ trunk/src/egg-test.h	Thu Jan 15 11:44:44 2009
@@ -33,7 +33,7 @@
 void		 egg_test_title_assert		(EggTest *test, const gchar *text, gboolean value);
 void		 egg_test_assert		(EggTest *test, gboolean value);
 void		 egg_test_success		(EggTest *test, const gchar *format, ...);
-void		 egg_test_failed		(EggTest *test, const gchar *format, ...);
+void		 egg_test_failed		(EggTest *test, const gchar *format, ...) G_GNUC_NORETURN;
 EggTest		*egg_test_init			(void);
 gint		 egg_test_finish		(EggTest *test);
 guint		 egg_test_elapsed		(EggTest *test);

Modified: trunk/src/egg-unique.c
==============================================================================
--- trunk/src/egg-unique.c	(original)
+++ trunk/src/egg-unique.c	Thu Jan 15 11:44:44 2009
@@ -31,8 +31,6 @@
 #include "egg-unique.h"
 #include "egg-debug.h"
 
-static void     egg_unique_class_init (EggUniqueClass *klass);
-static void     egg_unique_init       (EggUnique      *unique);
 static void     egg_unique_finalize   (GObject        *object);
 
 #define EGG_UNIQUE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EGG_UNIQUE_TYPE, EggUniquePrivate))
@@ -60,8 +58,7 @@
  * egg_unique_message_cb:
  **/
 static void
-egg_unique_message_cb (UniqueApp *app, UniqueCommand command, UniqueMessageData *message_data,
-		      guint time, EggUnique *egg_unique)
+egg_unique_message_cb (UniqueApp *app, UniqueCommand command, UniqueMessageData *message_data, guint time_s, EggUnique *egg_unique)
 {
 	g_return_if_fail (EGG_IS_UNIQUE (egg_unique));
 	if (command == UNIQUE_ACTIVATE)

Modified: trunk/src/gpm-brightness-hal.c
==============================================================================
--- trunk/src/gpm-brightness-hal.c	(original)
+++ trunk/src/gpm-brightness-hal.c	Thu Jan 15 11:44:44 2009
@@ -146,8 +146,7 @@
 		return FALSE;
 	}
 
-	if (value_hw < 0 ||
-	    value_hw > brightness->priv->levels - 1) {
+	if (value_hw > brightness->priv->levels - 1) {
 		egg_warning ("set outside range (%i of %i)",
 			     value_hw, brightness->priv->levels - 1);
 		return FALSE;
@@ -207,7 +206,7 @@
 
 	if (new_level_hw > last_set_hw) {
 		/* going up */
-		for (a=last_set_hw; a <= new_level_hw; a+=step_interval) {
+		for (a=last_set_hw; a <= (gint) new_level_hw; a+=step_interval) {
 			ret = gpm_brightness_hal_set_hw (brightness, a);
 			/* we failed the last brightness set command, don't keep trying */
 			if (!ret) {
@@ -373,7 +372,7 @@
 		/* macbook pro has a bazzillion brightness levels, be a bit clever */
 		step = gpm_brightness_get_step (brightness->priv->levels);
 		/* don't underflow */
-		if (brightness->priv->last_set_hw < step) {
+		if ((gint) brightness->priv->last_set_hw < step) {
 			step = brightness->priv->last_set_hw;
 		}
 		ret = gpm_brightness_hal_set_hw (brightness, brightness->priv->last_set_hw - step);

Modified: trunk/src/gpm-brightness-kbd.c
==============================================================================
--- trunk/src/gpm-brightness-kbd.c	(original)
+++ trunk/src/gpm-brightness-kbd.c	Thu Jan 15 11:44:44 2009
@@ -135,8 +135,7 @@
  * Return value: Success.
  **/
 static gboolean
-gpm_brightness_kbd_set_hw (GpmBrightnessKbd *brightness,
-			   guint	     brightness_level_hw)
+gpm_brightness_kbd_set_hw (GpmBrightnessKbd *brightness, guint brightness_level_hw)
 {
 	GError *error = NULL;
 	gboolean ret;
@@ -151,8 +150,7 @@
 		return FALSE;
 	}
 
-	if (brightness_level_hw < 0 ||
-	    brightness_level_hw > brightness->priv->levels - 1) {
+	if (brightness_level_hw > brightness->priv->levels - 1) {
 		egg_warning ("set outside range (%i of %i)",
 			     brightness_level_hw, brightness->priv->levels - 1);
 		return FALSE;
@@ -185,9 +183,7 @@
  * Just do the step up and down, after knowing the step interval
  **/
 static gboolean
-gpm_brightness_kbd_dim_hw_step (GpmBrightnessKbd *brightness,
-				guint             new_level_hw,
-				guint		  step_interval)
+gpm_brightness_kbd_dim_hw_step (GpmBrightnessKbd *brightness, guint new_level_hw, guint step_interval)
 {
 	guint current_hw;
 	gint a;
@@ -199,13 +195,12 @@
 	egg_debug ("new_level_hw=%i, current_hw=%i", new_level_hw, current_hw);
 
 	/* we do the step interval as we can have insane levels of brightness_kbd */
-	if (new_level_hw == current_hw) {
+	if (new_level_hw == current_hw)
 		return FALSE;
-	}
 
 	if (new_level_hw > current_hw) {
 		/* going up */
-		for (a=current_hw; a <= new_level_hw; a+=step_interval) {
+		for (a=current_hw; a <= (gint) new_level_hw; a+=step_interval) {
 			gpm_brightness_kbd_set_hw (brightness, a);
 			g_usleep (1000 * DIM_INTERVAL);
 		}
@@ -490,9 +485,8 @@
 		/* macbook pro has a bazzillion brightness_kbd levels, be a bit clever */
 		step = gpm_brightness_kbd_get_step (brightness);
 		/* don't underflow */
-		if (brightness->priv->current_hw < step) {
+		if ((gint) brightness->priv->current_hw < step)
 			step = brightness->priv->current_hw;
-		}
 		gpm_brightness_kbd_set_hw (brightness, brightness->priv->current_hw - step);
 	}
 

Modified: trunk/src/gpm-brightness-xrandr.c
==============================================================================
--- trunk/src/gpm-brightness-xrandr.c	(original)
+++ trunk/src/gpm-brightness-xrandr.c	Thu Jan 15 11:44:44 2009
@@ -119,7 +119,6 @@
 	gboolean ret = TRUE;
 
 	g_return_val_if_fail (GPM_IS_BRIGHTNESS_XRANDR (brightness), FALSE);
-	g_return_val_if_fail (value >= 0, FALSE);
 
 	/* don't abort on error */
 	gdk_error_trap_push ();
@@ -316,17 +315,17 @@
 	egg_debug ("percent=%i, absolute=%i", brightness->priv->shared_value, shared_value_abs);
 
 	egg_debug ("hard value=%i, min=%i, max=%i", cur, min, max);
-	if (shared_value_abs > max)
+	if (shared_value_abs > (gint) max)
 		shared_value_abs = max;
-	if (shared_value_abs < min)
+	if (shared_value_abs < (gint) min)
 		shared_value_abs = min;
-	if (cur == shared_value_abs) {
+	if ((gint) cur == shared_value_abs) {
 		egg_debug ("already set %i", cur);
 		return TRUE;
 	}
 
 	/* step the correct way */
-	if (cur < shared_value_abs) {
+	if ((gint) cur < shared_value_abs) {
 
 		/* some adaptors have a large number of steps */
 		step = gpm_brightness_get_step (shared_value_abs - cur);
@@ -337,7 +336,7 @@
 			ret = gpm_brightness_xrandr_output_set_internal (brightness, output, i);
 			if (!ret)
 				break;
-			if (cur != shared_value_abs)
+			if ((gint) cur != shared_value_abs)
 				g_usleep (1000 * GPM_BRIGHTNESS_DIM_INTERVAL);
 		}
 	} else {
@@ -351,7 +350,7 @@
 			ret = gpm_brightness_xrandr_output_set_internal (brightness, output, i);
 			if (!ret)
 				break;
-			if (cur != shared_value_abs)
+			if ((gint) cur != shared_value_abs)
 				g_usleep (1000 * GPM_BRIGHTNESS_DIM_INTERVAL);
 		}
 	}
@@ -364,16 +363,17 @@
 static gboolean
 gpm_brightness_xrandr_foreach_resource (GpmBrightnessXRandR *brightness, GpmXRandROp op, XRRScreenResources *resources)
 {
-	guint i;
+	gint i;
 	gboolean ret;
 	gboolean success_any = FALSE;
+	RROutput output;
 
 	g_return_val_if_fail (GPM_IS_BRIGHTNESS_XRANDR (brightness), FALSE);
 
 	/* do for each output */
 	for (i=0; i<resources->noutput; i++) {
+		output = resources->outputs[i];
 		egg_debug ("resource %i of %i", i+1, resources->noutput);
-		RROutput output = resources->outputs[i];
 		if (op==ACTION_BACKLIGHT_GET) {
 			ret = gpm_brightness_xrandr_output_get_percentage (brightness, output);
 		} else if (op==ACTION_BACKLIGHT_INC) {
@@ -598,14 +598,14 @@
 	/* do for each screen */
 	display = gdk_display_get_default ();
 	length = ScreenCount (brightness->priv->dpy);
-	for (screen = 0; screen < length; screen++) {
+	for (screen = 0; screen < (gint) length; screen++) {
 		egg_debug ("screen %i of %i", screen+1, length);
 		gscreen = gdk_display_get_screen (display, screen);
 
 		/* if we have not setup the changed on the monitor, set it here */
 		if (g_object_get_data (G_OBJECT (gscreen), "gpk-set-monitors-changed") == NULL) {
 			egg_debug ("watching ::monitors_changed on %p", gscreen);
-			g_object_set_data (G_OBJECT (gscreen), "gpk-set-monitors-changed", "true");
+			g_object_set_data (G_OBJECT (gscreen), "gpk-set-monitors-changed", (gpointer) "true");
 			g_signal_connect (G_OBJECT (gscreen), "monitors_changed",
 					  G_CALLBACK (gpm_brightness_monitors_changed), brightness);
 		}

Modified: trunk/src/gpm-button.c
==============================================================================
--- trunk/src/gpm-button.c	(original)
+++ trunk/src/gpm-button.c	Thu Jan 15 11:44:44 2009
@@ -39,8 +39,6 @@
 #include "egg-debug.h"
 #include "gpm-marshal.h"
 
-static void     gpm_button_class_init (GpmButtonClass *klass);
-static void     gpm_button_init       (GpmButton      *button);
 static void     gpm_button_finalize   (GObject	      *object);
 
 #define GPM_BUTTON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_BUTTON, GpmButtonPrivate))
@@ -72,7 +70,7 @@
 /**
  * gpm_button_emit_type:
  **/
-gboolean
+static gboolean
 gpm_button_emit_type (GpmButton *button, const gchar *type)
 {
 	g_return_val_if_fail (GPM_IS_BUTTON (button), FALSE);

Modified: trunk/src/gpm-control.c
==============================================================================
--- trunk/src/gpm-control.c	(original)
+++ trunk/src/gpm-control.c	Thu Jan 15 11:44:44 2009
@@ -104,7 +104,7 @@
  * @polkit: This polkit class instance
  * Return value: Success value.
  **/
-gboolean
+static gboolean
 gpm_control_is_user_privileged (GpmControl *control, const gchar *privilege)
 {
 	gboolean ret = TRUE;

Modified: trunk/src/gpm-dpms.c
==============================================================================
--- trunk/src/gpm-dpms.c	(original)
+++ trunk/src/gpm-dpms.c	Thu Jan 15 11:44:44 2009
@@ -46,8 +46,6 @@
 #include "egg-debug.h"
 #include "gpm-dpms.h"
 
-static void     gpm_dpms_class_init (GpmDpmsClass *klass);
-static void     gpm_dpms_init       (GpmDpms      *dpms);
 static void     gpm_dpms_finalize   (GObject      *object);
 
 #define GPM_DPMS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_DPMS, GpmDpmsPrivate))

Modified: trunk/src/gpm-engine.c
==============================================================================
--- trunk/src/gpm-engine.c	(original)
+++ trunk/src/gpm-engine.c	Thu Jan 15 11:44:44 2009
@@ -38,8 +38,6 @@
 #include "gpm-prefs-server.h"
 #include "gpm-phone.h"
 
-static void     gpm_engine_class_init (GpmEngineClass *klass);
-static void     gpm_engine_init       (GpmEngine      *engine);
 static void     gpm_engine_finalize   (GObject	  *object);
 
 #define GPM_ENGINE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_ENGINE, GpmEnginePrivate))
@@ -695,16 +693,16 @@
  * phone_device_added_cb:
  **/
 static void
-phone_device_added_cb (GpmPhone *phone, guint index, GpmEngine *engine)
+phone_device_added_cb (GpmPhone *phone, guint idx, GpmEngine *engine)
 {
 	DkpObject *obj;
 	DkpDevice *device;
 	device = dkp_device_new ();
 
-	egg_debug ("phone added %i", index);
+	egg_debug ("phone added %i", idx);
 	
 	obj = (DkpObject *) dkp_device_get_object (device);
-	obj->native_path = g_strdup_printf ("phone_%i", index);
+	obj->native_path = g_strdup_printf ("phone_%i", idx);
 	obj->is_rechargeable = TRUE;
 	obj->type = DKP_DEVICE_TYPE_PHONE;
 
@@ -718,13 +716,13 @@
  * phone_device_removed_cb:
  **/
 static void
-phone_device_removed_cb (GpmPhone *phone, guint index, GpmEngine *engine)
+phone_device_removed_cb (GpmPhone *phone, guint idx, GpmEngine *engine)
 {
 	guint i;
 	DkpDevice *device;
 	const DkpObject *obj;
 
-	egg_debug ("phone removed %i", index);
+	egg_debug ("phone removed %i", idx);
 
 	for (i=0; i<engine->priv->array->len; i++) {
 		device = g_ptr_array_index (engine->priv->array, i);
@@ -744,21 +742,21 @@
  * phone_device_refresh_cb:
  **/
 static void
-phone_device_refresh_cb (GpmPhone *phone, guint index, GpmEngine *engine)
+phone_device_refresh_cb (GpmPhone *phone, guint idx, GpmEngine *engine)
 {
 	guint i;
 	DkpDevice *device;
 	DkpObject *obj;
 
-	egg_debug ("phone refresh %i", index);
+	egg_debug ("phone refresh %i", idx);
 
 	for (i=0; i<engine->priv->array->len; i++) {
 		device = g_ptr_array_index (engine->priv->array, i);
 		obj = (DkpObject *) dkp_device_get_object (device);
 		if (obj->type == DKP_DEVICE_TYPE_PHONE) {
-			obj->is_present = gpm_phone_get_present (phone, index);
-			obj->state = gpm_phone_get_on_ac (phone, index) ? DKP_DEVICE_STATE_CHARGING : DKP_DEVICE_STATE_DISCHARGING;
-			obj->percentage = gpm_phone_get_percentage (phone, index);
+			obj->is_present = gpm_phone_get_present (phone, idx);
+			obj->state = gpm_phone_get_on_ac (phone, idx) ? DKP_DEVICE_STATE_CHARGING : DKP_DEVICE_STATE_DISCHARGING;
+			obj->percentage = gpm_phone_get_percentage (phone, idx);
 			break;
 		}
 	}

Modified: trunk/src/gpm-feedback-widget.c
==============================================================================
--- trunk/src/gpm-feedback-widget.c	(original)
+++ trunk/src/gpm-feedback-widget.c	Thu Jan 15 11:44:44 2009
@@ -32,8 +32,6 @@
 #include "gpm-refcount.h"
 #include "egg-debug.h"
 
-static void     gpm_feedback_class_init (GpmFeedbackClass *klass);
-static void     gpm_feedback_init       (GpmFeedback      *feedback);
 static void     gpm_feedback_finalize   (GObject	  *object);
 static void	gpm_feedback_show	(GtkWidget 	  *widget);
 

Modified: trunk/src/gpm-graph-widget.c
==============================================================================
--- trunk/src/gpm-graph-widget.c	(original)
+++ trunk/src/gpm-graph-widget.c	Thu Jan 15 11:44:44 2009
@@ -73,7 +73,7 @@
 /**
  * gpm_graph_widget_key_data_clear:
  **/
-gboolean
+static gboolean
 gpm_graph_widget_key_data_clear (GpmGraphWidget *graph)
 {
 	GpmGraphWidgetKeyData *keyitem;
@@ -284,9 +284,9 @@
 {
 	gchar *text = NULL;
 	if (axis == GPM_GRAPH_WIDGET_TYPE_TIME) {
-		gint time = abs((gint) value);
-		gint minutes = time / 60;
-		gint seconds = time - (minutes * 60);
+		gint time_s = abs((gint) value);
+		gint minutes = time_s / 60;
+		gint seconds = time_s - (minutes * 60);
 		gint hours = minutes / 60;
 		gint days = hours / 24;
 		minutes = minutes - (hours * 60);
@@ -474,7 +474,7 @@
 		text = gpm_get_axis_label (graph->priv->axis_type_y, value);
 		pango_layout_set_text (graph->priv->layout, text, -1);
 		pango_layout_get_pixel_extents (graph->priv->layout, &ink_rect, &logical_rect);
-		if (ink_rect.width > biggest)
+		if (ink_rect.width > (gint) biggest)
 			biggest = ink_rect.width;
 		g_free (text);
 	}
@@ -806,7 +806,7 @@
 {
 	cairo_t *cr = graph->priv->cr;
 	gint y_count;
-	gint a;
+	guint a;
 	GpmGraphWidgetKeyData *keydataitem;
 
 	gpm_graph_widget_draw_bounding_box (cr, x, y, width, height);
@@ -859,7 +859,7 @@
 		*height = *height + GPM_GRAPH_WIDGET_LEGEND_SPACING;
 		pango_layout_set_text (graph->priv->layout, keydataitem->desc, -1);
 		pango_layout_get_pixel_extents (graph->priv->layout, &ink_rect, &logical_rect);
-		if (*width < ink_rect.width)
+		if ((gint) *width < ink_rect.width)
 			*width = ink_rect.width;
 	}
 

Modified: trunk/src/gpm-inhibit.c
==============================================================================
--- trunk/src/gpm-inhibit.c	(original)
+++ trunk/src/gpm-inhibit.c	Thu Jan 15 11:44:44 2009
@@ -32,8 +32,6 @@
 #include "gpm-common.h"
 #include "gpm-inhibit.h"
 
-static void     gpm_inhibit_class_init (GpmInhibitClass *klass);
-static void     gpm_inhibit_init       (GpmInhibit      *inhibit);
 static void     gpm_inhibit_finalize   (GObject		*object);
 
 #define GPM_INHIBIT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_INHIBIT, GpmInhibitPrivate))
@@ -246,9 +244,7 @@
  * Gets a list of inhibits.
  **/
 gboolean
-gpm_inhibit_get_requests (GpmInhibit *inhibit,
-			  gchar	   ***requests,
-			  GError    **error)
+gpm_inhibit_get_requests (GpmInhibit *inhibit, gchar ***requests, GError **error)
 {
 	egg_warning ("Not implimented");
 	return FALSE;
@@ -264,10 +260,9 @@
  * unregister it.
  **/
 static void
-gpm_inhibit_remove_dbus (GpmInhibit  *inhibit,
-			 const gchar *connection)
+gpm_inhibit_remove_dbus (GpmInhibit  *inhibit, const gchar *connection)
 {
-	int a;
+	guint a;
 	GpmInhibitData *data;
 	/* Remove *any* connections that match the connection */
 	for (a=0; a<g_slist_length (inhibit->priv->list); a++) {
@@ -345,11 +340,13 @@
 {
 	guint a;
 	GpmInhibitData *data;
+	gchar *boldstr;
+	gchar *italicstr;
 
 	if (g_slist_length (inhibit->priv->list) == 1) {
 		data = (GpmInhibitData *) g_slist_nth_data (inhibit->priv->list, 0);
-		gchar *boldstr = g_strdup_printf ("<b>%s</b>", data->application);
-		gchar *italicstr = g_strdup_printf ("<b>%s</b>", data->reason);
+		boldstr = g_strdup_printf ("<b>%s</b>", data->application);
+		italicstr = g_strdup_printf ("<b>%s</b>", data->reason);
 		
 		if (strcmp (action, "suspend") == 0) {
 			/*Translators: first %s is an application name, second %s is the reason*/

Modified: trunk/src/gpm-light-sensor.c
==============================================================================
--- trunk/src/gpm-light-sensor.c	(original)
+++ trunk/src/gpm-light-sensor.c	Thu Jan 15 11:44:44 2009
@@ -84,12 +84,12 @@
 static gboolean
 gpm_light_sensor_get_hw (GpmLightSensor *sensor)
 {
-	guint	    sensor_level_hw;
-	GError     *error = NULL;
-	gboolean    ret;
+	guint sensor_level_hw;
+	GError *error = NULL;
+	gboolean ret;
 	DBusGProxy *proxy;
-	GArray     *levels;
-	int         i;
+	GArray *levels;
+	gint i;
 
 	g_return_val_if_fail (sensor != NULL, FALSE);
 	g_return_val_if_fail (GPM_IS_LIGHT_SENSOR (sensor), FALSE);
@@ -116,9 +116,8 @@
 
 	/* work out average */
 	sensor_level_hw = 0;
-	for (i = 0; i < levels->len; i++) {
+	for (i = 0; i < (gint) levels->len; i++)
 		sensor_level_hw += g_array_index (levels, gint, i);
-	}
 	sensor_level_hw /= levels->len;
 
 	/* save */

Modified: trunk/src/gpm-load.c
==============================================================================
--- trunk/src/gpm-load.c	(original)
+++ trunk/src/gpm-load.c	Thu Jan 15 11:44:44 2009
@@ -46,8 +46,6 @@
 
 #include "gpm-load.h"
 
-static void     gpm_load_class_init (GpmLoadClass *klass);
-static void     gpm_load_init       (GpmLoad      *load);
 static void     gpm_load_finalize   (GObject	  *object);
 
 #define GPM_LOAD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_LOAD, GpmLoadPrivate))

Modified: trunk/src/gpm-manager.c
==============================================================================
--- trunk/src/gpm-manager.c	(original)
+++ trunk/src/gpm-manager.c	Thu Jan 15 11:44:44 2009
@@ -79,8 +79,6 @@
 #include "org.freedesktop.PowerManagement.Inhibit.h"
 #include "org.freedesktop.PowerManagement.Backlight.h"
 
-static void     gpm_manager_class_init	(GpmManagerClass *klass);
-static void     gpm_manager_init	(GpmManager      *manager);
 static void     gpm_manager_finalize	(GObject	 *object);
 
 #define GPM_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_MANAGER, GpmManagerPrivate))
@@ -1396,18 +1394,18 @@
 static gchar *
 gpm_manager_get_time_until_action_text (GpmManager *manager)
 {
-	guint time = 0;
+	guint time_s = 0;
 #ifndef HAVE_DK_POWER
 	GpmEngineCollection *collection;
 
 	collection = gpm_engine_get_collection (manager->priv->engine);
 
 	/* we should tell the user how much time they have */
-	time = gpm_cell_array_get_time_until_action (collection->primary);
-	if (time == 0)
+	time_s = gpm_cell_array_get_time_until_action (collection->primary);
+	if (time_s == 0)
 		return g_strdup (_("a short time"));
 #endif
-	return gpm_get_timestring (time);
+	return gpm_get_timestring (time_s);
 }
 
 /**

Modified: trunk/src/gpm-phone.c
==============================================================================
--- trunk/src/gpm-phone.c	(original)
+++ trunk/src/gpm-phone.c	Thu Jan 15 11:44:44 2009
@@ -33,8 +33,6 @@
 
 #include "egg-dbus-monitor.h"
 
-static void     gpm_phone_class_init (GpmPhoneClass *klass);
-static void     gpm_phone_init       (GpmPhone      *phone);
 static void     gpm_phone_finalize   (GObject	    *object);
 
 #define GPM_PHONE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_PHONE, GpmPhonePrivate))
@@ -94,7 +92,7 @@
  * Return value: if present
  **/
 gboolean
-gpm_phone_get_present (GpmPhone	*phone, guint index)
+gpm_phone_get_present (GpmPhone	*phone, guint idx)
 {
 	g_return_val_if_fail (phone != NULL, FALSE);
 	g_return_val_if_fail (GPM_IS_PHONE (phone), FALSE);
@@ -106,7 +104,7 @@
  * Return value: if present
  **/
 guint
-gpm_phone_get_percentage (GpmPhone *phone, guint index)
+gpm_phone_get_percentage (GpmPhone *phone, guint idx)
 {
 	g_return_val_if_fail (phone != NULL, 0);
 	g_return_val_if_fail (GPM_IS_PHONE (phone), 0);
@@ -118,7 +116,7 @@
  * Return value: if present
  **/
 gboolean
-gpm_phone_get_on_ac (GpmPhone *phone, guint index)
+gpm_phone_get_on_ac (GpmPhone *phone, guint idx)
 {
 	g_return_val_if_fail (phone != NULL, FALSE);
 	g_return_val_if_fail (GPM_IS_PHONE (phone), FALSE);
@@ -143,17 +141,17 @@
 /** Invoked when we get the BatteryStateChanged
  */
 static void
-gpm_phone_battery_state_changed (DBusGProxy *proxy, guint index, guint percentage, gboolean on_ac, GpmPhone *phone)
+gpm_phone_battery_state_changed (DBusGProxy *proxy, guint idx, guint percentage, gboolean on_ac, GpmPhone *phone)
 {
 	g_return_if_fail (phone != NULL);
 	g_return_if_fail (GPM_IS_PHONE (phone));
 
-	egg_debug ("got BatteryStateChanged %i = %i (%i)", index, percentage, on_ac);
+	egg_debug ("got BatteryStateChanged %i = %i (%i)", idx, percentage, on_ac);
 	phone->priv->percentage = percentage;
 	phone->priv->onac = on_ac;
 	phone->priv->present = TRUE;
-	egg_debug ("emitting device-refresh : (%i)", index);
-	g_signal_emit (phone, signals [DEVICE_REFRESH], 0, index);
+	egg_debug ("emitting device-refresh : (%i)", idx);
+	g_signal_emit (phone, signals [DEVICE_REFRESH], 0, idx);
 }
 
 /** Invoked when we get NumberBatteriesChanged
@@ -232,7 +230,7 @@
 /**
  * gpm_phone_dbus_connect:
  **/
-gboolean
+static gboolean
 gpm_phone_dbus_connect (GpmPhone *phone)
 {
 	GError *error = NULL;
@@ -292,7 +290,7 @@
 /**
  * gpm_phone_dbus_disconnect:
  **/
-gboolean
+static gboolean
 gpm_phone_dbus_disconnect (GpmPhone *phone)
 {
 	g_return_val_if_fail (phone != NULL, FALSE);
@@ -408,12 +406,10 @@
 }
 
 static void
-phone_device_refresh_cb (GpmPhone     *phone,
-		         guint         index,
-		         gpointer     *data)
+phone_device_refresh_cb (GpmPhone *phone, guint idx, gpointer *data)
 {
-	g_debug ("index refresh = %i", index);
-	if (index == 0 && GPOINTER_TO_UINT (data) == 44)
+	g_debug ("idx refresh = %i", idx);
+	if (idx == 0 && GPOINTER_TO_UINT (data) == 44)
 		test_got_refresh = TRUE;
 }
 

Modified: trunk/src/gpm-prefs-core.c
==============================================================================
--- trunk/src/gpm-prefs-core.c	(original)
+++ trunk/src/gpm-prefs-core.c	Thu Jan 15 11:44:44 2009
@@ -48,8 +48,6 @@
 #include <polkit-gnome/polkit-gnome.h>
 #endif
 
-static void     gpm_prefs_class_init (GpmPrefsClass *klass);
-static void     gpm_prefs_init       (GpmPrefs      *prefs);
 static void     gpm_prefs_finalize   (GObject	    *object);
 
 #define GPM_PREFS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_PREFS, GpmPrefsPrivate))

Modified: trunk/src/gpm-refcount.c
==============================================================================
--- trunk/src/gpm-refcount.c	(original)
+++ trunk/src/gpm-refcount.c	Thu Jan 15 11:44:44 2009
@@ -28,8 +28,6 @@
 #include "gpm-refcount.h"
 #include "egg-debug.h"
 
-static void     gpm_refcount_class_init (GpmRefcountClass *klass);
-static void     gpm_refcount_init       (GpmRefcount      *refcount);
 static void     gpm_refcount_finalize   (GObject	  *object);
 
 #define GPM_REFCOUNT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_REFCOUNT, GpmRefcountPrivate))

Modified: trunk/src/gpm-screensaver.c
==============================================================================
--- trunk/src/gpm-screensaver.c	(original)
+++ trunk/src/gpm-screensaver.c	Thu Jan 15 11:44:44 2009
@@ -32,8 +32,6 @@
 #include "egg-debug.h"
 #include "egg-dbus-proxy.h"
 
-static void     gpm_screensaver_class_init (GpmScreensaverClass *klass);
-static void     gpm_screensaver_init       (GpmScreensaver      *screensaver);
 static void     gpm_screensaver_finalize   (GObject		*object);
 
 #define GPM_SCREENSAVER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_SCREENSAVER, GpmScreensaverPrivate))

Modified: trunk/src/gpm-screensaver.h
==============================================================================
--- trunk/src/gpm-screensaver.h	(original)
+++ trunk/src/gpm-screensaver.h	Thu Jan 15 11:44:44 2009
@@ -68,7 +68,6 @@
 gboolean	 gpm_screensaver_lock_enabled		(GpmScreensaver	*screensaver);
 gboolean	 gpm_screensaver_lock_set		(GpmScreensaver	*screensaver,
 							 gboolean	 lock);
-gboolean	 gpm_screensaver_lock_enabled		(GpmScreensaver	*screensaver);
 guint32 	 gpm_screensaver_add_throttle    	(GpmScreensaver	*screensaver,
 							 const gchar	*reason);
 gboolean 	 gpm_screensaver_remove_throttle    	(GpmScreensaver	*screensaver,

Modified: trunk/src/gpm-statistics.c
==============================================================================
--- trunk/src/gpm-statistics.c	(original)
+++ trunk/src/gpm-statistics.c	Thu Jan 15 11:44:44 2009
@@ -588,19 +588,15 @@
 static void
 gpm_stats_set_title (GtkWindow *window, gint page_num)
 {
+	gchar *title;
 	const gchar * const page_titles[] = {
 		N_("Device Information"),
 		N_("Device History"),
 		N_("Device Profile")
 	};
-	gchar *title;
-
-	g_assert (page_num < G_N_ELEMENTS (page_titles));
 
 	title = g_strdup_printf ("%s - %s", _("Power Statistics"), _(page_titles[page_num]));
-
 	gtk_window_set_title (window, title);
-
 	g_free (title);
 }
 
@@ -665,6 +661,7 @@
 {
 	GtkTreeModel *model;
 	GtkTreeIter iter;
+	DkpDevice *device;
 
 	/* This will only work in single or browse selection mode! */
 	if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
@@ -677,7 +674,6 @@
 		/* show transaction_id */
 		egg_debug ("selected row is: %s", current_device);
 
-		DkpDevice *device;
 		device = dkp_device_new ();
 		dkp_device_set_object_path (device, current_device);
 		gpm_stats_update_info_data (device);
@@ -995,6 +991,7 @@
 	gint page;
 	const gchar *object_path;
 	gboolean checked;
+	gchar *last_device;
 
 	const GOptionEntry options[] = {
 		{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
@@ -1204,7 +1201,6 @@
 		}
 	}
 
-	gchar *last_device;
 	last_device = gconf_client_get_string (gconf_client, GPM_CONF_INFO_LAST_DEVICE, NULL);
 
 	/* set the correct focus on the last device */

Modified: trunk/src/gpm-tray-icon.c
==============================================================================
--- trunk/src/gpm-tray-icon.c	(original)
+++ trunk/src/gpm-tray-icon.c	Thu Jan 15 11:44:44 2009
@@ -60,8 +60,6 @@
 #include "gpm-stock-icons.h"
 #include "gpm-tray-icon.h"
 
-static void     gpm_tray_icon_class_init (GpmTrayIconClass *klass);
-static void     gpm_tray_icon_init       (GpmTrayIcon      *tray_icon);
 static void     gpm_tray_icon_finalize   (GObject	   *object);
 
 #define GPM_TRAY_ICON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_TRAY_ICON, GpmTrayIconPrivate))
@@ -628,7 +626,9 @@
 	GtkWidget *item;
 	GtkWidget *image;
 	guint dev_cnt = 0;
-
+#ifdef HAVE_DK_POWER
+	const GPtrArray *array;
+#endif
 	egg_debug ("icon left clicked");
 
 	/* add all device types to the drop down menu */
@@ -640,7 +640,6 @@
 	dev_cnt += gpm_tray_icon_add_device (icon, menu, icon->priv->collection->keyboard);
 	dev_cnt += gpm_tray_icon_add_device (icon, menu, icon->priv->collection->pda);
 #else
-	const GPtrArray *array;
 	array = gpm_engine_get_devices (icon->priv->engine);
 	dev_cnt += gpm_tray_icon_add_device (icon, menu, array, DKP_DEVICE_TYPE_BATTERY);
 	dev_cnt += gpm_tray_icon_add_device (icon, menu, array, DKP_DEVICE_TYPE_UPS);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]