List for cgit developers and users
 help / color / mirror / Atom feed
From: john at keeping.me.uk (John Keeping)
Subject: [PATCH 2/6] ui-snapshot: set unused cgit_filter fields to zero
Date: Sun, 12 Jan 2014 17:13:49 +0000	[thread overview]
Message-ID: <ee6486e49175eed4044054e71d6b095fa9b858ef.1389546691.git.john@keeping.me.uk> (raw)
In-Reply-To: <cover.1389546691.git.john@keeping.me.uk>

By switching the assignment of fields in the cgit_filter structure to
use designated initializers, the compiler will initialize all other
fields to their default value.  This will be needed when we add the
extra_args field in the next patch.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 ui-snapshot.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ui-snapshot.c b/ui-snapshot.c
index 8f82119..5136c49 100644
--- a/ui-snapshot.c
+++ b/ui-snapshot.c
@@ -58,10 +58,10 @@ static int write_compressed_tar_archive(const char *hex,
 					char *filter_argv[])
 {
 	int rv;
-	struct cgit_filter f;
-
-	f.cmd = filter_argv[0];
-	f.argv = filter_argv;
+	struct cgit_filter f = {
+		.cmd = filter_argv[0],
+		.argv = filter_argv,
+	};
 	cgit_open_filter(&f);
 	rv = write_tar_archive(hex, prefix);
 	cgit_close_filter(&f);
-- 
1.8.5.226.g0d60d77



  parent reply	other threads:[~2014-01-12 17:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-12 17:13 [RFC/PATCH 0/6] Preparation for more filter types john
2014-01-12 17:13 ` [PATCH 1/6] html: remove redundant htmlfd variable john
2014-01-12 19:11   ` Jason
2014-01-12 17:13 ` john [this message]
2014-01-12 17:13 ` [PATCH 3/6] filter: pass extra arguments via cgit_open_filter john
2014-01-12 19:20   ` Jason
2014-01-12 17:13 ` [PATCH 4/6] filter: add fprintf_filter function john
2014-01-12 19:23   ` Jason
2014-01-12 19:35     ` john
2014-01-12 19:40       ` Jason
2014-01-12 17:13 ` [PATCH 5/6] filter: add interface layer john
2014-01-12 17:13 ` [PATCH 6/6] filter: introduce "filter type" prefix john

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=ee6486e49175eed4044054e71d6b095fa9b858ef.1389546691.git.john@keeping.me.uk \
    --to=cgit@lists.zx2c4.com \
    /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).