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: [Emacs-diffs] /srv/bzr/emacs/trunk r109264: * alloc.c (Fgarbage_collect): Indent as per usual Emacs style. Date: Tue, 31 Jul 2012 16:28:18 -0700 Organization: UCLA Computer Science Department Message-ID: <50186A12.9080302@cs.ucla.edu> References: <50170EF9.1010307@cs.ucla.edu> <50177A23.3070509@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1343777309 4756 80.91.229.3 (31 Jul 2012 23:28:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 31 Jul 2012 23:28:29 +0000 (UTC) Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 01 01:28:25 2012 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 1SwLrT-0004l5-MF for ged-emacs-devel@m.gmane.org; Wed, 01 Aug 2012 01:28:23 +0200 Original-Received: from localhost ([::1]:35571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwLrS-00065j-Sb for ged-emacs-devel@m.gmane.org; Tue, 31 Jul 2012 19:28:22 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwLrQ-00065T-1y for emacs-devel@gnu.org; Tue, 31 Jul 2012 19:28:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwLrO-00071T-RV for emacs-devel@gnu.org; Tue, 31 Jul 2012 19:28:19 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:37869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwLrO-00071K-Iq; Tue, 31 Jul 2012 19:28:18 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id F3ACBA60007; Tue, 31 Jul 2012 16:28:16 -0700 (PDT) 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 iDOUJD2QLPU3; Tue, 31 Jul 2012 16:28:16 -0700 (PDT) Original-Received: from [192.168.1.4] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 4CBA139E800A; Tue, 31 Jul 2012 16:28:16 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:152059 Archived-At: On 07/31/2012 03:31 PM, Richard Stallman wrote: > When the initializer is long and in braces, it's ok to break > after the = sign and put the open brace in column zero, > because that makes the whole initializer a defun. OK, that blesses some of the use of trailing '=' in lines, but there are still lots of places where the style guideline isn't being followed now. Would it be a good idea to change this systematically, with patches like the following? (This patch is just a sample: it covers just src/alloc.c.) === modified file 'src/alloc.c' *** src/alloc.c 2012-07-31 12:36:19 +0000 --- src/alloc.c 2012-07-31 23:22:42 +0000 *************** *** 537,552 **** - XMALLOC_OVERRUN_CHECK_SIZE) static char const xmalloc_overrun_check_header[XMALLOC_OVERRUN_CHECK_SIZE] = ! { '\x9a', '\x9b', '\xae', '\xaf', ! '\xbf', '\xbe', '\xce', '\xcf', ! '\xea', '\xeb', '\xec', '\xed', ! '\xdf', '\xde', '\x9c', '\x9d' }; static char const xmalloc_overrun_check_trailer[XMALLOC_OVERRUN_CHECK_SIZE] = ! { '\xaa', '\xab', '\xac', '\xad', ! '\xba', '\xbb', '\xbc', '\xbd', ! '\xca', '\xcb', '\xcc', '\xcd', ! '\xda', '\xdb', '\xdc', '\xdd' }; /* Insert and extract the block size in the header. */ --- 537,556 ---- - XMALLOC_OVERRUN_CHECK_SIZE) static char const xmalloc_overrun_check_header[XMALLOC_OVERRUN_CHECK_SIZE] = ! { ! '\x9a', '\x9b', '\xae', '\xaf', ! '\xbf', '\xbe', '\xce', '\xcf', ! '\xea', '\xeb', '\xec', '\xed', ! '\xdf', '\xde', '\x9c', '\x9d' ! }; static char const xmalloc_overrun_check_trailer[XMALLOC_OVERRUN_CHECK_SIZE] = ! { ! '\xaa', '\xab', '\xac', '\xad', ! '\xba', '\xbb', '\xbc', '\xbd', ! '\xca', '\xcb', '\xcc', '\xcd', ! '\xda', '\xdb', '\xdc', '\xdd' ! }; /* Insert and extract the block size in the header. */ *************** *** 1135,1142 **** } abase = ABLOCK_ABASE (free_ablock); ! ABLOCKS_BUSY (abase) = ! (struct ablocks *) (2 + (intptr_t) ABLOCKS_BUSY (abase)); val = free_ablock; free_ablock = free_ablock->x.next_free; --- 1139,1146 ---- } abase = ABLOCK_ABASE (free_ablock); ! ABLOCKS_BUSY (abase) ! = (struct ablocks *) (2 + (intptr_t) ABLOCKS_BUSY (abase)); val = free_ablock; free_ablock = free_ablock->x.next_free; *************** *** 1728,1735 **** presence of this cookie during GC. */ #define GC_STRING_OVERRUN_COOKIE_SIZE 4 ! static char const string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] = ! { '\xde', '\xad', '\xbe', '\xef' }; #else #define GC_STRING_OVERRUN_COOKIE_SIZE 0 --- 1732,1739 ---- presence of this cookie during GC. */ #define GC_STRING_OVERRUN_COOKIE_SIZE 4 ! static char const string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] ! = { '\xde', '\xad', '\xbe', '\xef' }; #else #define GC_STRING_OVERRUN_COOKIE_SIZE 0 *************** *** 1774,1786 **** STRING_BYTES_BOUND, nor can it be so long that the size_t arithmetic in allocate_string_data would overflow while it is calculating a value to be passed to malloc. */ ! static ptrdiff_t const STRING_BYTES_MAX = ! min (STRING_BYTES_BOUND, ! ((SIZE_MAX - XMALLOC_OVERRUN_CHECK_OVERHEAD ! - GC_STRING_EXTRA ! - offsetof (struct sblock, first_data) ! - SDATA_DATA_OFFSET) ! & ~(sizeof (EMACS_INT) - 1))); /* Initialize string allocation. Called from init_alloc_once. */ --- 1778,1790 ---- STRING_BYTES_BOUND, nor can it be so long that the size_t arithmetic in allocate_string_data would overflow while it is calculating a value to be passed to malloc. */ ! static ptrdiff_t const STRING_BYTES_MAX ! = min (STRING_BYTES_BOUND, ! ((SIZE_MAX - XMALLOC_OVERRUN_CHECK_OVERHEAD ! - GC_STRING_EXTRA ! - offsetof (struct sblock, first_data) ! - SDATA_DATA_OFFSET) ! & ~(sizeof (EMACS_INT) - 1))); /* Initialize string allocation. Called from init_alloc_once. */ *************** *** 1802,1809 **** ptrdiff_t string_bytes (struct Lisp_String *s) { ! ptrdiff_t nbytes = ! (s->size_byte < 0 ? s->size & ~ARRAY_MARK_FLAG : s->size_byte); if (!PURE_POINTER_P (s) && s->data --- 1806,1813 ---- ptrdiff_t string_bytes (struct Lisp_String *s) { ! ptrdiff_t nbytes ! = (s->size_byte < 0 ? s->size & ~ARRAY_MARK_FLAG : s->size_byte); if (!PURE_POINTER_P (s) && s->data *************** *** 5685,5693 **** #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES { /* Compute average percentage of zombies. */ ! double nlive = ! (total_conses + total_symbols + total_markers + total_strings ! + total_vectors + total_floats + total_intervals + total_buffers); avg_live = (avg_live * ngcs + nlive) / (ngcs + 1); max_live = max (nlive, max_live); --- 5689,5697 ---- #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES { /* Compute average percentage of zombies. */ ! double nlive ! = (total_conses + total_symbols + total_markers + total_strings ! + total_vectors + total_floats + total_intervals + total_buffers); avg_live = (avg_live * ngcs + nlive) / (ngcs + 1); max_live = max (nlive, max_live);