From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Booleans Date: Mon, 16 Dec 2013 09:28:49 -0800 Organization: UCLA Computer Science Department Message-ID: <52AF3851.4050007@cs.ucla.edu> References: <83vbyqdncv.fsf@gnu.org> <52AE3556.6080704@cs.ucla.edu> <52AEAE22.1020702@poczta.onet.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1387214957 10890 80.91.229.3 (16 Dec 2013 17:29:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Dec 2013 17:29:17 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 16 18:29:23 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vsbyq-0004Sk-Pz for ged-emacs-devel@m.gmane.org; Mon, 16 Dec 2013 18:29:20 +0100 Original-Received: from localhost ([::1]:57366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vsbyq-0004Ao-E4 for ged-emacs-devel@m.gmane.org; Mon, 16 Dec 2013 12:29:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vsbyg-00045r-L8 for emacs-devel@gnu.org; Mon, 16 Dec 2013 12:29:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsbyZ-0002Hv-BJ for emacs-devel@gnu.org; Mon, 16 Dec 2013 12:29:10 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:49287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsbyZ-0002Gk-3W for emacs-devel@gnu.org; Mon, 16 Dec 2013 12:29:03 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 55CA139E8100 for ; Mon, 16 Dec 2013 09:28:55 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id crz7GJA0C2kq for ; Mon, 16 Dec 2013 09:28:54 -0800 (PST) Original-Received: from [192.168.1.9] (pool-108-0-233-62.lsanca.fios.verizon.net [108.0.233.62]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id CB78139E80FF for ; Mon, 16 Dec 2013 09:28:54 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: <52AEAE22.1020702@poczta.onet.pl> X-Enigmail-Version: 1.6 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:166492 Archived-At: Stefan Monnier wrote: > it's better to do it only where you already make other changes. Ah, I interpreted that to mean "while you're in the same file", but I guess you meant "while you're in the same line", or something like that. It seemed odd to change a declaration from 'int foo = 0;' to 'bool foo = 0;', while leaving a later 'foo = 1' undisturbed because it's far from the declaration, which is why I took a more expansive interpretation. Here's the state of the 'bool' pass so far. *.h files now use 'bool', 'true', and 'false' for boolean, because of the most-recent big patch. .c files from src/alloc.c through src/undo.c now use 'bool' but not 'true' and 'false', because of earlier patches. The remaining .c files largely have yet to be looked at systematically; I suppose I might change them to use 'bool', and to use 'true' and 'false' if connected to a 'bool' change, while leaving constructions like 'while (0)' and '#if 0' alone. Obviously none of this is urgent. Eli Zaretskii wrote: > you also removed several struct members in that hunk. They were mostly unused int members that were probably intended to be bool. Rather than try to guess types it was simpler to remove unused members. This part of Emacs is so little used that it doesn't really matter much. > "#if false" looks very odd to me, I don't think I've ever seen that. It won't appear in any code intended to be portable to pre-C99 (at least, not without something like gnulib), which is why it looks "funny" to developers whose experience is based on such programs. If people prefer "#if 0" that's fine. Jarek Czekalski wrote: > Was it a private discussion? Yes. In relatively-unimportant matters, communicating privately often saves everybody time. One can't always judge in advance which cases these will be, alas. > Why this single change should be a separate commit? In the past, I've been asked to not use lots of little commits for related changes; I've also been asked to not have one big commit when changes can be separated out. So I try to use my best judgment as to which method to use, and (as we've seen here) my judgment is fallible.