From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philippe Vaucher Newsgroups: gmane.emacs.devel Subject: Re: Preview: portable dumper Date: Wed, 30 Nov 2016 09:26:34 +0100 Message-ID: References: <047a67ec-9e29-7e4e-0fb0-24c3e59b5886@dancol.org> <83zikjxt1j.fsf@gnu.org> <721b8fb1-5672-778e-b68f-a68b53308f55@cs.ucla.edu> <83vav7xs1p.fsf@gnu.org> <83twarxq6f.fsf@gnu.org> <834m2qrux9.fsf@gnu.org> <83wpfmqcch.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f403045e3158569ae50542807842 X-Trace: blaine.gmane.org 1480494443 11617 195.159.176.226 (30 Nov 2016 08:27:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 30 Nov 2016 08:27:23 +0000 (UTC) Cc: Eli Zaretskii , Paul Eggert , Emacs developers To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 30 09:27:19 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cC0EV-00021f-Q9 for ged-emacs-devel@m.gmane.org; Wed, 30 Nov 2016 09:27:15 +0100 Original-Received: from localhost ([::1]:41941 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cC0EZ-0007Mo-7r for ged-emacs-devel@m.gmane.org; Wed, 30 Nov 2016 03:27:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cC0ER-0007MX-Vw for emacs-devel@gnu.org; Wed, 30 Nov 2016 03:27:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cC0ER-0008MR-5U for emacs-devel@gnu.org; Wed, 30 Nov 2016 03:27:11 -0500 Original-Received: from mail-ua0-x232.google.com ([2607:f8b0:400c:c08::232]:35665) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cC0EM-0008Jd-AY; Wed, 30 Nov 2016 03:27:06 -0500 Original-Received: by mail-ua0-x232.google.com with SMTP id 12so205829511uas.2; Wed, 30 Nov 2016 00:27:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6Z0BywS1KhXYOXbcVv6Fy8bNftozitOeBovQD8HoKqE=; b=eAgZEyjC83IRFIHOZKbfH3vPoM4gdHEmxi3zLQHiiyPt/zmpMxtaeKUjTDHANskK5J YsEPZ7f7i5wB/cGizbH2+un9DkfzXv99jB/2oGqcbbQJRvPC3HK9rMUvESSDtm0PG27S 2T6uyxeCUFKo7rHyFItvUafuo0l0xR0ey+z3Mi3DUTTFJNdU8la5unbla2woRmLA4Cxu 1uvK1R7822GORdI19enQuEZpGPdXMOAK27z+P4gDfLt2WQeRiHQ/6xPriydutI+MoDSm XZCD0RuHOhQRlKuvYj2CVIh7bwrirWnSwIULkPuenVd+0qZJTnqXRQwdL2XxIq51FUOs +yUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6Z0BywS1KhXYOXbcVv6Fy8bNftozitOeBovQD8HoKqE=; b=KXvH1DkSCujNpcBrmetAWeP3gA7RD1fW8zGkoieB8etVD/sQzpmPLN2OV1n8wV/qjf 7pMoboo0I5n466z/830vN9xfg/14KfyjbNCF8mo7zb99FlhqKMnxP6w7cEw/ExI2W6Fm e+9ZeHWMQZQ3y1qin1gmXCvqn7sKNvSWXdPlgqrZjxfcFRsCPA7+5lOZngyfuD9WRGE6 dOnMX6kVBhQSLKPk+EpQCCpcgZ/jpjLhsQoLt5tl+MAPvV/k5PKABHIWb+lZUGSXX83j xfiRv/VhnntPIwBrwMoHTqAoQFSr/XtMaW36EoM1SiCMnkKUvYCEn9IhJxH+yjwFDoSX t06w== X-Gm-Message-State: AKaTC00H8Cwr24kXoRpaGWrSwO9niKBxcQNr53ZY/yLxYBB0LAl339o9bUIaKDEgPcSRpcgyTz72BcTiu/4tqQ== X-Received: by 10.176.16.2 with SMTP id f2mr19657134uab.49.1480494425740; Wed, 30 Nov 2016 00:27:05 -0800 (PST) Original-Received: by 10.103.125.149 with HTTP; Wed, 30 Nov 2016 00:26:34 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c08::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:209788 Archived-At: --f403045e3158569ae50542807842 Content-Type: text/plain; charset=UTF-8 > > As a matter of general taste, I _much_ prefer this style: > > #ifdef HAVE_FOO > void foo_thing (void); > #else > # define foo_thing() ((void)0) > #endif > > void > function1() > { > ... > foo_thing(); > ... > } > > to this style: > > void > function1() > { > ... > #ifdef HAVE_FOO > foo_thing(); > #endif > ... > } > > void function2() > { > ... > #ifdef HAVE_FOO > foo_thing(); > #endif > ... > } > +1 ifdefs should be as much out of the way of the code as possible in my honest opinion. Philippe --f403045e3158569ae50542807842 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
As a matter of general taste, I _much_ prefer th= is style:

=C2=A0 =C2=A0 #ifdef HAVE_FOO
=C2=A0 =C2=A0 =C2=A0 =C2=A0 void foo_thing (void);
=C2=A0 =C2=A0 #else
=C2=A0 =C2=A0 # define foo_thing() ((void)0)
=C2=A0 =C2=A0 #endif

=C2=A0 =C2=A0 =C2=A0 =C2=A0 void
=C2=A0 =C2=A0 =C2=A0 =C2=A0 function1()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 foo_thing();
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

to this style:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 void
=C2=A0 =C2=A0 =C2=A0 =C2=A0 function1()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 #ifdef HAVE_FOO
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 foo_thing();
=C2=A0 =C2=A0 #endif
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 =C2=A0 void function2()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 #ifdef HAVE_FOO
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 foo_thing();
=C2=A0 =C2=A0 #endif
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }


+1

ifdefs should be as much out of the way o= f the code as possible in my honest opinion.=C2=A0

Philippe
--f403045e3158569ae50542807842--