From: "René Scharfe" <l.s.r@web.de>
To: Jeff King <peff@peff.net>
Cc: Git Mailing List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>, Johannes Sixt <j6t@kdbg.org>
Subject: Re: [PATCH] run-command: introduce CHILD_PROCESS_INIT
Date: Sun, 17 Aug 2014 09:25:58 +0200 [thread overview]
Message-ID: <53F05906.9070909@web.de> (raw)
In-Reply-To: <20140817071230.GB23808@peff.net>
Am 17.08.2014 um 09:12 schrieb Jeff King:
> On Sun, Aug 17, 2014 at 12:55:23AM +0200, René Scharfe wrote:
>
>> Most struct child_process variables are cleared using memset right after
>> declaration. Provide a macro, CHILD_PROCESS_INIT, that can be used to
>> initialize them statically instead. That's shorter, doesn't require a
>> function call and is slightly more readable (especially given that we
>> already have similar macros like STRBUF_INIT, ARGV_ARRAY_INIT etc.).
>
> I think one reason we never had an INIT macro here is that you cannot
> simply use the struct after zero-ing it anyway. That's just the first
> step, and then you have to tweak a bunch of fields to get what you want.
> So the memset is just one setup line out of many.
Some (or most?) of these steps could be converted to named
initializers -- once all supported platforms provide them..
René
next prev parent reply other threads:[~2014-08-17 7:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-16 22:55 [PATCH] run-command: introduce CHILD_PROCESS_INIT René Scharfe
2014-08-17 7:12 ` Jeff King
2014-08-17 7:25 ` René Scharfe [this message]
2014-08-17 7:29 ` Jeff King
2014-08-17 7:46 ` Johannes Sixt
2014-08-17 8:48 ` Jeff King
2014-08-18 16:59 ` Junio C Hamano
2014-08-19 19:09 ` [PATCH v2 1/4] " René Scharfe
2014-08-19 19:10 ` [PATCH v2 2/4] run-command: introduce child_process_init() René Scharfe
2014-08-19 19:11 ` [PATCH v2 3/4] run-command: call run_command_v_opt_cd_env() instead of duplicating it René Scharfe
2014-08-19 19:11 ` [PATCH v2 4/4] run-command: inline prepare_run_command_v_opt() René Scharfe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53F05906.9070909@web.de \
--to=l.s.r@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j6t@kdbg.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).