all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Jan Djärv" <jan.h.d@swipnet.se>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 18303@debbugs.gnu.org
Subject: bug#18303: Drag and Drop fails when Emacs window/frame is above top
Date: Mon, 8 Sep 2014 07:04:54 +0200	[thread overview]
Message-ID: <A25FEC68-12A3-4830-9F8E-FCBF8D3CB4CA@swipnet.se> (raw)
In-Reply-To: <540CB70E.30206@cs.ucla.edu>

Hello.

7 sep 2014 kl. 21:50 skrev Paul Eggert <eggert@cs.ucla.edu>:

> Thanks for the patch.  I noticed that '(v1 << 16) | v2' wouldn't work as desired when v2 < 0, though, as v2's sign bits will bleed into v1's encoded value.  I installed an attempt at a fix as trunk bzr 117836.

Thanks, but it does not look right.  We can assume v1 and v2 are 16 bit signed integers (X coordinates).  In general, when data is a CONS, it must be two 16 bit numbers.
So (v1 << 16) | v2 is just a way of stuffing two signed 16 bits into 32 bits.
But when v2 is long,  (v2 & 0xffff) looses the sign bit, as the code is now.

I don't know why the range X_LONG_(MIN|MAX) >> 16 is relevant here, it is way too large.
Remember, val can only be 32 bit, so X_LONG_MAX >> 16 can in it self be 48 bits.
Maybe just convert v1 and v2 to two signed 16 bit numbers (int16_t?) and shift?

	Jan D.






  reply	other threads:[~2014-09-08  5:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-20 12:50 bug#18303: Drag and Drop fails when Emacs window/frame is above top Paulie Pena IV
2014-09-07 17:32 ` Jan Djärv
2014-09-07 19:50 ` Paul Eggert
2014-09-08  5:04   ` Jan Djärv [this message]
2014-09-08 13:10     ` Paul Eggert
2014-09-08 15:18       ` Jan Djärv

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A25FEC68-12A3-4830-9F8E-FCBF8D3CB4CA@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=18303@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.