Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / b2 / 9cb650e2f863c28c808585e2f81b4fd904c018
1 Return-Path: <m.walters@qmul.ac.uk>\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 B236F431FBC\r
6         for <notmuch@notmuchmail.org>; Thu, 11 Apr 2013 23:12:39 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id XsArnGFKpNZx for <notmuch@notmuchmail.org>;\r
17         Thu, 11 Apr 2013 23:12:35 -0700 (PDT)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id DC977431FAE\r
22         for <notmuch@notmuchmail.org>; Thu, 11 Apr 2013 23:12:34 -0700 (PDT)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1UQXDo-0007xv-59; Fri, 12 Apr 2013 07:12:28 +0100\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
28         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1UQXDn-0003rY-SU; Fri, 12 Apr 2013 07:12:28 +0100\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
33 Subject: Re: [PATCH] cli: mime node: fix compiler warning when building\r
34         against gmime 2.4\r
35 In-Reply-To: <1365248863-17947-1-git-send-email-jani@nikula.org>\r
36 References: <1365248863-17947-1-git-send-email-jani@nikula.org>\r
37 User-Agent: Notmuch/0.14+255~gff3cc55 (http://notmuchmail.org) Emacs/23.4.1\r
38         (x86_64-pc-linux-gnu)\r
39 Date: Fri, 12 Apr 2013 07:12:45 +0100\r
40 Message-ID: <87a9p4l1k2.fsf@qmul.ac.uk>\r
41 MIME-Version: 1.0\r
42 Content-Type: text/plain; charset=utf-8\r
43 Content-Transfer-Encoding: quoted-printable\r
44 X-Sender-Host-Address: 93.97.24.31\r
45 X-QM-SPAM-Info: Sender has good ham record.  :)\r
46 X-QM-Body-MD5: dc4ba2a33ad66402fe82002e2247208c (of first 20000 bytes)\r
47 X-SpamAssassin-Score: -2.3\r
48 X-SpamAssassin-SpamBar: --\r
49 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
50         determine if it is\r
51         spam. We require at least 5.0 points to mark a message as spam.\r
52         This message scored -2.3 points.\r
53         Summary of the scoring: \r
54         * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
55         *      medium trust\r
56         *      [138.37.6.40 listed in list.dnswl.org]\r
57         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
58         provider *      (markwalters1009[at]gmail.com)\r
59 X-QM-Scan-Virus: ClamAV says the message is clean\r
60 X-BeenThere: notmuch@notmuchmail.org\r
61 X-Mailman-Version: 2.1.13\r
62 Precedence: list\r
63 List-Id: "Use and development of the notmuch mail system."\r
64         <notmuch.notmuchmail.org>\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
68 List-Post: <mailto:notmuch@notmuchmail.org>\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
72 X-List-Received-Date: Fri, 12 Apr 2013 06:12:40 -0000\r
73 \r
74 \r
75 On Sat, 06 Apr 2013, Jani Nikula <jani@nikula.org> wrote:\r
76 > commit d487ef9e58bcd193118f19f771d5ef3984616be5\r
77 > Author: Jani Nikula <jani@nikula.org>\r
78 > Date:   Sat Mar 30 15:53:16 2013 +0200\r
79 >\r
80 >     cli: mime node: abstract decryption and signature verification\r
81 >\r
82 > introduced a compiler warning, reported by Mark Walters, when building\r
83 > against gmime 2.4:\r
84 >\r
85 > mime-node.c:224:9: warning: assignment discards =E2=80=98const=E2=80=99 q=\r
86 ualifier from\r
87 > pointer target type [enabled by default]\r
88 >\r
89 > Pass the non-const signature validity to the destructor to fix this.\r
90 >\r
91 > ---\r
92 >\r
93 > Not even compile tested as I don't have gmime 2.4 on any\r
94 > systems... Mark, please build and run the tests with this. Thanks.\r
95 \r
96 This fixes the build warning and all tests pass. Thanks!\r
97 \r
98 Mark\r
99 \r
100 > ---\r
101 >  mime-node.c |   13 ++++++++-----\r
102 >  1 file changed, 8 insertions(+), 5 deletions(-)\r
103 >\r
104 > diff --git a/mime-node.c b/mime-node.c\r
105 > index 851f963..fd9e4a4 100644\r
106 > --- a/mime-node.c\r
107 > +++ b/mime-node.c\r
108 > @@ -217,11 +217,12 @@ _signature_validity_free (GMimeSignatureValidity **=\r
109 proxy)\r
110 >=20=20\r
111 >  /* Set up signature validity destructor (GMime 2.4) */\r
112 >  static void\r
113 > -set_signature_validity_destructor (mime_node_t *node)\r
114 > +set_signature_validity_destructor (mime_node_t *node,\r
115 > +                                GMimeSignatureValidity *sig_validity)\r
116 >  {\r
117 >      GMimeSignatureValidity **proxy =3D talloc (node, GMimeSignatureValid=\r
118 ity *);\r
119 >      if (proxy) {\r
120 > -     *proxy =3D node->sig_validity;\r
121 > +     *proxy =3D sig_validity;\r
122 >       talloc_set_destructor (proxy, _signature_validity_free);\r
123 >      }\r
124 >  }\r
125 > @@ -232,12 +233,14 @@ node_verify (mime_node_t *node, GMimeObject *part,\r
126 >            notmuch_crypto_context_t *cryptoctx)\r
127 >  {\r
128 >      GError *err =3D NULL;\r
129 > +    GMimeSignatureValidity *sig_validity;\r
130 >=20=20\r
131 >      node->verify_attempted =3D TRUE;\r
132 > -    node->sig_validity =3D g_mime_multipart_signed_verify\r
133 > +    sig_validity =3D g_mime_multipart_signed_verify\r
134 >       (GMIME_MULTIPART_SIGNED (part), cryptoctx, &err);\r
135 > -    if (node->sig_validity) {\r
136 > -     set_signature_validity_destructor (node);\r
137 > +    node->sig_validity =3D sig_validity;\r
138 > +    if (sig_validity) {\r
139 > +     set_signature_validity_destructor (node, sig_validity);\r
140 >      } else {\r
141 >       fprintf (stderr, "Failed to verify signed part: %s\n",\r
142 >                err ? err->message : "no error explanation given");\r
143 > --=20\r
144 > 1.7.10.4\r