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: Buffer size limitation in insdel.c Date: Thu, 23 Sep 2010 15:22:09 +0200 Message-ID: <83hbhgvblq.fsf@gnu.org> References: <834odivv7v.fsf@gnu.org> <83r5gkvqpf.fsf@gnu.org> <83iq1wvep4.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1285248145 28110 80.91.229.12 (23 Sep 2010 13:22:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 23 Sep 2010 13:22:25 +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 15:22:24 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 1Oylkl-0002ZW-Pp for ged-emacs-devel@m.gmane.org; Thu, 23 Sep 2010 15:22:24 +0200 Original-Received: from localhost ([127.0.0.1]:51812 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oylkl-00078F-2y for ged-emacs-devel@m.gmane.org; Thu, 23 Sep 2010 09:22:23 -0400 Original-Received: from [140.186.70.92] (port=38945 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oylke-000788-Jm for emacs-devel@gnu.org; Thu, 23 Sep 2010 09:22:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oylkb-00041R-1z for emacs-devel@gnu.org; Thu, 23 Sep 2010 09:22:16 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:40441) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oylka-000415-P7 for emacs-devel@gnu.org; Thu, 23 Sep 2010 09:22:12 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0L9700600BQZCO00@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Thu, 23 Sep 2010 15:22:11 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.127.203.3]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L97006QMBSTA820@a-mtaout22.012.net.il>; Thu, 23 Sep 2010 15:22:11 +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:130662 Archived-At: > From: Lars Magne Ingebrigtsen > Date: Thu, 23 Sep 2010 14:47:23 +0200 > > A few general questions: > > dispnew.c:783: warning: conversion to 'int' from 'Lisp_Object' may alter its value > > matrix->window_left_col = WINDOW_LEFT_EDGE_COL (w); > > What's the right fix here? make window_left_col EMACS_INT, and slap an > XINT around the WINDOW_LEFT_EDGE_COL? I don't see this warning with "gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)". And I don't see how you could possibly get it, since window_left_edge_col is an int, whereas WINDOW_LEFT_EDGE_COL is defined like this: #define WINDOW_LEFT_EDGE_COL(W) \ (XFASTINT ((W)->left_col)) So it already extracts the integer from a Lisp_Object. What am I missing? > dispnew.c:2178: warning: conversion to 'long unsigned int' from 'short int' may change the sign of the result > > size_t nbytes = from->used[TEXT_AREA] * sizeof (struct glyph); Something like size_t nbytes; if (from->used[TEXT_AREA] > 0) nbytes = from->used[TEXT_AREA] * sizeof (struct glyph); else nbytes = 0; Or just leave it alone, it obviously isn't in the way of using large buffers on 64-bit hosts. And btw, I don't see that warning, either.