From: Paul Eggert Date: Tue, 24 May 2011 02:06:12 +0000 (-0700) Subject: * dbusbind.c (xd_read_message_1): Don't assume dbus_uint32_t can fit in int. X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~139^2~3 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=30217ff0cf028810c4f7c6d3b0324e2dfaf2c131;p=emacs.git * dbusbind.c (xd_read_message_1): Don't assume dbus_uint32_t can fit in int. --- diff --git a/src/ChangeLog b/src/ChangeLog index 46c601731c5..9037adeeb01 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -7,6 +7,7 @@ (Fdbus_method_error_internal): Likewise. Also, for unsigned arguments, check that Lisp number is nonnegative, rather than silently wrapping negative numbers around. + (xd_read_message_1): Don't assume dbus_uint32_t can fit in int. * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT. diff --git a/src/dbusbind.c b/src/dbusbind.c index 0de30613801..50f70f9b9e1 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -1663,7 +1663,9 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus) DBusMessage *dmessage; DBusMessageIter iter; unsigned int dtype; - int mtype, serial; + int mtype; + dbus_uint32_t serial; + unsigned int userial; const char *uname, *path, *interface, *member; dmessage = dbus_connection_pop_message (connection); @@ -1692,7 +1694,7 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus) /* Read message type, message serial, unique name, object path, interface and member from the message. */ mtype = dbus_message_get_type (dmessage); - serial = + userial = serial = ((mtype == DBUS_MESSAGE_TYPE_METHOD_RETURN) || (mtype == DBUS_MESSAGE_TYPE_ERROR)) ? dbus_message_get_reply_serial (dmessage) @@ -1702,7 +1704,7 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus) interface = dbus_message_get_interface (dmessage); member = dbus_message_get_member (dmessage); - XD_DEBUG_MESSAGE ("Event received: %s %d %s %s %s %s %s", + XD_DEBUG_MESSAGE ("Event received: %s %u %s %s %s %s %s", (mtype == DBUS_MESSAGE_TYPE_INVALID) ? "DBUS_MESSAGE_TYPE_INVALID" : (mtype == DBUS_MESSAGE_TYPE_METHOD_CALL) @@ -1712,7 +1714,7 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus) : (mtype == DBUS_MESSAGE_TYPE_ERROR) ? "DBUS_MESSAGE_TYPE_ERROR" : "DBUS_MESSAGE_TYPE_SIGNAL", - serial, uname, path, interface, member, + userial, uname, path, interface, member, SDATA (format2 ("%s", args, Qnil))); if ((mtype == DBUS_MESSAGE_TYPE_METHOD_RETURN)