gnome-power-manager r2677 - in trunk: . libhal-glib src



Author: rhughes
Date: Tue Feb 19 01:13:42 2008
New Revision: 2677
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=2677&view=rev

Log:
2008-02-19  Richard Hughes  <richard hughsie com>

* libhal-glib/libhal-gdevice.c: (hal_gdevice_get_udi):
* libhal-glib/libhal-gdevicestore.c: (hal_gdevicestore_find_udi):
* src/gpm-array.c: (gpm_array_get), (gpm_array_copy),
(gpm_array_copy_append), (gpm_array_interpolate):
* src/gpm-brightness-kbd.c: (gpm_brightness_kbd_get_step):
* src/gpm-brightness-lcd.c: (gpm_brightness_lcd_get_step):
* src/gpm-cell-array.c: (gpm_cell_array_get_cell),
(gpm_cell_array_get_description):
* src/gpm-screensaver.c: (gpm_screensaver_add_throttle):
Fix some return types.


Modified:
   trunk/ChangeLog
   trunk/libhal-glib/libhal-gdevice.c
   trunk/libhal-glib/libhal-gdevicestore.c
   trunk/src/gpm-array.c
   trunk/src/gpm-brightness-kbd.c
   trunk/src/gpm-brightness-lcd.c
   trunk/src/gpm-cell-array.c
   trunk/src/gpm-screensaver.c

Modified: trunk/libhal-glib/libhal-gdevice.c
==============================================================================
--- trunk/libhal-glib/libhal-gdevice.c	(original)
+++ trunk/libhal-glib/libhal-gdevice.c	Tue Feb 19 01:13:42 2008
@@ -111,7 +111,7 @@
 const gchar *
 hal_gdevice_get_udi (HalGDevice *device)
 {
-	g_return_val_if_fail (LIBHAL_IS_GDEVICE (device), FALSE);
+	g_return_val_if_fail (LIBHAL_IS_GDEVICE (device), NULL);
 
 	return device->priv->udi;
 }

