From unknown Fri Aug 15 17:55:22 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#25331 <25331@debbugs.gnu.org> To: bug#25331 <25331@debbugs.gnu.org> Subject: Status: [PATCH] Unwrap single statement code blocks Reply-To: bug#25331 <25331@debbugs.gnu.org> Date: Sat, 16 Aug 2025 00:55:22 +0000 retitle 25331 [PATCH] Unwrap single statement code blocks reassign 25331 emacs submitter 25331 Chris Gregory severity 25331 wishlist tag 25331 patch notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 02 03:19:52 2017 Received: (at submit) by debbugs.gnu.org; 2 Jan 2017 08:19:52 +0000 Received: from localhost ([127.0.0.1]:39001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNxqS-0004kt-DN for submit@debbugs.gnu.org; Mon, 02 Jan 2017 03:19:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNxqQ-0004kf-1f for submit@debbugs.gnu.org; Mon, 02 Jan 2017 03:19:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cNxqJ-0001OH-6T for submit@debbugs.gnu.org; Mon, 02 Jan 2017 03:19:44 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39584) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cNxqJ-0001O7-20 for submit@debbugs.gnu.org; Mon, 02 Jan 2017 03:19:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNxqH-00084e-Ka for bug-gnu-emacs@gnu.org; Mon, 02 Jan 2017 03:19:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cNxqC-0001L2-Lz for bug-gnu-emacs@gnu.org; Mon, 02 Jan 2017 03:19:41 -0500 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:33797) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cNxqC-0001KQ-G6 for bug-gnu-emacs@gnu.org; Mon, 02 Jan 2017 03:19:36 -0500 Received: by mail-pg0-x244.google.com with SMTP id b1so29844189pgc.1 for ; Mon, 02 Jan 2017 00:19:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=AXUHixqb8Yt2aXBRrASX6LIw1TbHtGG/TuvcuLmXqbI=; b=kwPBDXWXKWVyRmdRi9q/FULXLwwXQm3k52n0cxRjZLRX0gMKR5XoYDIJ6dktDfxfrl sjYBgC6yoGi/MVWhH1y8BzECjgOvSY0c/KHMZ/qyfW4S5dLEpZ7qZX/i2l6CHQYxEg05 a1z+bmbcgDS+UHVSwng19Oevzn6D3Ib0n5hU2RRyzqq6yUqXfq4LZEgUWyCwFA/JZrhL CU6sf0NlHpHqblqnECKQ4omEOYC76HHfV3NIGr457IC3KoCYz7ThZUDSkeub2XEPOnNq TCStLIYrM3x4SNzwA7E8xeLE4Vdf3xOtf1mMmagqXHT/PZ8zScK+0LUY35YwKYFO9SRK x/tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=AXUHixqb8Yt2aXBRrASX6LIw1TbHtGG/TuvcuLmXqbI=; b=s6VspyN1g6leVTmlj0+cMZO9aPlkwwl62GTwpsFogbsuIp6qjMyiiH0r3QGJv32LLU A83OKr7XW/V93IljUYXIKNepwIu18yljwKtb+2by2ekVF2JwDFZjcmagJ30bMRLcpPhq GSYASebNl/Ve08rtXbBm6V6ye+2ob3Huy9s/4vJpHNTAMwBqJhB2jqcx6DsTrdXYpoDj tqDzGxskdQiuGCC240oAb1R3GaIHK1H0lLcL29kujP48o8dDYY0GLYFWXTrTeWctqmLl moeeCtK/ZSnItWy2qa+YAtm1xfCxJnceCUzRvvBb7gHlbTVzAniJEmhWzqf4EsQl0RWp CGnw== X-Gm-Message-State: AIkVDXKzUoXmA55vYYp7cdsUWS15/gn20HXxwPNiEpz+9BakzUeOrOsx3EHMwrLBsivmkA== X-Received: by 10.84.225.129 with SMTP id u1mr123872785plj.110.1483345175107; Mon, 02 Jan 2017 00:19:35 -0800 (PST) Received: from CzipperZeroArch (c-50-139-114-145.hsd1.or.comcast.net. [50.139.114.145]) by smtp.gmail.com with ESMTPSA id 16sm129859781pfy.4.2017.01.02.00.19.34 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jan 2017 00:19:34 -0800 (PST) From: Chris Gregory To: bug-gnu-emacs@gnu.org Subject: [PATCH] Unwrap single statement code blocks Date: Mon, 02 Jan 2017 00:19:26 -0800 Message-ID: <87k2addgc1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) This patch changes many blocks that look like: if (x) { statement; } to if (x) statement; -- Chris Gregory diff --git a/src/ralloc.c b/src/ralloc.c index 8a3d2b797f..0e1c2e41c5 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -178,10 +178,8 @@ find_heap (void *address) heap_ptr heap; for (heap = last_heap; heap; heap = heap->prev) - { - if (heap->start <= address && address <= heap->end) - return heap; - } + if (heap->start <= address && address <= heap->end) + return heap; return NIL_HEAP; } @@ -212,10 +210,8 @@ obtain (void *address, size_t size) /* Find the heap that ADDRESS falls within. */ for (heap = last_heap; heap; heap = heap->prev) - { - if (heap->start <= address && address <= heap->end) - break; - } + if (heap->start <= address && address <= heap->end) + break; if (! heap) emacs_abort (); @@ -295,10 +291,8 @@ relinquish (void) in all heaps which have extend beyond break_value at all. */ for (h = last_heap; h && break_value < h->end; h = h->prev) - { - excess += (char *) h->end - (char *) ((break_value < h->bloc_start) - ? h->bloc_start : break_value); - } + excess += (char *) h->end - (char *) ((break_value < h->bloc_start) + ? h->bloc_start : break_value); if (excess > extra_bytes * 2 && real_morecore (0) == last_heap->end) { @@ -564,10 +558,8 @@ resize_bloc (bloc_ptr bloc, size_t size) return 1; for (heap = first_heap; heap != NIL_HEAP; heap = heap->next) - { - if (heap->bloc_start <= bloc->data && bloc->data <= heap->end) - break; - } + if (heap->bloc_start <= bloc->data && bloc->data <= heap->end) + break; if (heap == NIL_HEAP) emacs_abort (); @@ -663,9 +655,7 @@ free_bloc (bloc_ptr bloc) resize_bloc (bloc, 0); if (bloc == first_bloc && bloc == last_bloc) - { - first_bloc = last_bloc = NIL_BLOC; - } + first_bloc = last_bloc = NIL_BLOC; else if (bloc == last_bloc) { last_bloc = bloc->prev; @@ -858,10 +848,8 @@ r_alloc_sbrk (ptrdiff_t size) } if ((char *) virtual_break_value + size < (char *) first_heap->start) - { - /* We found an additional space below the first heap */ - first_heap->start = (void *) ((char *) virtual_break_value + size); - } + /* We found an additional space below the first heap */ + first_heap->start = (void *) ((char *) virtual_break_value + size); } virtual_break_value = (void *) ((char *) address + size); @@ -990,11 +978,8 @@ r_re_alloc (void **ptr, size_t size) else return NULL; } - else - { - if (! resize_bloc (bloc, MEM_ROUNDUP (size))) - return NULL; - } + else if (! resize_bloc (bloc, MEM_ROUNDUP (size))) + return NULL; } return *ptr; } From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 03:31:59 2017 Received: (at control) by debbugs.gnu.org; 7 Jan 2017 08:31:59 +0000 Received: from localhost ([127.0.0.1]:45583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPmPu-0001SQ-Uq for submit@debbugs.gnu.org; Sat, 07 Jan 2017 03:31:59 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPmPt-0001NU-G9 for control@debbugs.gnu.org; Sat, 07 Jan 2017 03:31:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cPmPl-0008QI-9V for control@debbugs.gnu.org; Sat, 07 Jan 2017 03:31:52 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPmPl-0008QE-6I; Sat, 07 Jan 2017 03:31:49 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1976 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cPmPk-00024Y-9A; Sat, 07 Jan 2017 03:31:48 -0500 Date: Sat, 07 Jan 2017 10:32:10 +0200 Message-Id: <83vatrb791.fsf@gnu.org> From: Eli Zaretskii To: Chris Gregory In-reply-to: <87k2addgc1.fsf@gmail.com> (message from Chris Gregory on Mon, 02 Jan 2017 00:19:26 -0800) Subject: Re: bug#25331: [PATCH] Unwrap single statement code blocks References: <87k2addgc1.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: control Cc: 25331@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) tags 25331 notabug close 25331 thanks > From: Chris Gregory > Date: Mon, 02 Jan 2017 00:19:26 -0800 > > This patch changes many blocks that look like: > > if (x) > { > statement; > } > > to > > if (x) > statement; Thanks, but I think the original style is better, as it makes more clear what is the body of the 'if'. Also, this again changes ralloc.c on whose maintenance I'd rather not spend any effort. From unknown Fri Aug 15 17:55:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 04 Feb 2017 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator