1 Return-Path: <jani@nikula.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by arlo.cworth.org (Postfix) with ESMTP id B6F846DE0924
\r
6 for <notmuch@notmuchmail.org>; Fri, 25 Sep 2015 11:47:57 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=-0.521 tagged_above=-999 required=5 tests=[AWL=0.199,
\r
12 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01]
\r
14 Received: from arlo.cworth.org ([127.0.0.1])
\r
15 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id YYRrfe4EnDiV for <notmuch@notmuchmail.org>;
\r
17 Fri, 25 Sep 2015 11:47:56 -0700 (PDT)
\r
18 Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com
\r
20 by arlo.cworth.org (Postfix) with ESMTPS id B117B6DE02D2
\r
21 for <notmuch@notmuchmail.org>; Fri, 25 Sep 2015 11:47:55 -0700 (PDT)
\r
22 Received: by wiclk2 with SMTP id lk2so31076924wic.1
\r
23 for <notmuch@notmuchmail.org>; Fri, 25 Sep 2015 11:47:53 -0700 (PDT)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=1e100.net; s=20130820;
\r
26 h=x-gm-message-state:from:to:cc:subject:date:message-id;
\r
27 bh=wJkOMnk94WYIFe6F7GiEPhSBNnbXJ+yIKeEWFvCerC8=;
\r
28 b=UcQg76tx74zzxdzF/AJacwJhd+3DihXSK6Rfllp4OaebDIu+ZyAv8CN6GHnnPfcyhy
\r
29 YhEaJgRuAX+m0rKpTNW9NlDahSOU5TTKL1P3/pv1wGw8BWVRu9o4HKBUERUxnabH0Hup
\r
30 aVGHw0nopzwEw1ksqawzZjHwhT9yArMXz76HxGb4kYlIGiqhxxQ/0GqEZq4lubisLtS4
\r
31 nJTJG2ZBB7ALW//LD0HI84pFns+8j1gpB4VqZK3VHc4hd6xeaC8Hc3JlsZKZR8ODdiBp
\r
32 bmD9tLl4gKR6hlBsDg6mQCVBSbwzA1/LbkJcnJOrAe/evZD7jY7QGqmJ+cCzaE8N2xsf
\r
35 ALoCoQktkxjT0RVv499eFLQUDyrj9az6hGIy5bge58rHB7DiMOE9nOn4VqUuDZf1XyoB6v+FZiR4
\r
36 X-Received: by 10.180.230.197 with SMTP id ta5mr4896059wic.26.1443206873666;
\r
37 Fri, 25 Sep 2015 11:47:53 -0700 (PDT)
\r
38 Received: from localhost (mobile-access-bcee63-221.dhcp.inet.fi.
\r
40 by smtp.gmail.com with ESMTPSA id h7sm4659383wjz.7.2015.09.25.11.47.52
\r
41 (version=TLSv1/SSLv3 cipher=OTHER);
\r
42 Fri, 25 Sep 2015 11:47:52 -0700 (PDT)
\r
43 From: Jani Nikula <jani@nikula.org>
\r
44 To: notmuch@notmuchmail.org
\r
45 Subject: [PATCH] cli: use designated initializer to initialize add_files_state
\r
46 Date: Fri, 25 Sep 2015 21:47:35 +0300
\r
47 Message-Id: <1443206855-21701-1-git-send-email-jani@nikula.org>
\r
48 X-Mailer: git-send-email 2.1.4
\r
49 X-BeenThere: notmuch@notmuchmail.org
\r
50 X-Mailman-Version: 2.1.18
\r
52 List-Id: "Use and development of the notmuch mail system."
\r
53 <notmuch.notmuchmail.org>
\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
57 List-Post: <mailto:notmuch@notmuchmail.org>
\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
60 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
61 X-List-Received-Date: Fri, 25 Sep 2015 18:47:57 -0000
\r
63 The side effect is that all of add_files_state will be initialized to
\r
64 zero, removing any lingering doubt that some of it might not be
\r
65 initialized. It's not a small struct, and the initialization is
\r
66 scattered around a bit, so this makes the code more readable.
\r
68 notmuch-new.c | 13 +++++--------
\r
69 1 file changed, 5 insertions(+), 8 deletions(-)
\r
71 diff --git a/notmuch-new.c b/notmuch-new.c
\r
72 index 33645349cd5f..442a2f0ae288 100644
\r
75 @@ -933,7 +933,11 @@ int
\r
76 notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])
\r
78 notmuch_database_t *notmuch;
\r
79 - add_files_state_t add_files_state;
\r
80 + add_files_state_t add_files_state = {
\r
81 + .verbosity = VERBOSITY_NORMAL,
\r
83 + .output_is_a_tty = isatty (fileno (stdout)),
\r
85 struct timeval tv_start;
\r
88 @@ -948,10 +952,6 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])
\r
89 notmuch_bool_t quiet = FALSE, verbose = FALSE;
\r
90 notmuch_status_t status;
\r
92 - add_files_state.verbosity = VERBOSITY_NORMAL;
\r
93 - add_files_state.debug = FALSE;
\r
94 - add_files_state.output_is_a_tty = isatty (fileno (stdout));
\r
96 notmuch_opt_desc_t options[] = {
\r
97 { NOTMUCH_OPT_BOOLEAN, &quiet, "quiet", 'q', 0 },
\r
98 { NOTMUCH_OPT_BOOLEAN, &verbose, "verbose", 'v', 0 },
\r
99 @@ -1086,9 +1086,6 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])
\r
100 talloc_free (dot_notmuch_path);
\r
101 dot_notmuch_path = NULL;
\r
103 - add_files_state.processed_files = 0;
\r
104 - add_files_state.added_messages = 0;
\r
105 - add_files_state.removed_messages = add_files_state.renamed_messages = 0;
\r
106 gettimeofday (&add_files_state.tv_start, NULL);
\r
108 add_files_state.removed_files = _filename_list_create (config);
\r