From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: EMACS_INT cleanup Date: Thu, 23 Sep 2010 22:40:53 +0200 Message-ID: <83y6astcq2.fsf@gnu.org> References: <83aan8uvy3.fsf@gnu.org> <8339t0uthi.fsf@gnu.org> <831v8kurwd.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1285274475 26657 80.91.229.12 (23 Sep 2010 20:41:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 23 Sep 2010 20:41:15 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lars Magne Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 23 22:41:13 2010 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.69) (envelope-from ) id 1OysbN-0002y2-P6 for ged-emacs-devel@m.gmane.org; Thu, 23 Sep 2010 22:41:10 +0200 Original-Received: from localhost ([127.0.0.1]:45499 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OysbN-00020K-6i for ged-emacs-devel@m.gmane.org; Thu, 23 Sep 2010 16:41:09 -0400 Original-Received: from [140.186.70.92] (port=45563 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OysbC-0001vI-Kk for emacs-devel@gnu.org; Thu, 23 Sep 2010 16:41:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oysb5-0002Oj-Lr for emacs-devel@gnu.org; Thu, 23 Sep 2010 16:40:58 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:59837) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oysb5-0002O9-F7 for emacs-devel@gnu.org; Thu, 23 Sep 2010 16:40:51 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0L9700900VR5KQ00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Thu, 23 Sep 2010 22:40:49 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.127.203.3]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L970089XW40SBC0@a-mtaout20.012.net.il>; Thu, 23 Sep 2010 22:40:49 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) 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:130696 Archived-At: > From: Lars Magne Ingebrigtsen > Date: Thu, 23 Sep 2010 22:29:49 +0200 > > Eli Zaretskii writes: > > >> A cast somewhere in the macro would probably do the trick, but > >> where? > > > > Does it help to make sa_count's type ptrdiff_t instead of int? > > I just added the (int) here, which seemed to do the trick: > > #define USE_SAFE_ALLOCA \ > int sa_count = (int) SPECPDL_INDEX (), sa_must_free = 0 If ptrdiff_t works, it is a better solution, because SPECPDL_INDEX is defined like this: extern struct specbinding *specpdl; extern struct specbinding *specpdl_ptr; ... #define SPECPDL_INDEX() (specpdl_ptr - specpdl) So it returns a difference between two pointers, which is exactly what ptrdiff_t is for (as its name hints). Casting it to an int will DTWT on a 64-bit host. sa_must_free can stay an int, btw.