1 Return-Path: <tomi.ollila@iki.fi>
\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 E8A466DE0B64
\r
6 for <notmuch@notmuchmail.org>; Fri, 25 Sep 2015 12:19:35 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=0.785 tagged_above=-999 required=5 tests=[AWL=0.133,
\r
12 SPF_NEUTRAL=0.652] autolearn=disabled
\r
13 Received: from arlo.cworth.org ([127.0.0.1])
\r
14 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id zBu9vWhDHxfN for <notmuch@notmuchmail.org>;
\r
16 Fri, 25 Sep 2015 12:19:33 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by arlo.cworth.org (Postfix) with ESMTP id 7EF246DE02D2
\r
19 for <notmuch@notmuchmail.org>; Fri, 25 Sep 2015 12:19:33 -0700 (PDT)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id B0FB010008D;
\r
22 Fri, 25 Sep 2015 22:19:38 +0300 (EEST)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org
\r
25 Subject: Re: [PATCH] cli: use designated initializer to initialize
\r
27 In-Reply-To: <1443206855-21701-1-git-send-email-jani@nikula.org>
\r
28 References: <1443206855-21701-1-git-send-email-jani@nikula.org>
\r
29 User-Agent: Notmuch/0.20.2+68~g0c35549 (http://notmuchmail.org) Emacs/24.3.1
\r
30 (x86_64-unknown-linux-gnu)
\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
32 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
33 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
34 Date: Fri, 25 Sep 2015 22:19:38 +0300
\r
35 Message-ID: <m2mvwamhmd.fsf@guru.guru-group.fi>
\r
37 Content-Type: text/plain
\r
38 X-BeenThere: notmuch@notmuchmail.org
\r
39 X-Mailman-Version: 2.1.18
\r
41 List-Id: "Use and development of the notmuch mail system."
\r
42 <notmuch.notmuchmail.org>
\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
46 List-Post: <mailto:notmuch@notmuchmail.org>
\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
50 X-List-Received-Date: Fri, 25 Sep 2015 19:19:36 -0000
\r
52 On Fri, Sep 25 2015, Jani Nikula <jani@nikula.org> wrote:
\r
54 > The side effect is that all of add_files_state will be initialized to
\r
55 > zero, removing any lingering doubt that some of it might not be
\r
56 > initialized. It's not a small struct, and the initialization is
\r
57 > scattered around a bit, so this makes the code more readable.
\r
59 LGTM. Should I test ? ;/
\r
65 > notmuch-new.c | 13 +++++--------
\r
66 > 1 file changed, 5 insertions(+), 8 deletions(-)
\r
68 > diff --git a/notmuch-new.c b/notmuch-new.c
\r
69 > index 33645349cd5f..442a2f0ae288 100644
\r
70 > --- a/notmuch-new.c
\r
71 > +++ b/notmuch-new.c
\r
72 > @@ -933,7 +933,11 @@ int
\r
73 > notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])
\r
75 > notmuch_database_t *notmuch;
\r
76 > - add_files_state_t add_files_state;
\r
77 > + add_files_state_t add_files_state = {
\r
78 > + .verbosity = VERBOSITY_NORMAL,
\r
80 > + .output_is_a_tty = isatty (fileno (stdout)),
\r
82 > struct timeval tv_start;
\r
85 > @@ -948,10 +952,6 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])
\r
86 > notmuch_bool_t quiet = FALSE, verbose = FALSE;
\r
87 > notmuch_status_t status;
\r
89 > - add_files_state.verbosity = VERBOSITY_NORMAL;
\r
90 > - add_files_state.debug = FALSE;
\r
91 > - add_files_state.output_is_a_tty = isatty (fileno (stdout));
\r
93 > notmuch_opt_desc_t options[] = {
\r
94 > { NOTMUCH_OPT_BOOLEAN, &quiet, "quiet", 'q', 0 },
\r
95 > { NOTMUCH_OPT_BOOLEAN, &verbose, "verbose", 'v', 0 },
\r
96 > @@ -1086,9 +1086,6 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])
\r
97 > talloc_free (dot_notmuch_path);
\r
98 > dot_notmuch_path = NULL;
\r
100 > - add_files_state.processed_files = 0;
\r
101 > - add_files_state.added_messages = 0;
\r
102 > - add_files_state.removed_messages = add_files_state.renamed_messages = 0;
\r
103 > gettimeofday (&add_files_state.tv_start, NULL);
\r
105 > add_files_state.removed_files = _filename_list_create (config);
\r
109 > _______________________________________________
\r
110 > notmuch mailing list
\r
111 > notmuch@notmuchmail.org
\r
112 > http://notmuchmail.org/mailman/listinfo/notmuch
\r