From: Paul Eggert Date: Thu, 28 Apr 2011 00:48:19 +0000 (-0700) Subject: * dbusbind.c: Don't possibly lose pointer info when converting. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~92^2~41 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2a866e7b9881176980c0a4acb998e1625aabf87f;p=emacs.git * dbusbind.c: Don't possibly lose pointer info when converting. (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages): Use XPNTR rather than XHASH, so that the high-order bits of the pointer aren't lost when converting through void *. --- diff --git a/src/ChangeLog b/src/ChangeLog index 442e8e3b1f6..52b7f323cd3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2011-04-28 Paul Eggert + * dbusbind.c: Don't possibly lose pointer info when converting. + (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages): + Use XPNTR rather than XHASH, so that the high-order bits of + the pointer aren't lost when converting through void *. + * eval.c (Fautoload): Don't double-shift a pointer. * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long. diff --git a/src/dbusbind.c b/src/dbusbind.c index 4c0b9bd017a..06feec3e792 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -892,7 +892,7 @@ xd_remove_watch (DBusWatch *watch, void *data) return; /* Unset session environment. */ - if (data != NULL && data == (void*) XHASH (QCdbus_session_bus)) + if (data != NULL && data == (void *) XPNTR (QCdbus_session_bus)) { XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS"); unsetenv ("DBUS_SESSION_BUS_ADDRESS"); @@ -929,7 +929,7 @@ DEFUN ("dbus-init-bus", Fdbus_init_bus, Sdbus_init_bus, 1, 1, 0, xd_add_watch, xd_remove_watch, xd_toggle_watch, - (void*) XHASH (bus), NULL)) + (void *) XPNTR (bus), NULL)) XD_SIGNAL1 (build_string ("Cannot add watch functions")); /* Add bus to list of registered buses. */ @@ -1824,7 +1824,7 @@ xd_read_queued_messages (int fd, void *data, int for_read) if (data != NULL) while (!NILP (busp)) { - if (data == (void*) XHASH (CAR_SAFE (busp))) + if (data == (void *) XPNTR (CAR_SAFE (busp))) bus = CAR_SAFE (busp); busp = CDR_SAFE (busp); }