hal: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Wed Jun 6 11:25:40 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, 29 insertions(+), 28 deletions(-)

New commits:
diff-tree 7b159b55d6398d2d240817276ae27ed68f11deda (from 3734b53bafd98672db52ce55678f80136a5af84c)
Author: David Zeuthen <davidz at redhat.com>
Date:   Wed Jun 6 14:25:43 2007 -0400

    make return value for method calls implemented via programs be UINT32
    
    See the thread here
    
     http://lists.freedesktop.org/archives/hal/2007-May/008485.html
    
    for details.

diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index 65d4bde..2e3fcef 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -451,14 +451,15 @@ CK_SESSION_UID_Session3=501
       
       <para>
         Note that method calls implemented via running a program are
-        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.
+        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.
       </para>
       
       <para>
diff --git a/hald/hald_dbus.c b/hald/hald_dbus.c
index 395acca..e6377d7 100644
--- a/hald/hald_dbus.c
+++ b/hald/hald_dbus.c
@@ -3675,7 +3675,7 @@ hald_exec_method_cb (HalDevice *d, guint
 		     gint return_code, gchar **error,
 		     gpointer data1, gpointer data2)
 {
-	dbus_int32_t result;
+	dbus_uint32_t result;
 	DBusMessage *reply = NULL;
 	DBusMessage *message;
 	DBusMessageIter iter;
@@ -3720,14 +3720,14 @@ hald_exec_method_cb (HalDevice *d, guint
 		dbus_message_unref (reply);
 
 	} else {
-		result = (dbus_int32_t) return_code;
+		result = (dbus_uint32_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_INT32, &result);
+		dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &result);
 		
 		if (conn != NULL) {
 			if (!dbus_connection_send (conn, reply, NULL))
@@ -4303,7 +4303,7 @@ do_introspect (DBusConnection  *connecti
 					}
 					xml = g_string_append (
 						xml, 
-						"      <arg name=\"return_code\" direction=\"out\" type=\"i\"/>\n");
+						"      <arg name=\"return_code\" direction=\"out\" type=\"u\"/>\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 371e682..3459c0d 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_INT32, &return_code,
+							  DBUS_TYPE_UINT32, &return_code,
 							  DBUS_TYPE_INVALID);
 			}
 
@@ -244,7 +244,7 @@ filter_function (DBusConnection *connect
 				goto error;
 
 			dbus_message_append_args (reply,
-						  DBUS_TYPE_INT32, &brightness,
+						  DBUS_TYPE_UINT32, &brightness,
 						  DBUS_TYPE_INVALID);
 			dbus_connection_send (connection, reply, NULL);
 		}
@@ -305,10 +305,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=\"i\"/>\n"
+					    "      <arg name=\"return_code\" direction=\"out\" type=\"u\"/>\n"
 					    "    </method>\n"
 					    "    <method name=\"GetBrightness\">\n"
-					    "      <arg name=\"brightness_value\" direction=\"out\" type=\"i\"/>\n"
+					    "      <arg name=\"brightness_value\" direction=\"out\" type=\"u\"/>\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 e0f4230..7cf8174 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=\"i\"/>\n" \
+  "      <arg name=\"return_code\" direction=\"out\" type=\"u\"/>\n" \
   "    </method>\n" \
   "    <method name=\"GetBrightness\">\n" \
-  "      <arg name=\"brightness_value\" direction=\"out\" type=\"i\"/>\n" \
+  "      <arg name=\"brightness_value\" direction=\"out\" type=\"u\"/>\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_INT32,
+				dbus_message_append_args (reply, DBUS_TYPE_UINT32,
 							  &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_INT32,
+				dbus_message_append_args (reply, DBUS_TYPE_UINT32,
 							  &level, DBUS_TYPE_INVALID);
 		}
 	}
diff --git a/hald/linux/addons/addon-macbookpro-backlight.c b/hald/linux/addons/addon-macbookpro-backlight.c
index b31f5d0..136b5e4 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_INT32, &return_code,
+							  DBUS_TYPE_UINT32, &return_code,
 							  DBUS_TYPE_INVALID);
 			}
 
@@ -353,7 +353,7 @@ filter_function (DBusConnection *connect
 				goto error;
 
 			dbus_message_append_args (reply,
-						  DBUS_TYPE_INT32, &brightness,
+						  DBUS_TYPE_UINT32, &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=\"i\"/>\n"
+					    "      <arg name=\"return_code\" direction=\"out\" type=\"u\"/>\n"
 					    "    </method>\n"
 					    "    <method name=\"GetBrightness\">\n"
-					    "      <arg name=\"brightness_value\" direction=\"out\" type=\"i\"/>\n"
+					    "      <arg name=\"brightness_value\" direction=\"out\" type=\"u\"/>\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 94a9a12..6809864 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_INT32, &return_code,
+							  DBUS_TYPE_UINT32, &return_code,
 							  DBUS_TYPE_INVALID);
 			}
 
@@ -252,7 +252,7 @@ filter_function (DBusConnection *connect
 				goto error;
 
 			dbus_message_append_args (reply,
-						  DBUS_TYPE_INT32, &brightness,
+						  DBUS_TYPE_UINT32, &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=\"i\"/>\n"
+					    "      <arg name=\"return_code\" direction=\"out\" type=\"u\"/>\n"
 					    "    </method>\n"
 					    "    <method name=\"GetBrightness\">\n"
-					    "      <arg name=\"brightness_value\" direction=\"out\" type=\"i\"/>\n"
+					    "      <arg name=\"brightness_value\" direction=\"out\" type=\"u\"/>\n"
 					    "    </method>\n",
 					    &err)) {
 		HAL_ERROR (("Cannot claim interface 'org.freedesktop.Hal.Device.LaptopPanel'"));


More information about the hal-commit mailing list