hal: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Fri Aug 31 11:46:10 PDT 2007


 doc/spec/hal-spec-properties.xml               |   17 ++++++++---------
 hald/hald_dbus.c                               |    8 ++++----
 hald/linux/addons/addon-dell-backlight.cpp     |    8 ++++----
 hald/linux/addons/addon-macbook-backlight.c    |    8 ++++----
 hald/linux/addons/addon-macbookpro-backlight.c |    8 ++++----
 hald/linux/addons/addon-omap-backlight.c       |    8 ++++----
 6 files changed, 28 insertions(+), 29 deletions(-)

New commits:
diff-tree c7f2d8ce617970c3636a61061b8954bdeffe716a (from c279d7c1f8b52b1b99767e7c7a03305b573f7c31)
Author: David Zeuthen <davidz at redhat.com>
Date:   Fri Aug 31 14:33:09 2007 -0400

    Revert "make return value for method calls implemented via programs be UINT32"
    
    This reverts commit 7b159b55d6398d2d240817276ae27ed68f11deda.

diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index 7fbee1a..1f96d06 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -524,15 +524,14 @@ CK_SESSION_UID_Session3=501
       
       <para>
         Note that method calls implemented via running a program are
-        limited to the return type being an unsigned 32-bit integer
-        (this will change in a future release so it's configurable per
-        method). The incoming parameters are limited to only basic
-        types and arrays of strings. The parameters are passed via
-        stdin using a textual representation. As such, there is a lot
-        of overhead with handling method calls by spawning programs
-        and as such it should only be used for situtations where the
-        nature of the method call is that it will not be frequently
-        used.
+        limited to the return type being an a signed 32-bit integer
+        (this will change in a future release). The incoming
+        parameters are limited to only basic types and arrays of
+        strings. The parameters are passed via stdin using a textual
+        representation. As such, there is a lot of overhead with
+        handling method calls by spawning programs and as such it
+        should only be used for situtations where the nature of the
+        method call is that it will not be frequently used.
       </para>
       
       <para>
diff --git a/hald/hald_dbus.c b/hald/hald_dbus.c
index ddae65c..091cc89 100644
--- a/hald/hald_dbus.c
+++ b/hald/hald_dbus.c
@@ -4003,7 +4003,7 @@ hald_exec_method_cb (HalDevice *d, guint
 		     gint return_code, gchar **error,
 		     gpointer data1, gpointer data2)
 {
-	dbus_uint32_t result;
+	dbus_int32_t result;
 	DBusMessage *reply = NULL;
 	DBusMessage *message;
 	DBusMessageIter iter;
@@ -4048,14 +4048,14 @@ hald_exec_method_cb (HalDevice *d, guint
 		dbus_message_unref (reply);
 
 	} else {
-		result = (dbus_uint32_t) return_code;
+		result = (dbus_int32_t) return_code;
 
 		reply = dbus_message_new_method_return (message);
 		if (reply == NULL)
 			DIE (("No memory"));
 		
 		dbus_message_iter_init_append (reply, &iter);
-		dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &result);
+		dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &result);
 		
 		if (conn != NULL) {
 			if (!dbus_connection_send (conn, reply, NULL))
@@ -4633,7 +4633,7 @@ do_introspect (DBusConnection  *connecti
 					}
 					xml = g_string_append (
 						xml, 
-						"      <arg name=\"return_code\" direction=\"out\" type=\"u\"/>\n");
+						"      <arg name=\"return_code\" direction=\"out\" type=\"i\"/>\n");
 					xml = g_string_append  (
 						xml, 
 						"    </method>\n");
diff --git a/hald/linux/addons/addon-dell-backlight.cpp b/hald/linux/addons/addon-dell-backlight.cpp
index c2e485c..d30a80e 100644
--- a/hald/linux/addons/addon-dell-backlight.cpp
+++ b/hald/linux/addons/addon-dell-backlight.cpp
@@ -217,7 +217,7 @@ filter_function (DBusConnection *connect
 				return_code = 0;
 
 				dbus_message_append_args (reply,
-							  DBUS_TYPE_UINT32, &return_code,
+							  DBUS_TYPE_INT32, &return_code,
 							  DBUS_TYPE_INVALID);
 			}
 
@@ -244,7 +244,7 @@ filter_function (DBusConnection *connect
 				goto error;
 
 			dbus_message_append_args (reply,
-						  DBUS_TYPE_UINT32, &brightness,
+						  DBUS_TYPE_INT32, &brightness,
 						  DBUS_TYPE_INVALID);
 			dbus_connection_send (connection, reply, NULL);
 		}
@@ -310,10 +310,10 @@ main (int argc, char *argv[])
 					    "org.freedesktop.Hal.Device.LaptopPanel", 
 					    "    <method name=\"SetBrightness\">\n"
 					    "      <arg name=\"brightness_value\" direction=\"in\" type=\"i\"/>\n"
-					    "      <arg name=\"return_code\" direction=\"out\" type=\"u\"/>\n"
+					    "      <arg name=\"return_code\" direction=\"out\" type=\"i\"/>\n"
 					    "    </method>\n"
 					    "    <method name=\"GetBrightness\">\n"
