changeset 105749:f955480a1d92

(xd_retrieve_arg): Handle DBUS_TYPE_INTnn and DBUS_TYPE_UINTnn separately to get proper sign extension.
author Andreas Schwab <schwab@linux-m68k.org>
date Sat, 24 Oct 2009 16:45:25 +0000
parents 87712af03fb7
children a81c63f1a19f
files src/ChangeLog src/dbusbind.c
diffstat 2 files changed, 25 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Oct 24 16:34:52 2009 +0000
+++ b/src/ChangeLog	Sat Oct 24 16:45:25 2009 +0000
@@ -1,5 +1,8 @@
 2009-10-24  Andreas Schwab  <schwab@linux-m68k.org>
 
+	* dbusbind.c (xd_retrieve_arg): Handle DBUS_TYPE_INTnn and
+	DBUS_TYPE_UINTnn separately to get proper sign extension.
+
 	* dired.c (Ffile_attributes): Simplify now that FIXNUM_OVERFLOW_P
 	can properly handle unsigned types.
 	(make_uid, make_gid): Removed.
--- a/src/dbusbind.c	Sat Oct 24 16:34:52 2009 +0000
+++ b/src/dbusbind.c	Sat Oct 24 16:45:25 2009 +0000
@@ -616,6 +616,13 @@
       }
 
     case DBUS_TYPE_INT16:
+      {
+	dbus_int16_t val;
+	dbus_message_iter_get_basic (iter, &val);
+	XD_DEBUG_MESSAGE ("%c %d", dtype, val);
+	return make_number (val);
+      }
+
     case DBUS_TYPE_UINT16:
       {
 	dbus_uint16_t val;
@@ -625,19 +632,29 @@
       }
 
     case DBUS_TYPE_INT32:
+      {
+	dbus_int32_t val;
+	dbus_message_iter_get_basic (iter, &val);
+	XD_DEBUG_MESSAGE ("%c %d", dtype, val);
+	return make_fixnum_or_float (val);
+      }
+
     case DBUS_TYPE_UINT32:
       {
-	/* Assignment to EMACS_INT stops GCC whining about limited
-	   range of data type.  */
 	dbus_uint32_t val;
-	EMACS_INT val1;
 	dbus_message_iter_get_basic (iter, &val);
 	XD_DEBUG_MESSAGE ("%c %d", dtype, val);
-	val1 = val;
-	return make_fixnum_or_float (val1);
+	return make_fixnum_or_float (val);
       }
 
     case DBUS_TYPE_INT64:
+      {
+	dbus_int64_t val;
+	dbus_message_iter_get_basic (iter, &val);
+	XD_DEBUG_MESSAGE ("%c %d", dtype, (int) val);
+	return make_fixnum_or_float (val);
+      }
+
     case DBUS_TYPE_UINT64:
       {
 	dbus_uint64_t val;