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 22:51:06 +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> <871vtw95s4.fsf@catnip.gol.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1234903884 18826 80.91.229.12 (17 Feb 2009 20:51:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Feb 2009 20:51:24 +0000 (UTC) Cc: emacs-devel@gnu.org To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 17 21:52:40 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 1LZWvo-0004Ww-3q for ged-emacs-devel@m.gmane.org; Tue, 17 Feb 2009 21:52:40 +0100 Original-Received: from localhost ([127.0.0.1]:43551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LZWuU-0001Us-2o for ged-emacs-devel@m.gmane.org; Tue, 17 Feb 2009 15:51:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LZWuO-0001Rh-FC for emacs-devel@gnu.org; Tue, 17 Feb 2009 15:51:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LZWuM-0001QK-TM for emacs-devel@gnu.org; Tue, 17 Feb 2009 15:51:11 -0500 Original-Received: from [199.232.76.173] (port=46967 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LZWuM-0001QG-MA for emacs-devel@gnu.org; Tue, 17 Feb 2009 15:51:10 -0500 Original-Received: from mtaout7.012.net.il ([84.95.2.19]:48826) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LZWuK-0007CW-FA; Tue, 17 Feb 2009 15:51:08 -0500 Original-Received: from conversion-daemon.i-mtaout7.012.net.il by i-mtaout7.012.net.il (HyperSendmail v2007.08) id <0KF800I009WTSO00@i-mtaout7.012.net.il>; Tue, 17 Feb 2009 22:51:10 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.228.82.14]) by i-mtaout7.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KF80093Z9X9B0R0@i-mtaout7.012.net.il>; Tue, 17 Feb 2009 22:51:10 +0200 (IST) In-reply-to: <871vtw95s4.fsf@catnip.gol.com> 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:109147 Archived-At: > From: Miles Bader > Date: Wed, 18 Feb 2009 05:18:03 +0900 > > Eli Zaretskii writes: > >> + 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? > > If the system isn't capable of handling large files at all, then there's > no point in worrying about it, right? Some systems can handle large files, but only if you use something like off64_t. > >> + 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? > > No. The values being represented are integers. The user almost > certainly will not be passing in a non-integral float I was thinking about 1234.99999 or some such, due to inaccuracies in converting textual representation into a float. > Maybe it should guard against overflow in the conversion though (and > signal an error?). Yes, probably.