Modified: trunk/libhal-glib/libhal-gdevicestore.c
==============================================================================
--- trunk/libhal-glib/libhal-gdevicestore.c	(original)
+++ trunk/libhal-glib/libhal-gdevicestore.c	Tue Feb 19 01:13:42 2008
@@ -123,8 +123,8 @@
 {
 	gint index;
 
-	g_return_val_if_fail (LIBHAL_IS_GDEVICESTORE (devicestore), FALSE);
-	g_return_val_if_fail (udi != NULL, FALSE);
+	g_return_val_if_fail (LIBHAL_IS_GDEVICESTORE (devicestore), NULL);
+	g_return_val_if_fail (udi != NULL, NULL);
 
 	index = hal_gdevicestore_index_udi (devicestore, udi);
 	if (index == -1) {

Modified: trunk/src/gpm-array.c
==============================================================================
--- trunk/src/gpm-array.c	(original)
+++ trunk/src/gpm-array.c	Tue Feb 19 01:13:42 2008
@@ -65,7 +65,7 @@
 	GpmArrayPoint *point;
 	guint length;
 
-	g_return_val_if_fail (array != NULL, FALSE);
+	g_return_val_if_fail (array != NULL, NULL);
 
 	length = array->priv->array->len;
 	if (i + 1 > length) {
@@ -441,10 +441,10 @@
 	guint lengthto;
 	guint lengthfrom;
 
-	g_return_val_if_fail (from != NULL, 0);
-	g_return_val_if_fail (GPM_IS_ARRAY (from), 0);
-	g_return_val_if_fail (to != NULL, 0);
-	g_return_val_if_fail (GPM_IS_ARRAY (to), 0);
+	g_return_val_if_fail (from != NULL, FALSE);
+	g_return_val_if_fail (GPM_IS_ARRAY (from), FALSE);
+	g_return_val_if_fail (to != NULL, FALSE);
+	g_return_val_if_fail (GPM_IS_ARRAY (to), FALSE);
 
 	lengthto = gpm_array_get_size (to);
 	lengthfrom = gpm_array_get_size (from);
@@ -476,10 +476,10 @@
 	gint i;
 	guint length;
 
-	g_return_val_if_fail (from != NULL, 0);
-	g_return_val_if_fail (GPM_IS_ARRAY (from), 0);
-	g_return_val_if_fail (to != NULL, 0);
-	g_return_val_if_fail (GPM_IS_ARRAY (to), 0);
+	g_return_val_if_fail (from != NULL, FALSE);
+	g_return_val_if_fail (GPM_IS_ARRAY (from), FALSE);
+	g_return_val_if_fail (to != NULL, FALSE);
+	g_return_val_if_fail (GPM_IS_ARRAY (to), FALSE);
 
 	length = gpm_array_get_size (from);
 	for (i=0; i < length; i++) {
@@ -554,8 +554,8 @@
 	guint i;
 	guint length;
 
-	g_return_val_if_fail (array != NULL, FALSE);
-	g_return_val_if_fail (GPM_IS_ARRAY (array), FALSE);
+	g_return_val_if_fail (array != NULL, 0);
+	g_return_val_if_fail (GPM_IS_ARRAY (array), 0);
 
 	/* we have to add a new data point */
 	length = gpm_array_get_size (array);

Modified: trunk/src/gpm-brightness-kbd.c
==============================================================================
--- trunk/src/gpm-brightness-kbd.c	(original)
+++ trunk/src/gpm-brightness-kbd.c	Tue Feb 19 01:13:42 2008
@@ -224,7 +224,7 @@
 {
 	int step;
 
-	g_return_val_if_fail (brightness != NULL, FALSE);
+	g_return_val_if_fail (brightness != NULL, 0);
 	g_return_val_if_fail (GPM_IS_BRIGHTNESS_KBD (brightness), 0);
 
 	if (brightness->priv->levels < 20) {

Modified: trunk/src/gpm-brightness-lcd.c
==============================================================================
--- trunk/src/gpm-brightness-lcd.c	(original)
+++ trunk/src/gpm-brightness-lcd.c	Tue Feb 19 01:13:42 2008
@@ -237,7 +237,7 @@
 {
 	int step;
 
-	g_return_val_if_fail (brightness != NULL, FALSE);
+	g_return_val_if_fail (brightness != NULL, 0);
 	g_return_val_if_fail (GPM_IS_BRIGHTNESS_LCD (brightness), 0);
 
 	if (brightness->priv->levels < 20) {

Modified: trunk/src/gpm-cell-array.c
==============================================================================
--- trunk/src/gpm-cell-array.c	(original)
+++ trunk/src/gpm-cell-array.c	Tue Feb 19 01:13:42 2008
@@ -154,12 +154,12 @@
 {
 	GpmCell *cell;
 
-	g_return_val_if_fail (cell_array != NULL, 0);
-	g_return_val_if_fail (GPM_IS_CELL_ARRAY (cell_array), 0);
+	g_return_val_if_fail (cell_array != NULL, NULL);
+	g_return_val_if_fail (GPM_IS_CELL_ARRAY (cell_array), NULL);
 
 	if (id > cell_array->priv->array->len) {
 		gpm_warning ("not valid cell id");
-		return FALSE;
+		return NULL;
 	}
 
 	cell = (GpmCell *) g_ptr_array_index (cell_array->priv->array, id);
@@ -925,8 +925,8 @@
 	GpmCellUnit *unit;
 	gboolean plural = FALSE;
 
-	g_return_val_if_fail (cell_array != NULL, 0);
-	g_return_val_if_fail (GPM_IS_CELL_ARRAY (cell_array), 0);
+	g_return_val_if_fail (cell_array != NULL, NULL);
+	g_return_val_if_fail (GPM_IS_CELL_ARRAY (cell_array), NULL);
 
 	unit = &(cell_array->priv->unit);
 

Modified: trunk/src/gpm-screensaver.c
==============================================================================
--- trunk/src/gpm-screensaver.c	(original)
+++ trunk/src/gpm-screensaver.c	Tue Feb 19 01:13:42 2008
@@ -284,19 +284,19 @@
 	guint32  cookie;
 	DBusGProxy *proxy;
 
-	g_return_val_if_fail (GPM_IS_SCREENSAVER (screensaver), FALSE);
+	g_return_val_if_fail (GPM_IS_SCREENSAVER (screensaver), 0);
 	g_return_val_if_fail (reason != NULL, 0);
 
 	proxy = dbus_proxy_get_proxy (screensaver->priv->gproxy);
 	if (proxy == NULL) {
 		gpm_warning ("not connected");
-		return FALSE;
+		return 0;
 	}
 
 	/* shouldn't be, but make sure proxy valid */
 	if (proxy == NULL) {
 		gpm_warning ("g-s proxy is NULL!");
-		return FALSE;
+		return 0;
 	}
 
 	ret = dbus_g_proxy_call (proxy, "Throttle", &error,



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