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: view/edit large files Date: Tue, 17 Feb 2009 21:47:46 +0200 Message-ID: References: <86fxiuw6u7.fsf@lifelogs.com> <86zlgzqudo.fsf_-_@lifelogs.com> <86k583p96e.fsf@lifelogs.com> <874oz7grs0.fsf@catnip.gol.com> <864oz3nyj8.fsf@lifelogs.com> <864oz2l47t.fsf@lifelogs.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1234900092 4219 80.91.229.12 (17 Feb 2009 19:48:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Feb 2009 19:48:12 +0000 (UTC) Cc: tzz@lifelogs.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 17 20:49:27 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 1LZVwW-0003oq-U8 for ged-emacs-devel@m.gmane.org; Tue, 17 Feb 2009 20:49:21 +0100 Original-Received: from localhost ([127.0.0.1]:40231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LZVvC-0006NW-TK for ged-emacs-devel@m.gmane.org; Tue, 17 Feb 2009 14:47:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LZVv9-0006NP-0L for emacs-devel@gnu.org; Tue, 17 Feb 2009 14:47:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LZVv7-0006ND-8g for emacs-devel@gnu.org; Tue, 17 Feb 2009 14:47:53 -0500 Original-Received: from [199.232.76.173] (port=52876 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LZVv7-0006NA-5N for emacs-devel@gnu.org; Tue, 17 Feb 2009 14:47:53 -0500 Original-Received: from mtaout7.012.net.il ([84.95.2.19]:41163) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LZVv6-0000H2-O2 for emacs-devel@gnu.org; Tue, 17 Feb 2009 14:47:52 -0500 Original-Received: from conversion-daemon.i-mtaout7.012.net.il by i-mtaout7.012.net.il (HyperSendmail v2007.08) id <0KF800C006RZTH00@i-mtaout7.012.net.il> for emacs-devel@gnu.org; Tue, 17 Feb 2009 21:47:55 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.228.82.14]) by i-mtaout7.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KF80082T6ZQKT30@i-mtaout7.012.net.il>; Tue, 17 Feb 2009 21:47:51 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (1203?) 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:109143 Archived-At: > From: Stefan Monnier > Date: Tue, 17 Feb 2009 14:23:32 -0500 > Cc: emacs-devel@gnu.org > > + off_t beg_offset, end_offset; Is off_t guaranteed to be 64-bit wide? If not, we lose the advantage of the floats, no? > + beg_offset = FLOATP (beg) ? (off_t) XFLOAT_DATA (beg) : XINT (beg); > + end_offset = FLOATP (end) ? (off_t) XFLOAT_DATA (end) : XINT (end); Shouldn't we round rather than truncate, when converting to off_t? > - if (XINT (beg) != 0) > + if (beg_offset != 0) Exact equalities might be dangerous with floats. > - if (same_at_start - BEGV_BYTE == XINT (end)) > + if (same_at_start - BEGV_BYTE == end_offset - beg_offset) Likewise. > - if (XINT (beg) != 0 || !NILP (replace)) > + if (beg_offset != 0 || !NILP (replace)) Likewise.