emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ptrdiff_t misuse


From: Dmitry Antipov
Subject: Re: ptrdiff_t misuse
Date: Fri, 06 Jul 2012 20:42:28 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

On 07/06/2012 08:00 PM, Eli Zaretskii wrote:

Yes, that's the point -- if ptrdiff_t and EMACS_POS
would span the same range of values, why bother to
distinguish the two?

Because Emacs positions are not pointers, nor differences between
pointers.

IMHO you mix the confusing type name and it's real use.

I read ptrdiff_t exactly as "difference between pointers", and this is
the minor drawback; the major one is that there is no standard unsigned
counterpart, like for size_t/ssize_t pair.

Whether a value is a buffer position is usually clearly stated in
the variable name.

I refer you to the recent repeated confusions about this by Dmitry.

This isn't related to any type (mis)use. In a struct window,
window_end_pos really means something like last_displayed_pos;
this is quite hard to mix with window_end_[whatever].

Dmitry



reply via email to

[Prev in Thread] Current Thread [Next in Thread]