all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: emacs-devel@gnu.org
Subject: (unknown)
Date: Fri, 29 Jun 2012 16:20:46 +0300	[thread overview]
Message-ID: <83lij66yq9.fsf@gnu.org> (raw)

Dmitry, could you please explain the reason(s) for the change below?

Vertical positions in a window can never be large enough to justify
using ptrdiff_t (on platforms where that is wider than a 32-bit
'int').  These are pixel positions on the Emacs display, so they
cannot be too large.  The type of 'first_vpos' looks especially
strange, since it is explicitly set to 1 at most.  I'm not aware of a
platform where an 'int' is not wide enough for a value 1 ;-)

Using inappropriate data types makes the code harder to read and
understand, because it hints that something non-obvious is going on
somewhere.

	 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
	 to ptrdiff_t.

  --- src/xdisp.c 2012-06-28 12:29:37 +0000
  +++ src/xdisp.c 2012-06-29 11:48:08 +0000
  @@ -17761,8 +17761,8 @@ try_window_id (struct window *w)
       {
	 /* Displayed to end of window, but no line containing text was
	   displayed.  Lines were deleted at the end of the window.  */
  -      int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0;
  -      int vpos = XFASTINT (w->window_end_vpos);
  +      ptrdiff_t first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0;
  +      ptrdiff_t vpos = XFASTINT (w->window_end_vpos);
	 struct glyph_row *current_row = current_matrix->rows + vpos;
	 struct glyph_row *desired_row = desired_matrix->rows + vpos;



             reply	other threads:[~2012-06-29 13:20 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-29 13:20 Eli Zaretskii [this message]
2012-06-29 14:18 ` ptrdiff_t misuse [was :Re: (empty)] Dmitry Antipov
2012-06-29 17:07   ` Stefan Monnier
2012-06-30  7:13     ` Paul Eggert
2012-06-30  7:27       ` Eli Zaretskii
2012-06-30 13:12         ` Paul Eggert
2012-06-30 14:23           ` Stefan Monnier
2012-06-30 12:07       ` Stefan Monnier
2012-06-30 13:14         ` Paul Eggert
2012-06-30 14:23           ` Stefan Monnier
2012-07-04  6:25             ` Paul Eggert
2012-07-04 16:39               ` Eli Zaretskii
2012-07-04 18:19                 ` Paul Eggert
2012-07-05 16:31                   ` Eli Zaretskii
2012-07-05 19:34                     ` Eli Zaretskii
2012-07-06  0:08                       ` Paul Eggert
2012-07-06  6:43                         ` Eli Zaretskii
2012-07-06  7:32                           ` Paul Eggert
2012-07-06  8:34                             ` ptrdiff_t misuse Eli Zaretskii
2012-07-06 14:51                               ` Paul Eggert
2012-07-06 21:30                               ` Stefan Monnier
2012-07-06 21:33                                 ` Samuel Bronson
2012-07-07 10:59                                   ` Stefan Monnier
2012-07-07 15:34                                     ` Paul Eggert
2012-07-06  8:46                             ` Eli Zaretskii
2012-07-06 10:19                               ` Stephen J. Turnbull
2012-07-06 11:01                                 ` Eli Zaretskii
2012-07-06 12:02                                   ` Stephen J. Turnbull
2012-07-06 13:37                                     ` Eli Zaretskii
2012-07-06 16:25                                       ` Stephen J. Turnbull
2012-07-06 14:56                                   ` Paul Eggert
2012-07-06 15:43                                     ` Eli Zaretskii
2012-07-06 15:56                                       ` Paul Eggert
2012-07-06 16:00                                         ` Eli Zaretskii
2012-07-06 16:42                                           ` Dmitry Antipov
2012-07-06 17:39                                             ` Paul Eggert
2012-07-07  1:31                               ` Chong Yidong
2012-06-29 18:54   ` ptrdiff_t misuse [was :Re: (empty)] Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2024-05-21  2:03 (unknown) Tennyson Bardwell
2024-03-13 12:48 (unknown) Eli Zaretskii
2023-11-18  3:13 (unknown) Greg Minshall
2023-11-18  7:05 ` (unknown) Jim Porter
2023-03-13  6:32 (unknown) Pedro Andres Aranda Gutierrez
2023-03-13  6:18 (unknown) Pedro Andres Aranda Gutierrez
2023-02-11 20:24 (unknown) cheyrn via Users list for the GNU Emacs text editor
2022-10-03  6:30 (unknown) Pedro Andres Aranda Gutierrez
2022-07-21 11:36 (unknown) Gregory Heytings
2022-07-09 13:53 (unknown) Lorenzo Isella
2022-07-09 15:06 ` (unknown) Óscar Fuentes
2022-05-29  6:06 (unknown) Pedro Andres Aranda Gutierrez
2022-02-17 19:24 (unknown) hput
2022-02-17 20:03 ` (unknown) Stefan Monnier via Users list for the GNU Emacs text editor
2021-12-20  2:29 (unknown) Davin Pearson
2021-08-23 18:37 (unknown) telegraph
2021-08-23 18:36 (unknown) telegraph
2021-07-27 23:54 (unknown) Troy Hinckley
2021-06-06  8:06 (unknown) Sai Karthik
2021-05-07 12:51 (unknown) Eric Skoglund
2021-05-07 14:40 ` (unknown) Bastien
2020-09-06  7:04 (unknown) Ag Ibragimov
2020-03-15 22:42 (unknown) Arne Babenhauserheide
2019-10-18  2:46 (unknown) Justin Barclay
2019-05-02  0:36 (unknown) Budi
2019-05-02  0:40 ` (unknown) Óscar Fuentes
2018-04-09 23:58 (unknown) siraben
2017-08-30 19:33 (unknown) Mark Oteiza
2017-04-07 23:43 Understanding how to specify UTF-8 Will Parsons
2017-04-13  5:09 ` B. T. Raven
2017-04-13  6:37   ` (unknown) Eli Zaretskii
2017-03-19 16:48 (unknown) Paul Pogonyshev
2017-03-19 19:16 ` (unknown) Mark Oteiza
2017-03-19 19:36   ` (unknown) Paul Pogonyshev
2016-12-28  7:15 (unknown) Chris Gregory
2016-12-28  8:58 ` (unknown) Andreas Schwab
2016-09-28 12:26 (unknown) Takesi Ayanokoji
2016-09-29 13:52 ` (unknown) Byung-Hee HWANG (황병희, 黃炳熙)
2016-02-20 15:28 (unknown) Anders Lindgren
2016-02-08  7:54 (unknown) steve
2016-02-08  8:01 ` (unknown) Steve Purcell
2015-08-10 13:59 (unknown) David Kastrup
2015-08-10 14:02 ` (unknown) David Kastrup
2014-11-13 15:21 (unknown) Eli Zaretskii
2014-11-13 15:30 ` (unknown) Lars Magne Ingebrigtsen
2013-07-04  7:50 (unknown) João Távora
2013-07-06 15:22 ` (unknown) Lars Ingebrigtsen
2013-07-06 17:58   ` (unknown) João Távora
2013-07-06 18:01     ` (unknown) Lars Ingebrigtsen
2011-09-17  8:02 (unknown) tester12312
2007-04-04 19:09 (unknown) Jost Burkardt
2005-01-16 15:38 (unknown) mayuko_v_v_sutekimax
2003-05-12  7:59 (unknown) Knowledg1
2003-05-12  7:59 (unknown) Knowledg1
2003-05-01  3:08 (unknown) @Traduire
2003-05-01  3:08 (unknown) @Traduire
2003-04-03 22:41 (unknown) Sebastian Tennant
2003-03-14  6:09 (unknown) Waruna Singappuli
2003-02-02  3:30 (unknown) JMT
2002-04-01  2:15 (unknown) ¿ì¹®°ü

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=83lij66yq9.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dmantipov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    /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.