From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Toru TSUNEYOSHI Newsgroups: gmane.emacs.devel Subject: Re: macro FIXNUM_OVERFLOW_P in lisp.h is valid ? Date: Sun, 25 Oct 2009 17:51:31 +0900 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1256460829 13405 80.91.229.12 (25 Oct 2009 08:53:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Oct 2009 08:53:49 +0000 (UTC) Cc: emacs-devel@gnu.org To: monnier@IRO.UMontreal.CA Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 25 09:53:42 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N1yr6-00078t-4d for ged-emacs-devel@m.gmane.org; Sun, 25 Oct 2009 09:53:40 +0100 Original-Received: from localhost ([127.0.0.1]:36104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1yr5-00069y-Mh for ged-emacs-devel@m.gmane.org; Sun, 25 Oct 2009 04:53:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N1ypS-0005eS-Pn for emacs-devel@gnu.org; Sun, 25 Oct 2009 04:51:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N1ypN-0005bv-CB for emacs-devel@gnu.org; Sun, 25 Oct 2009 04:51:57 -0400 Original-Received: from [199.232.76.173] (port=54992 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1ypM-0005bd-Ld for emacs-devel@gnu.org; Sun, 25 Oct 2009 04:51:52 -0400 Original-Received: from blu0-omc4-s4.blu0.hotmail.com ([65.55.111.143]:41013) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N1ypM-0007Do-9C for emacs-devel@gnu.org; Sun, 25 Oct 2009 04:51:52 -0400 Original-Received: from BLU0-SMTP67 ([65.55.111.137]) by blu0-omc4-s4.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 25 Oct 2009 01:51:52 -0700 X-Originating-IP: [124.155.30.210] X-Originating-Email: [t_tuneyosi@hotmail.com] Original-Received: from localhost ([124.155.30.210]) by BLU0-SMTP67.blu0.hotmail.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Sun, 25 Oct 2009 01:51:51 -0700 In-Reply-To: X-Mailer: Mew version 6.2 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) X-OriginalArrivalTime: 25 Oct 2009 08:51:51.0259 (UTC) FILETIME=[64EEB2B0:01CA5550] X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:116387 Archived-At: From: Stefan Monnier > I think the problem is that FIXNUM_OVERFLOW_P is written to handle an > integer argument, not a float argument. So rather than patch it to use > floats, I'd rather write a new macro that works for floats (and only > casts the MOST_POSITIVE_FIXNUM side). > > > Stefan I made a new macro. Probably, it doesn't depend on variable type, I think. Would you like to check it? #define FIXNUM_OVERFLOW_P(i) \ ((i) > 0 \ ? (i) != MOST_POSITIVE_FIXNUM \ && (i) / MOST_POSITIVE_FIXNUM >= 1 \ : (i) != MOST_NEGATIVE_FIXNUM \ && (i) / MOST_NEGATIVE_FIXNUM >= 1)