From: Stefan Monnier Date: Mon, 4 Jan 2010 17:38:20 +0000 (-0500) Subject: (xd_remove_watch): Avoid trying to convert a void* to X-Git-Tag: emacs-pretest-23.1.92~87^2~5 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e3eb1dae0dbedaa4623e248be0e3db8c9495df02;p=emacs.git (xd_remove_watch): Avoid trying to convert a void* to Lisp_Object, preferring to convert a lisp_Object to a void* instead. (Fdbus_init_bus): Use XHASH to get a scalar value from a Lisp_Object. --- diff --git a/src/ChangeLog b/src/ChangeLog index 2d1441964f2..6818ec395a4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-01-04 Stefan Monnier + + * dbusbind.c (xd_remove_watch): Avoid trying to convert a void* to + Lisp_Object, preferring to convert a lisp_Object to a void* instead. + (Fdbus_init_bus): Use XHASH to get a scalar value from a Lisp_Object. + 2010-01-03 Michael Albinus * dbusbind.c (xd_add_watch): Improve debug message. @@ -21221,7 +21227,7 @@ See ChangeLog.10 for earlier changes. ;; add-log-time-zone-rule: t ;; End: - Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/dbusbind.c b/src/dbusbind.c index 59702ed93c4..974a01e8ead 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -805,7 +805,7 @@ xd_remove_watch (watch, data) return; /* Unset session environment. */ - if ((data != NULL) && (EQ ((Lisp_Object) data, QCdbus_session_bus))) + if ((data != NULL) && (data == (void*) XHASH (QCdbus_session_bus))) { XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS"); unsetenv ("DBUS_SESSION_BUS_ADDRESS"); @@ -838,7 +838,7 @@ This is an internal function, it shall not be used outside dbus.el. */) if (!dbus_connection_set_watch_functions (connection, xd_add_watch, xd_remove_watch, - NULL, (void *) bus, NULL)) + NULL, (void*) XHASH (bus), NULL)) XD_SIGNAL1 (build_string ("Cannot add watch functions")); /* Return. */