hal/hald device.c,1.9,1.10 property.c,1.7,1.8

Joe Shaw joe at freedesktop.org
Thu Sep 2 14:45:51 PDT 2004


Update of /cvs/hal/hal/hald
In directory gabe:/tmp/cvs-serv12998/hald

Modified Files:
	device.c property.c 
Log Message:
2004-09-02  Joe Shaw  <joeshaw at novell.com>

	* hald/device.c (hal_device_property_get_bool): Aiee!  If the
	property is not found, we want to return FALSE instead of -1.

	* hald/property.c (hal_property_get_bool): Return FALSE if the
	type isn't boolean in the assertion, not -1.

	* hald/linux/common.c (rename_and_merge): Fix some broken logic
	which only worked because it was depending on -1 being returned
	from boolean functions.  If I understand its original intent
	correctly, it should still work.  (Of course, info.not_available
	is never set to TRUE programmatically, so unless it's set in FDI
	files it never actually comes up)

Index: device.c
===================================================================
RCS file: /cvs/hal/hal/hald/device.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- device.c	1 Sep 2004 17:38:58 -0000	1.9
+++ device.c	2 Sep 2004 21:45:49 -0000	1.10
@@ -609,7 +609,7 @@
 	if (prop != NULL)
 		return hal_property_get_bool (prop);
 	else
-		return -1;
+		return FALSE;
 }
 
 double

Index: property.c
===================================================================
RCS file: /cvs/hal/hal/hald/property.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- property.c	1 Sep 2004 17:38:58 -0000	1.7
+++ property.c	2 Sep 2004 21:45:49 -0000	1.8
@@ -190,7 +190,7 @@
 hal_property_get_bool (HalProperty *prop)
 {
 	g_return_val_if_fail (prop != NULL, FALSE);
-	g_return_val_if_fail (prop->type == DBUS_TYPE_BOOLEAN, -1);
+	g_return_val_if_fail (prop->type == DBUS_TYPE_BOOLEAN, FALSE);
 
 	return prop->bool_value;
 }




More information about the hal-commit mailing list