From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: RE_TRANSLATE_P Date: Mon, 29 Nov 2004 10:12:55 +0100 Message-ID: References: <01c4d3ab$Blat.v2.2.2$7b235d00@zahav.net.il> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1101720264 28152 80.91.229.6 (29 Nov 2004 09:24:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 29 Nov 2004 09:24:24 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 29 10:24:15 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CYhlW-0007wU-00 for ; Mon, 29 Nov 2004 10:24:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CYhso-0001Mt-Os for ged-emacs-devel@m.gmane.org; Mon, 29 Nov 2004 04:31:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CYhqV-0001As-Kc for emacs-devel@gnu.org; Mon, 29 Nov 2004 04:29:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CYhqH-00018c-Nm for emacs-devel@gnu.org; Mon, 29 Nov 2004 04:29:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CYhqF-00017C-Oc for emacs-devel@gnu.org; Mon, 29 Nov 2004 04:29:08 -0500 Original-Received: from [212.88.64.25] (helo=mail-relay.sonofon.dk) by monty-python.gnu.org with smtp (Exim 4.34) id 1CYhgb-00019k-UH for emacs-devel@gnu.org; Mon, 29 Nov 2004 04:19:10 -0500 Original-Received: (qmail 90253 invoked from network); 29 Nov 2004 09:12:29 -0000 Original-Received: from unknown (HELO kfs-l.imdomain.dk.cua.dk) (213.83.150.2) by 0 with SMTP; 29 Nov 2004 09:12:29 -0000 Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Mon, 29 Nov 2004 01:12:53 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) 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: main.gmane.org gmane.emacs.devel:30482 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30482 Richard Stallman writes: > This causes RE_TRANSLATE_P to invoke a function, at least if compilers > other than GCC are used. I wonder why replacing XFASTINT with XINT > was not enough to fix the original problem? > > Would this make it right? It seems like that change was made in several places, so perhaps we should have a ZEROP macro to test such cases in a portable manner. It would also make the code cleaner: ZEROP (obj) is much easier to understand at a glance than EQ (obj, make_number (0)) A possible definition would be: #ifdef __GCC__ #define ZEROP(obj) (!EQ ((obj), make_number (0))) #else #define ZEROP(obj) (!(INTEGERP ((obj)) && XINT ((obj)) == 0)) #endif But the second form evals 'obj' twice, so we need a BIG FAT WARNING when using ZEROP, or find some other portable way to implement it. I could make that change. > > *** config.in 23 Nov 2004 11:44:45 -0500 1.203 > --- config.in 29 Nov 2004 00:30:17 -0500 > *************** > *** 969,975 **** > --- 969,979 ---- > /* Tell regex.c to use a type compatible with Emacs. */ > #define RE_TRANSLATE_TYPE Lisp_Object > #define RE_TRANSLATE(TBL, C) CHAR_TABLE_TRANSLATE (TBL, C) > + #ifdef __GCC__ > #define RE_TRANSLATE_P(TBL) (!EQ (TBL, make_number (0))) > + #else > + #define RE_TRANSLATE_P(TBL) (!(INTEGERP (TBL) && XINT (TBL) == 0)) > + #endif > #endif > > /* Avoid link-time collision with system mktime if we will use our own. */ > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel > > -- Kim F. Storm http://www.cua.dk