From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?SmFuIERqw6Rydg==?= Newsgroups: gmane.emacs.devel Subject: Re: Type-error in C code Date: Sat, 13 Nov 2010 23:23:29 +0100 Message-ID: <4CDF0FE1.4070404@swipnet.se> References: <4CDD5951.4030904@swipnet.se> <8762w2jlak.fsf@ambire.localdomain> <4CDEE4A9.2030008@swipnet.se> <87lj4xatmu.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1289687094 14056 80.91.229.12 (13 Nov 2010 22:24:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 13 Nov 2010 22:24:54 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thien-Thi Nguyen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 13 23:24:50 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 1PHOW7-0007zS-1a for ged-emacs-devel@m.gmane.org; Sat, 13 Nov 2010 23:24:50 +0100 Original-Received: from localhost ([127.0.0.1]:46617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PHOVz-000214-RT for ged-emacs-devel@m.gmane.org; Sat, 13 Nov 2010 17:24:07 -0500 Original-Received: from [140.186.70.92] (port=51542 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PHOVo-0001o8-9j for emacs-devel@gnu.org; Sat, 13 Nov 2010 17:24:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PHOVR-0002EL-1D for emacs-devel@gnu.org; Sat, 13 Nov 2010 17:23:54 -0500 Original-Received: from smtprelay-h32.telenor.se ([213.150.131.5]:37737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PHOVQ-0002E8-SU for emacs-devel@gnu.org; Sat, 13 Nov 2010 17:23:33 -0500 Original-Received: from ipb2.telenor.se (ipb2.telenor.se [195.54.127.165]) by smtprelay-h32.telenor.se (Postfix) with ESMTP id 67D7DE8FEA for ; Sat, 13 Nov 2010 23:23:31 +0100 (CET) X-SENDER-IP: [85.225.45.100] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AncwABqe3kxV4S1kPGdsb2JhbACDQIRSmkMMAQEBATUtrSGPeIEigzVzBI1j X-IronPort-AV: E=Sophos;i="4.59,192,1288566000"; d="scan'208";a="150129224" Original-Received: from c-642de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.100]) by ipb2.telenor.se with ESMTP; 13 Nov 2010 23:23:31 +0100 Original-Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 4CAB07FA05A; Sat, 13 Nov 2010 23:23:30 +0100 (CET) User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.11) Gecko/20101013 Thunderbird/3.1.5 In-Reply-To: <87lj4xatmu.fsf@ambire.localdomain> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:132609 Archived-At: Thien-Thi Nguyen skrev 2010-11-13 20.52: > () Jan Dj=C3=A4rv > () Sat, 13 Nov 2010 20:19:05 +0100 > However, I fixed the code to use make_fixnum_or_float anyway. > In the future somebody may come along and wonder why a 32-bit > number is put in a Lisp integer. > > Not if they understand that an Atom is NOT a 32-bit number. > Perhaps if you revert the change and explain the limits of > the type in a nice comment, future programmers will not be > inclined to wonder when they look (only) at the source. > > I think routing through =E2=80=98make_fixnum_or_float=E2=80=99 is subop= timal. This code is only used when changing fullscreen or sticky frame parameter= . And that does not happen often. An extra check that ensures the value is= =20 below max fixnum is too small to be worth to optimize away. If atoms are= 29=20 bits, they will be fixnum anyway. Jan D.