From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Emacs-diffs Digest, Vol 94, Issue 89 Date: Sat, 25 Sep 2010 15:19:37 +0200 Organization: Programmerer Ingebrigtsen Message-ID: References: <83zkv7rmpe.fsf@gnu.org> <83iq1us2hx.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1285420802 6146 80.91.229.12 (25 Sep 2010 13:20:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 25 Sep 2010 13:20:02 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 25 15:20:01 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 1OzUfY-0006Ur-PM for ged-emacs-devel@m.gmane.org; Sat, 25 Sep 2010 15:20:01 +0200 Original-Received: from localhost ([127.0.0.1]:35144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzUfY-0003dg-6s for ged-emacs-devel@m.gmane.org; Sat, 25 Sep 2010 09:20:00 -0400 Original-Received: from [140.186.70.92] (port=57885 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzUfN-0003dR-KK for emacs-devel@gnu.org; Sat, 25 Sep 2010 09:19:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzUfI-00041C-Pd for emacs-devel@gnu.org; Sat, 25 Sep 2010 09:19:49 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:47446) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzUfI-000417-CJ for emacs-devel@gnu.org; Sat, 25 Sep 2010 09:19:44 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OzUfH-0006Q9-LF for emacs-devel@gnu.org; Sat, 25 Sep 2010 15:19:43 +0200 Original-Received: from cm-84.215.34.171.getinternet.no ([84.215.34.171]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 25 Sep 2010 15:19:43 +0200 Original-Received: from larsi by cm-84.215.34.171.getinternet.no with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 25 Sep 2010 15:19:43 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 51 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cm-84.215.34.171.getinternet.no Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEWBhIsDAwX8/PxdXWPU 2N0ICAowMTT////+//4SEhX/JO+HAAACVklEQVQ4jVWUwYrbMBCGh5XxuTrkkFtRDZujWruG3Iwr Nj1uCAr4lkW7Aj2B97yX+Jg2jUFv25mxnGQHQsJ80v9rRqNAySEAI8ZYqRQFTAAY2O51BuoT6G47 EGjUmUC5/1kVrSnww0DPwO3eqkK1RaFMktKcF9bav6TyMXsIMQE81T/WH2ZzmGIdgntojfk9DMMH LPyVoJQdN0qtEAwgpdw7PnKwdmvtqcc4HhlIuaDFlLa2eyTQJyAXW2Rbiajb9BwJyIXE1VLegT+Y 9KhCW0iMpQi8yMX5xdqLTbHvE/gu93UX3KV725KSPc/gBSW8KzsH6+0nQH5e5A4LzImc7oA96Roy Y0xu78AS7y2WmvJMnmfwRdgYR835zKzt7gYCtvvAoMnj7bhLX4Y4jky0D5crkHT6McTKqKez92F3 B7AStMmKEEP01zqW2wnEEUK84NdDAjuow0j+cYwcXaUYPIvcHwoQdYy4z1NVjjoPJwSjadq2eIqj qwnEBwb5moRcpr7igDkfu0v8MYFwoUP5Q4ZtdFzuK4FziNjf6DEAnpzw1Ae+2iVtwHTp4ZBjG0IC eKfdiHkncIRF6YMP8XBEEGbwrSyxiyTpDzgQ4LFsAjSLWSMYsDmZoUXNz6GBmswqBiFO3hRVU9IK LtB7KsJPc60bUQoNmwn4ab2eXxZk3ETMoYNOOSiazEzdxZfmvWhgXqzm2SWAFSSQbomBFnVZtWnL 5gY0aKEb04ChYTzeAGS/EKhHdVXnGABaZRqjjsf+feBMjz/e8Tlnq/7DtOmfZTXwU17hz/9AaVrq Q1IuCQAAAABJRU5ErkJggg== Mail-Copies-To: never X-Now-Playing: LCD Soundsystem's _This Is Happening_: "You Wanted A Hit" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:mtG2/gQs9qbjzid2f8U8PE3Y3sQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:130838 Archived-At: Eli Zaretskii writes: >> >> - int frame_lines = FRAME_LINES (frame); >> >> + EMACS_INT frame_lines = FRAME_LINES (frame); [...] > So what is the practical guidance to Lars and others who go by the > warnings emitted by -Wconversion? Will the below be okay, for when an > small-valued EMACS_INT is assigned to an int: > > . if the source is EMACS_INT, consider making it an int; if that's > not possible, cast to int, preferably inside a macro > > . if the source is a Lisp_Object passed through XINT, cast to an int, > preferably inside an accessor macro So in this case FRAME_LINES should cast to an int before returning? Makes sense to me, and I can redo the stuff in that file based on that. Or just make these into ints: /* Size of this frame, excluding fringes, scroll bars etc., in units of canonical characters. */ EMACS_INT text_lines, text_cols; It does seem rather nonsensical to have them be EMACS_INT... Which reminds me about a question about characters. Can they really be longs? Let's see... DEFUN ("char-resolve-modifiers", Fchar_resolve_modifiers, ... (Lisp_Object character) { int c; CHECK_NUMBER (character); c = XINT (character); return make_number (char_resolve_modifier_mask (c)); } Hm. In that case it should perhaps actually be EMACS_INT, since the character comes from "user space". So that's a bad example. :-) But the general question is whether characters can be longs still stand, and whether there then should be like an XCHAR macro that does the same as XINT, but casts to int. -- (domestic pets only, the antidote for overdose, milk.) larsi@gnus.org * Lars Magne Ingebrigtsen