From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.devel
Subject: Re: Removing some workarounds for big integers
Date: Mon, 22 Apr 2019 18:59:24 +0200
Message-ID:
References: <86d0uck5o0.fsf@gmail.com>
<15786884-92c4-efb0-58d3-a6ec6726a0fe@cs.ucla.edu>
<86lg02our6.fsf@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226";
logging-data="11045"; mail-complaints-to="usenet@blaine.gmane.org"
Cc: Emacs developers
To: Andy Moreton
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 22 19:00:18 2019
Return-path:
Envelope-to: ged-emacs-devel@m.gmane.org
Original-Received: from lists.gnu.org ([209.51.188.17])
by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256)
(Exim 4.89)
(envelope-from )
id 1hIcIj-0002kU-HK
for ged-emacs-devel@m.gmane.org; Mon, 22 Apr 2019 19:00:17 +0200
Original-Received: from localhost ([127.0.0.1]:40178 helo=lists.gnu.org)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from )
id 1hIcIi-0004jf-FA
for ged-emacs-devel@m.gmane.org; Mon, 22 Apr 2019 13:00:16 -0400
Original-Received: from eggs.gnu.org ([209.51.188.92]:46288)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1hIcI6-0004Rk-Tp
for emacs-devel@gnu.org; Mon, 22 Apr 2019 12:59:39 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1hIcI6-0002Dq-1b
for emacs-devel@gnu.org; Mon, 22 Apr 2019 12:59:38 -0400
Original-Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]:46837)
by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
(Exim 4.71) (envelope-from )
id 1hIcI5-0002DA-T8
for emacs-devel@gnu.org; Mon, 22 Apr 2019 12:59:37 -0400
Original-Received: by mail-oi1-x233.google.com with SMTP id x188so8937634oia.13
for ; Mon, 22 Apr 2019 09:59:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc; bh=fY2XGhjtdyNohGquIGoAcukSD1h6+mTXjD58mQwCCi0=;
b=kj3saMcX05WTJLZIX19v968mOmI9rI5dMKWtkJGuKtpbFtmplxjp1+td2RtD2WEn2/
jxHPOV76DfJKBG/AEPeGhx6YREjkdP70JhGoR11Dqt8n1wQxN4oQ+J0UP9Q6+DPrxntn
BjZ4yJrDf9Fju4zmmHzZ2MQ+BGzCB8Uu5kzO4nAGEABog3ePgnjKg5oS2/Wf8+BLa0at
z+/puyg9QGtmcHrXP3Yp8JgwGNoY8+3npwcwgggJeNq/l8TSaBNgMZExvs6aXuZoxo9d
ZKit6PotWV9dC5H6Ptt8oKsv4QiMeLI6M4SWBqugrOdtQZgAJcVqZ0jKAiYUq+FzKX7V
jBqQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=fY2XGhjtdyNohGquIGoAcukSD1h6+mTXjD58mQwCCi0=;
b=ScfD/xY+IADCJfEYndF2tw+tEPB7BGvKanSpvCsGXkZSORq2o4Un4G+K0RHLPsBpdp
8/tvl38CHbAKg5jmvcv/f+WslqNGvoir57h1Ia1ctxscoILYcXrDo3knnOiXM/+nR+Ju
CZyh+5at/0Ah4LpVevpX1z0W76/6qGclAUgHsQwrPwYhCUfvMx2t7xOtxRmujMS3zaxs
F7aBFyd//MVia9E6jh23/eQkQzf8Io7zY47EZuRAQvJq+d4vHc3ux/uPMIJnRbqKhpeJ
YkeLFQQd6x7BxWp7OK0F5DwovspYHWeOyHcyGDJJmL5bGGG9cLkBaLeZ7QwAqIYooWA+
5Hmg==
X-Gm-Message-State: APjAAAVN2I21sjLObEoOM+rwe+8EJksnk9X3bppuQgqlC5mDdgLvV7GM
+SzkuqN6ySzp1ww5NWZktroZUitN+5mvytKDJpM=
X-Google-Smtp-Source: APXvYqwdIVxRcXHhCQs62n8tcXXajOdkE33IuDB4GSVEVUJZZ0c5cthgTaf6yY2jbQ9BiBg/vXiZ2fB4a9d965s+jJk=
X-Received: by 2002:aca:d90a:: with SMTP id q10mr11304886oig.65.1555952376074;
Mon, 22 Apr 2019 09:59:36 -0700 (PDT)
In-Reply-To: <86lg02our6.fsf@gmail.com>
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 2607:f8b0:4864:20::233
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: "Emacs development discussions."
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org
Original-Sender: "Emacs-devel"
Xref: news.gmane.org gmane.emacs.devel:235775
Archived-At:
Am Mo., 22. Apr. 2019 um 18:56 Uhr schrieb Andy Moreton
:
>
> On Mon 22 Apr 2019, Philipp Stephani wrote:
>
> > Am Sa., 22. Sept. 2018 um 01:12 Uhr schrieb Paul Eggert :
> >>
> >> Philipp Stephani wrote:
> >>
> >> > It looks like Paul has already done most of this work in commit
> >> > d77d01d22902acdc45c2c7059de4f1b158ab5806.
> >>
> >> Yes, I've already replaced all uses of make_fixnum_or_float and INTEGER_TO_CONS
> >> with INT_TO_INTEGER.
> >>
> >> There are still quite a few places that need looking at, though. Stefan
> >> mentioned timestamps; I'll try to bump the priority of that.
> >
> > I've checked some of the remaining uses of CONS_TO_INTEGER. It seems
> > some of them we can replace right away. For some others the
> > documentation requires a number; we can detect integral floats for
> > them, but should deprecate the float usage.
>
> In commit 4e2ea400 ("Introduce a helper macro to convert a Lisp integer
> to a C integer."):
>
> +/* Return the integral value of NUM. If NUM is too big for TYPE,
> + signal an error. */
> +#define INTEGER_TO_INT(num, type) \
> + (TYPE_SIGNED (type) \
> + ? ranged_integer_to_int ((num), TYPE_MINIMUM (type), TYPE_MAXIMUM (type)) \
> + : ranged_integer_to_uint ((num), TYPE_MINIMUM (type)))
> ^^^^^^^^^^^^
> This should be TYPE_MAXIMUM.
Thanks, fixed