Re: [PATCH v4 09/16] index encrypted parts when asked.
[notmuch-archives.git] / 15 / 3bcbee42ba20bb7137e76a3b08f7cdf560f648
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 olra.theworths.org (Postfix) with ESMTP id 4E1D841646B\r
6         for <notmuch@notmuchmail.org>; Mon,  9 Apr 2012 04:04:43 -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: -0.699\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
12         tests=[HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 iK25wv0aGCTb for <notmuch@notmuchmail.org>;\r
16         Mon,  9 Apr 2012 04:04:38 -0700 (PDT)\r
17 Received: from mail-pz0-f45.google.com (mail-pz0-f45.google.com\r
18         [209.85.210.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 65B0140350B\r
21         for <notmuch@notmuchmail.org>; Mon,  9 Apr 2012 04:04:38 -0700 (PDT)\r
22 Received: by dacx6 with SMTP id x6so5280608dac.18\r
23         for <notmuch@notmuchmail.org>; Mon, 09 Apr 2012 04:04:36 -0700 (PDT)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=google.com; s=20120113;\r
26         h=mime-version:in-reply-to:references:date:message-id:subject:from:to\r
27         :cc:content-type:x-gm-message-state;\r
28         bh=DMaTsGyQ0fnka8YnIf1de0yUj/e8KP8in5l5awM5Hao=;\r
29         b=QdlForbXbdh4DdVClwuwfsuDM5aDIU5970GbTyHpKD/JKPY1RZh34IkJ6HND/JLIOI\r
30         W4OqBe1xsc6uTxcx8icH4hXLsOFl5pa9pEGB63rx3L9gyt1738R2vcVBWBGfkPUT5QvB\r
31         FkzWPzpc98U7D+GB0ylE9tyhqsU9eWWzUMzQkSYjopc5WrC14EvPB7kXDlIA0PGMhDoJ\r
32         ED98x/4MFVhhcpKXVVq8fag/Nzr4EWoVIFfvmvxrrQlAHlBBbsN8gCsqBUBryi8n6KPA\r
33         UG+PimtsHqqzntwgh4U5awj9eapS5esAA2J44jDkl6mSinBnQsbz175Ctea0Jr2JaHyc\r
34         1dUA==\r
35 MIME-Version: 1.0\r
36 Received: by 10.68.218.33 with SMTP id pd1mr3432994pbc.96.1333969476450; Mon,\r
37         09 Apr 2012 04:04:36 -0700 (PDT)\r
38 Received: by 10.68.241.234 with HTTP; Mon, 9 Apr 2012 04:04:36 -0700 (PDT)\r
39 Received: by 10.68.241.234 with HTTP; Mon, 9 Apr 2012 04:04:36 -0700 (PDT)\r
40 In-Reply-To: <1333966665-10469-5-git-send-email-Vladimir.Marek@oracle.com>\r
41 References: <1333966665-10469-1-git-send-email-Vladimir.Marek@oracle.com>\r
42         <1333966665-10469-5-git-send-email-Vladimir.Marek@oracle.com>\r
43 Date: Mon, 9 Apr 2012 14:04:36 +0300\r
44 Message-ID:\r
45  <CAB+hUn_QyMAfC1-Dr23T63ObX=cwuBOzcyCi=61w0MtGRMyt2w@mail.gmail.com>\r
46 Subject: Re: [PATCH 4/4] Explicitly type void* pointers\r
47 From: Jani Nikula <jani@nikula.org>\r
48 To: Vladimir.Marek@oracle.com\r
49 Content-Type: multipart/alternative; boundary=e89a8ff245dbc8f92104bd3cf8df\r
50 X-Gm-Message-State:\r
51  ALoCoQk3BHjsBclIFFa+GRKRcIbofqVYPprDTZHJj4ax/pY1LpKVcroVdCqx57ODi48kyZmOEBfc\r
52 Cc: Notmuch Mail <notmuch@notmuchmail.org>, Vladimir Marek <vlmarek@volny.cz>\r
53 X-BeenThere: notmuch@notmuchmail.org\r
54 X-Mailman-Version: 2.1.13\r
55 Precedence: list\r
56 List-Id: "Use and development of the notmuch mail system."\r
57         <notmuch.notmuchmail.org>\r
58 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
60 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
61 List-Post: <mailto:notmuch@notmuchmail.org>\r
62 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
63 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
65 X-List-Received-Date: Mon, 09 Apr 2012 11:04:43 -0000\r
66 \r
67 --e89a8ff245dbc8f92104bd3cf8df\r
68 Content-Type: text/plain; charset=UTF-8\r
69 \r
70 Hi, does notmuch not compile without this? IIRC talloc_steal is a macro\r
71 that's supposed to provide type safety (at least with GCC), and I'd be\r
72 hesitant about adding the casts. Please look in your talloc.h.\r
73 \r
74 BR,\r
75 Jani.\r
76 \r
77 On Apr 9, 2012 1:19 PM, <Vladimir.Marek@oracle.com> wrote:\r
78 >\r
79 > From: Vladimir Marek <vlmarek@volny.cz>\r
80 >\r
81 >\r
82 > Signed-off-by: Vladimir Marek <vlmarek@volny.cz>\r
83 > ---\r
84 >  lib/database.cc |    2 +-\r
85 >  lib/message.cc  |    2 +-\r
86 >  lib/thread.cc   |    2 +-\r
87 >  3 files changed, 3 insertions(+), 3 deletions(-)\r
88 >\r
89 > diff --git a/lib/database.cc b/lib/database.cc\r
90 > index 16c4354..3c82632 100644\r
91 > --- a/lib/database.cc\r
92 > +++ b/lib/database.cc\r
93 > @@ -1361,7 +1361,7 @@ _resolve_message_id_to_thread_id\r
94 (notmuch_database_t *notmuch,\r
95 >        return status;\r
96 >\r
97 >     if (message) {\r
98 > -       *thread_id_ret = talloc_steal (ctx,\r
99 > +       *thread_id_ret = (const char*)talloc_steal (ctx,\r
100 >                                       notmuch_message_get_thread_id\r
101 (message));\r
102 >\r
103 >        notmuch_message_destroy (message);\r
104 > diff --git a/lib/message.cc b/lib/message.cc\r
105 > index 0075425..d56d442 100644\r
106 > --- a/lib/message.cc\r
107 > +++ b/lib/message.cc\r
108 > @@ -220,7 +220,7 @@ _notmuch_message_create_for_message_id\r
109 (notmuch_database_t *notmuch,\r
110 >\r
111  message_id,\r
112 >\r
113  &message);\r
114 >     if (message)\r
115 > -       return talloc_steal (notmuch, message);\r
116 > +       return (notmuch_message_t*) talloc_steal (notmuch, message);\r
117 >     else if (*status_ret)\r
118 >        return NULL;\r
119 >\r
120 > diff --git a/lib/thread.cc b/lib/thread.cc\r
121 > index e976d64..d41ff3e 100644\r
122 > --- a/lib/thread.cc\r
123 > +++ b/lib/thread.cc\r
124 > @@ -225,7 +225,7 @@ _thread_add_message (notmuch_thread_t *thread,\r
125 >     char *clean_author;\r
126 >\r
127 >     _notmuch_message_list_add_message (thread->message_list,\r
128 > -                                      talloc_steal (thread, message));\r
129 > +                                      (_notmuch_message*)talloc_steal\r
130 (thread, message));\r
131 >     thread->total_messages++;\r
132 >\r
133 >     g_hash_table_insert (thread->message_hash,\r
134 > --\r
135 > 1.7.3.2\r
136 >\r
137 > _______________________________________________\r
138 > notmuch mailing list\r
139 > notmuch@notmuchmail.org\r
140 > http://notmuchmail.org/mailman/listinfo/notmuch\r
141 \r
142 --e89a8ff245dbc8f92104bd3cf8df\r
143 Content-Type: text/html; charset=UTF-8\r
144 Content-Transfer-Encoding: quoted-printable\r
145 \r
146 <p><br>\r
147 Hi, does notmuch not compile without this? IIRC talloc_steal is a macro tha=\r
148 t&#39;s supposed to provide type safety (at least with GCC), and I&#39;d be=\r
149  hesitant about adding the casts. Please look in your talloc.h.</p>\r
150 <p>BR,<br>\r
151 Jani.<br></p>\r
152 <p>On Apr 9, 2012 1:19 PM, &lt;<a href=3D"mailto:Vladimir.Marek@oracle.com"=\r
153 >Vladimir.Marek@oracle.com</a>&gt; wrote:<br>\r
154 &gt;<br>\r
155 &gt; From: Vladimir Marek &lt;<a href=3D"mailto:vlmarek@volny.cz">vlmarek@v=\r
156 olny.cz</a>&gt;<br>\r
157 &gt;<br>\r
158 &gt;<br>\r
159 &gt; Signed-off-by: Vladimir Marek &lt;<a href=3D"mailto:vlmarek@volny.cz">=\r
160 vlmarek@volny.cz</a>&gt;<br>\r
161 &gt; ---<br>\r
162 &gt; =C2=A0lib/database.cc | =C2=A0 =C2=A02 +-<br>\r
163 &gt; =C2=A0lib/message.cc =C2=A0| =C2=A0 =C2=A02 +-<br>\r
164 &gt; =C2=A0lib/thread.cc =C2=A0 | =C2=A0 =C2=A02 +-<br>\r
165 &gt; =C2=A03 files changed, 3 insertions(+), 3 deletions(-)<br>\r
166 &gt;<br>\r
167 &gt; diff --git a/lib/database.cc b/lib/database.cc<br>\r
168 &gt; index 16c4354..3c82632 100644<br>\r
169 &gt; --- a/lib/database.cc<br>\r
170 &gt; +++ b/lib/database.cc<br>\r
171 &gt; @@ -1361,7 +1361,7 @@ _resolve_message_id_to_thread_id (notmuch_databa=\r
172 se_t *notmuch,<br>\r
173 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0return status;<br>\r
174 &gt;<br>\r
175 &gt; =C2=A0 =C2=A0 if (message) {<br>\r
176 &gt; - =C2=A0 =C2=A0 =C2=A0 *thread_id_ret =3D talloc_steal (ctx,<br>\r
177 &gt; + =C2=A0 =C2=A0 =C2=A0 *thread_id_ret =3D (const char*)talloc_steal (c=\r
178 tx,<br>\r
179 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =\r
180 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 notmuch_mess=\r
181 age_get_thread_id (message));<br>\r
182 &gt;<br>\r
183 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0notmuch_message_destroy (message);<br>\r
184 &gt; diff --git a/lib/message.cc b/lib/message.cc<br>\r
185 &gt; index 0075425..d56d442 100644<br>\r
186 &gt; --- a/lib/message.cc<br>\r
187 &gt; +++ b/lib/message.cc<br>\r
188 &gt; @@ -220,7 +220,7 @@ _notmuch_message_create_for_message_id (notmuch_da=\r
189 tabase_t *notmuch,<br>\r
190 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =\r
191 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=\r
192 =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =\r
193 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0message_id,<br>\r
194 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =\r
195 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=\r
196 =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =\r
197 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&amp;message);<br>\r
198 &gt; =C2=A0 =C2=A0 if (message)<br>\r
199 &gt; - =C2=A0 =C2=A0 =C2=A0 return talloc_steal (notmuch, message);<br>\r
200 &gt; + =C2=A0 =C2=A0 =C2=A0 return (notmuch_message_t*) talloc_steal (notmu=\r
201 ch, message);<br>\r
202 &gt; =C2=A0 =C2=A0 else if (*status_ret)<br>\r
203 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0return NULL;<br>\r
204 &gt;<br>\r
205 &gt; diff --git a/lib/thread.cc b/lib/thread.cc<br>\r
206 &gt; index e976d64..d41ff3e 100644<br>\r
207 &gt; --- a/lib/thread.cc<br>\r
208 &gt; +++ b/lib/thread.cc<br>\r
209 &gt; @@ -225,7 +225,7 @@ _thread_add_message (notmuch_thread_t *thread,<br>\r
210 &gt; =C2=A0 =C2=A0 char *clean_author;<br>\r
211 &gt;<br>\r
212 &gt; =C2=A0 =C2=A0 _notmuch_message_list_add_message (thread-&gt;message_li=\r
213 st,<br>\r
214 &gt; - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=\r
215 =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0talloc_st=\r
216 eal (thread, message));<br>\r
217 &gt; + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=\r
218 =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(_notmuch=\r
219 _message*)talloc_steal (thread, message));<br>\r
220 &gt; =C2=A0 =C2=A0 thread-&gt;total_messages++;<br>\r
221 &gt;<br>\r
222 &gt; =C2=A0 =C2=A0 g_hash_table_insert (thread-&gt;message_hash,<br>\r
223 &gt; --<br>\r
224 &gt; 1.7.3.2<br>\r
225 &gt;<br>\r
226 &gt; _______________________________________________<br>\r
227 &gt; notmuch mailing list<br>\r
228 &gt; <a href=3D"mailto:notmuch@notmuchmail.org">notmuch@notmuchmail.org</a>=\r
229 <br>\r
230 &gt; <a href=3D"http://notmuchmail.org/mailman/listinfo/notmuch">http://not=\r
231 muchmail.org/mailman/listinfo/notmuch</a><br>\r
232 </p>\r
233 \r
234 --e89a8ff245dbc8f92104bd3cf8df--\r