unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Fabrice Popineau <fabrice.popineau@supelec.fr>
Cc: Eli Zaretskii <eliz@gnu.org>,
	AJMR <ajmr@ilovetortilladepatatas.com>,
	emacs-devel@gnu.org
Subject: Re: Windows 64 port
Date: Mon, 20 Feb 2012 12:43:34 -0800	[thread overview]
Message-ID: <4F42B076.4030702@cs.ucla.edu> (raw)
In-Reply-To: <CAFgFV9Nt2O_czzVpbd5-0FryPu59og2szNqzYvHVT-+mwtJgJg@mail.gmail.com>

On 02/20/2012 11:20 AM, Fabrice Popineau wrote:
> Windows and Linux does not follow the same 64 bits rules (LLP64 vs LP64).

Yes, and that was why I suggested the heuristic that I suggested.

The Emacs code is currently quite portable to standard GNU hosts,
which are LP64 or ILP32 or ILP32LL64.  If code portable to these
hosts uses 'int', there should be no need to change the 'int' to
'intptr_t', because such a change would already be needed for the
LP64 port.  Most of your patch's changes to the mainline sources
were of this nature, and should therefore be omitted.  The only
changes actually needed for porting to an IL32LLP64 host should be
the relatively small number of changes that I mentioned in my
previous message.

>     -      int i = 0, aligned = (intptr_t) ABLOCKS_BUSY (abase);
>     +      int i = 0;
>     +      intptr_t aligned = (intptr_t) ABLOCKS_BUSY (abase);
>      
>     Here, the value of 'aligned' is either 0 or 1, so there's
>     no need to change its type.
> 
> It is kind of strange to cast to intptr_t to store the result
> in a variable of different type ?

The cast to intptr_t (instead of to int) is to avoid GCC warnings
about casting a pointer to an integer of a different size.  Using
intptr_t is helpful, because these warnings are typically useful
and in the rare cases where they're not (such as here) it's
helpful to insert a cast so that GCC does not cry wolf.

In contrast, there is no need to declare 'aligned' to be wider
than 'int'.  Generally the Emacs source code uses 'int' for random
integers that are guaranteed to fit in int range, which is the
case here, so we should leave the 'int' alone.

This is just one example, but I hope you get the general idea:
please minimize the changes made to the mainline source code.
Ideally any changes for Windows 64 would be only to the
Windows-specific part of the code, so that we don't need to worry
about its effect on GNU hosts.  In practice we can't always
achieve this ideal, but nevertheless it's important to minimize
the changes to mainline code, as this saves everybody's time.




  reply	other threads:[~2012-02-20 20:43 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-19 20:18 Windows 64 port AJMR
2012-02-19 21:26 ` Eli Zaretskii
2012-02-19 22:05   ` Fabrice Popineau
2012-02-20  3:53     ` Eli Zaretskii
2012-02-20 17:48     ` Paul Eggert
2012-02-20 19:20       ` Fabrice Popineau
2012-02-20 20:43         ` Paul Eggert [this message]
2012-02-20 20:58           ` Eli Zaretskii
2012-02-20 23:11             ` Fabrice Popineau
2012-02-20 23:46               ` Paul Eggert
2012-02-21 13:22         ` Stefan Monnier
2012-02-21 18:26           ` Paul Eggert
2012-02-22 10:39         ` Richard Stallman
2012-02-22 16:27           ` Eli Zaretskii
2012-02-23 18:44             ` Richard Stallman
2012-02-23 19:16               ` Aurélien
2012-02-23 19:50                 ` Lennart Borgman
2012-02-23 20:48                 ` Fabrice Popineau
2012-02-24  5:52                   ` Aurélien
2012-02-28 21:00       ` Fabrice Popineau
2012-02-28 22:09         ` Paul Eggert
2012-02-28 22:39           ` Fabrice Popineau
2012-02-29 18:08             ` Eli Zaretskii
2012-02-29 22:08               ` Paul Eggert
2012-02-29 18:04           ` Eli Zaretskii
2012-02-29 19:43             ` Paul Eggert
2012-02-29 21:24               ` Eli Zaretskii
2012-03-01  3:34                 ` Paul Eggert
2012-03-01  4:03                   ` Eli Zaretskii
2012-03-01  6:28                     ` Paul Eggert
2012-03-01  7:04                       ` Fabrice Popineau
2012-03-22 17:31               ` Fabrice Popineau
2012-03-23 18:26                 ` Paul Eggert
2012-03-24  9:27                   ` Fabrice Popineau
2012-03-22 17:39           ` Fabrice Popineau
2012-03-22 18:02             ` Andreas Schwab
2012-03-22 18:34               ` Fabrice Popineau
2012-03-22 22:46                 ` Andreas Schwab
2012-03-22 23:06                   ` Fabrice Popineau
2012-03-22 23:38                     ` Andreas Schwab
2012-03-23  8:12                       ` Eli Zaretskii
2012-03-23  9:45                         ` Andreas Schwab
2012-03-23 10:27                           ` Fabrice Popineau
2012-03-23 10:42                             ` Andreas Schwab
2012-03-23 12:21                             ` Eli Zaretskii
2012-03-23 10:11                         ` Fabrice Popineau
2012-03-23 18:13                           ` Paul Eggert
2012-02-20 20:47     ` Eli Zaretskii
2012-02-26 20:17       ` AJMR
2012-02-26 21:25         ` Eli Zaretskii
2012-02-27 17:37           ` AJMR
2012-02-28 21:32       ` Fabrice Popineau
2012-03-01  3:23         ` Paul Eggert
2012-03-01  7:24           ` Fabrice Popineau
2012-03-01  8:58             ` Paul Eggert
2012-03-01 17:45               ` Eli Zaretskii
2012-03-01 20:05               ` Fabrice Popineau
2012-03-02  9:22               ` Eli Zaretskii
2012-03-02 20:35                 ` Paul Eggert
2012-03-02 21:32                   ` Fabrice Popineau
2012-03-02 22:06                   ` Eli Zaretskii
2012-03-03  5:42                     ` Paul Eggert
2012-03-03  7:18                       ` Eli Zaretskii
2012-03-04 21:48                         ` Paul Eggert
2012-03-03  7:58             ` Eli Zaretskii
2012-03-10 13:43               ` Eli Zaretskii
2012-03-22 17:15           ` Fabrice Popineau
2012-03-22 17:22           ` Fabrice Popineau
2012-03-22 18:29           ` Fabrice Popineau
2012-03-22 20:53             ` Stefan Monnier
2012-03-27 12:47           ` Fabrice Popineau
2012-03-27 16:08             ` Paul Eggert
2012-02-20  9:41 ` Richard Stallman
2012-02-20 10:28   ` Dani Moncayo
2012-02-21 12:10     ` Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=4F42B076.4030702@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=ajmr@ilovetortilladepatatas.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=fabrice.popineau@supelec.fr \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).