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 olra.theworths.org (Postfix) with ESMTP id A103E431FB6
\r
6 for <notmuch@notmuchmail.org>; Sun, 7 Apr 2013 12:07:44 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id nyh7CrEnrElR for <notmuch@notmuchmail.org>;
\r
16 Sun, 7 Apr 2013 12:07:44 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id EA25F431FAE
\r
19 for <notmuch@notmuchmail.org>; Sun, 7 Apr 2013 12:07:43 -0700 (PDT)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id 362D1100093;
\r
22 Sun, 7 Apr 2013 22:07:43 +0300 (EEST)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org,
\r
25 Mark Walters <markwalters1009@gmail.com>
\r
26 Subject: Re: [PATCH] cli: mime node: fix compiler warning when building
\r
28 In-Reply-To: <1365248863-17947-1-git-send-email-jani@nikula.org>
\r
29 References: <1365248863-17947-1-git-send-email-jani@nikula.org>
\r
30 User-Agent: Notmuch/0.15.2+75~gd7fa7c4 (http://notmuchmail.org) Emacs/24.3.1
\r
31 (x86_64-unknown-linux-gnu)
\r
32 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
33 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
34 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
35 Date: Sun, 07 Apr 2013 22:07:42 +0300
\r
36 Message-ID: <m2ip3yi2gx.fsf@guru.guru-group.fi>
\r
38 Content-Type: text/plain; charset=utf-8
\r
39 Content-Transfer-Encoding: quoted-printable
\r
40 X-BeenThere: notmuch@notmuchmail.org
\r
41 X-Mailman-Version: 2.1.13
\r
43 List-Id: "Use and development of the notmuch mail system."
\r
44 <notmuch.notmuchmail.org>
\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
48 List-Post: <mailto:notmuch@notmuchmail.org>
\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
52 X-List-Received-Date: Sun, 07 Apr 2013 19:07:44 -0000
\r
54 On Sat, Apr 06 2013, Jani Nikula <jani@nikula.org> wrote:
\r
56 > commit d487ef9e58bcd193118f19f771d5ef3984616be5
\r
57 > Author: Jani Nikula <jani@nikula.org>
\r
58 > Date: Sat Mar 30 15:53:16 2013 +0200
\r
60 > cli: mime node: abstract decryption and signature verification
\r
62 > introduced a compiler warning, reported by Mark Walters, when building
\r
63 > against gmime 2.4:
\r
65 > mime-node.c:224:9: warning: assignment discards =E2=80=98const=E2=80=99 q=
\r
67 > pointer target type [enabled by default]
\r
69 > Pass the non-const signature validity to the destructor to fix this.
\r
73 > Not even compile tested as I don't have gmime 2.4 on any
\r
74 > systems... Mark, please build and run the tests with this. Thanks.
\r
76 I can confirm this patch removes the compilation warning. I looked the
\r
77 impmementation though the glasses which say gmime-2.4 support is going
\r
78 to be deprecated in somewhat near future and I think it is good.
\r
84 > mime-node.c | 13 ++++++++-----
\r
85 > 1 file changed, 8 insertions(+), 5 deletions(-)
\r
87 > diff --git a/mime-node.c b/mime-node.c
\r
88 > index 851f963..fd9e4a4 100644
\r
91 > @@ -217,11 +217,12 @@ _signature_validity_free (GMimeSignatureValidity **=
\r
94 > /* Set up signature validity destructor (GMime 2.4) */
\r
96 > -set_signature_validity_destructor (mime_node_t *node)
\r
97 > +set_signature_validity_destructor (mime_node_t *node,
\r
98 > + GMimeSignatureValidity *sig_validity)
\r
100 > GMimeSignatureValidity **proxy =3D talloc (node, GMimeSignatureValid=
\r
103 > - *proxy =3D node->sig_validity;
\r
104 > + *proxy =3D sig_validity;
\r
105 > talloc_set_destructor (proxy, _signature_validity_free);
\r
108 > @@ -232,12 +233,14 @@ node_verify (mime_node_t *node, GMimeObject *part,
\r
109 > notmuch_crypto_context_t *cryptoctx)
\r
111 > GError *err =3D NULL;
\r
112 > + GMimeSignatureValidity *sig_validity;
\r
114 > node->verify_attempted =3D TRUE;
\r
115 > - node->sig_validity =3D g_mime_multipart_signed_verify
\r
116 > + sig_validity =3D g_mime_multipart_signed_verify
\r
117 > (GMIME_MULTIPART_SIGNED (part), cryptoctx, &err);
\r
118 > - if (node->sig_validity) {
\r
119 > - set_signature_validity_destructor (node);
\r
120 > + node->sig_validity =3D sig_validity;
\r
121 > + if (sig_validity) {
\r
122 > + set_signature_validity_destructor (node, sig_validity);
\r
124 > fprintf (stderr, "Failed to verify signed part: %s\n",
\r
125 > err ? err->message : "no error explanation given");
\r
129 > _______________________________________________
\r
130 > notmuch mailing list
\r
131 > notmuch@notmuchmail.org
\r
132 > http://notmuchmail.org/mailman/listinfo/notmuch
\r