-					    "      <arg name=\"brightness_value\" direction=\"out\" type=\"u\"/>\n"
+					    "      <arg name=\"brightness_value\" direction=\"out\" type=\"i\"/>\n"
 					    "    </method>\n",
 					    &err)) {
 		HAL_ERROR (("Cannot claim interface 'org.freedesktop.Hal.Device.LaptopPanel'"));
diff --git a/hald/linux/addons/addon-macbook-backlight.c b/hald/linux/addons/addon-macbook-backlight.c
index 5a14fd8..50a57d7 100644
--- a/hald/linux/addons/addon-macbook-backlight.c
+++ b/hald/linux/addons/addon-macbook-backlight.c
@@ -241,10 +241,10 @@ out:
 #define INTERFACE_DESCRIPTION \
   "    <method name=\"SetBrightness\">\n" \
   "      <arg name=\"brightness_value\" direction=\"in\" type=\"i\"/>\n" \
-  "      <arg name=\"return_code\" direction=\"out\" type=\"u\"/>\n" \
+  "      <arg name=\"return_code\" direction=\"out\" type=\"i\"/>\n" \
   "    </method>\n" \
   "    <method name=\"GetBrightness\">\n" \
-  "      <arg name=\"brightness_value\" direction=\"out\" type=\"u\"/>\n" \
+  "      <arg name=\"brightness_value\" direction=\"out\" type=\"i\"/>\n" \
   "    </method>\n"
 
 static DBusHandlerResult
@@ -271,7 +271,7 @@ filter_function (DBusConnection * connec
 			backlight_set (level + 0x1f);
 
 			if ((reply = dbus_message_new_method_return (message)))
-				dbus_message_append_args (reply, DBUS_TYPE_UINT32,
+				dbus_message_append_args (reply, DBUS_TYPE_INT32,
 							  &ret, DBUS_TYPE_INVALID);
 		}
 	} else if (dbus_message_is_method_call (message, BACKLIGHT_IFACE, "GetBrightness")) {
@@ -280,7 +280,7 @@ filter_function (DBusConnection * connec
 			level = CLAMP (level, 0, 117);
 
 			if ((reply = dbus_message_new_method_return (message)))
-				dbus_message_append_args (reply, DBUS_TYPE_UINT32,
+				dbus_message_append_args (reply, DBUS_TYPE_INT32,
 							  &level, DBUS_TYPE_INVALID);
 		}
 	}
diff --git a/hald/linux/addons/addon-macbookpro-backlight.c b/hald/linux/addons/addon-macbookpro-backlight.c
index e6521e0..830f915 100644
--- a/hald/linux/addons/addon-macbookpro-backlight.c
+++ b/hald/linux/addons/addon-macbookpro-backlight.c
@@ -320,7 +320,7 @@ filter_function (DBusConnection *connect
 
 				return_code = 0;
 				dbus_message_append_args (reply,
-							  DBUS_TYPE_UINT32, &return_code,
+							  DBUS_TYPE_INT32, &return_code,
 							  DBUS_TYPE_INVALID);
 			}
 
@@ -353,7 +353,7 @@ filter_function (DBusConnection *connect
 				goto error;
 
 			dbus_message_append_args (reply,
-						  DBUS_TYPE_UINT32, &brightness,
+						  DBUS_TYPE_INT32, &brightness,
 						  DBUS_TYPE_INVALID);
 			dbus_connection_send (connection, reply, NULL);
 		}
@@ -560,10 +560,10 @@ main (int argc, char *argv[])
 					    "org.freedesktop.Hal.Device.LaptopPanel", 
 					    "    <method name=\"SetBrightness\">\n"
 					    "      <arg name=\"brightness_value\" direction=\"in\" type=\"i\"/>\n"
-					    "      <arg name=\"return_code\" direction=\"out\" type=\"u\"/>\n"
+					    "      <arg name=\"return_code\" direction=\"out\" type=\"i\"/>\n"
 					    "    </method>\n"
 					    "    <method name=\"GetBrightness\">\n"
-					    "      <arg name=\"brightness_value\" direction=\"out\" type=\"u\"/>\n"
+					    "      <arg name=\"brightness_value\" direction=\"out\" type=\"i\"/>\n"
 					    "    </method>\n",
 					    &err)) {
 		HAL_ERROR (("Cannot claim interface 'org.freedesktop.Hal.Device.LaptopPanel'"));
diff --git a/hald/linux/addons/addon-omap-backlight.c b/hald/linux/addons/addon-omap-backlight.c
index 95c1113..97cf7a2 100644
--- a/hald/linux/addons/addon-omap-backlight.c
+++ b/hald/linux/addons/addon-omap-backlight.c
@@ -222,7 +222,7 @@ filter_function (DBusConnection *connect
 
 				return_code = 0;
 				dbus_message_append_args (reply,
-							  DBUS_TYPE_UINT32, &return_code,
+							  DBUS_TYPE_INT32, &return_code,
 							  DBUS_TYPE_INVALID);
 			}
 
@@ -252,7 +252,7 @@ filter_function (DBusConnection *connect
 				goto error;
 
 			dbus_message_append_args (reply,
-						  DBUS_TYPE_UINT32, &brightness,
+						  DBUS_TYPE_INT32, &brightness,
 						  DBUS_TYPE_INVALID);
 			dbus_connection_send (connection, reply, NULL);
 		}
@@ -308,10 +308,10 @@ main (int argc, char *argv[])
 					    "org.freedesktop.Hal.Device.LaptopPanel", 
 					    "    <method name=\"SetBrightness\">\n"
 					    "      <arg name=\"brightness_value\" direction=\"in\" type=\"i\"/>\n"
-					    "      <arg name=\"return_code\" direction=\"out\" type=\"u\"/>\n"
+					    "      <arg name=\"return_code\" direction=\"out\" type=\"i\"/>\n"
 					    "    </method>\n"
 					    "    <method name=\"GetBrightness\">\n"
-					    "      <arg name=\"brightness_value\" direction=\"out\" type=\"u\"/>\n"
+					    "      <arg name=\"brightness_value\" direction=\"out\" type=\"i\"/>\n"
 					    "    </method>\n",
 					    &err)) {
 		HAL_ERROR (("Cannot claim interface 'org.freedesktop.Hal.Device.LaptopPanel'"));


More information about the hal-commit mailing list