Re: Flat search and threaded views
[notmuch-archives.git] / 35 / 1cbe89d14d133e252ba93df3011d7f0ff68121
1 Return-Path: <beheerder@tekenbeetziekten.nl>\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 2EBCE431FB6\r
6         for <notmuch@notmuchmail.org>; Mon, 11 Feb 2013 09:41:55 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 CVWW9ety1mrs for <notmuch@notmuchmail.org>;\r
16         Mon, 11 Feb 2013 09:41:53 -0800 (PST)\r
17 Received: from srv047132.webreus.nl (srv047132.webreus.nl [46.235.47.132])\r
18         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 6C824431FAE\r
21         for <notmuch@notmuchmail.org>; Mon, 11 Feb 2013 09:41:53 -0800 (PST)\r
22 Received: (qmail 16313 invoked from network); 10 Feb 2013 14:15:07 +0100\r
23 Received: from ip73-109-210-87.adsl2.static.versatel.nl (HELO linux2.foo)\r
24         (87.210.109.73)\r
25         by srv047132.webreus.nl with SMTP; 10 Feb 2013 14:15:07 +0100\r
26 From: Robert Mast <beheerder@tekenbeetziekten.nl>\r
27 To: notmuch@notmuchmail.org\r
28 Subject: [PATCH] convert bitmap to unsigned char\r
29 Date: Sun, 10 Feb 2013 14:13:17 +0100\r
30 Message-Id: <1360501997-4967-1-git-send-email-beheerder@tekenbeetziekten.nl>\r
31 X-Mailer: git-send-email 1.7.9.5\r
32 In-Reply-To: <1359917491-17178-1-git-send-email-beheerder@tekenbeetziekten.nl>\r
33 References: <1359917491-17178-1-git-send-email-beheerder@tekenbeetziekten.nl>\r
34 Cc: Robert Mast <beheerder@tekenbeetziekten.nl>\r
35 X-BeenThere: notmuch@notmuchmail.org\r
36 X-Mailman-Version: 2.1.13\r
37 Precedence: list\r
38 List-Id: "Use and development of the notmuch mail system."\r
39         <notmuch.notmuchmail.org>\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
43 List-Post: <mailto:notmuch@notmuchmail.org>\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
47 X-List-Received-Date: Mon, 11 Feb 2013 17:41:55 -0000\r
48 \r
49 ---\r
50  lib/query.cc |   10 +++++-----\r
51  1 file changed, 5 insertions(+), 5 deletions(-)\r
52 \r
53 diff --git a/lib/query.cc b/lib/query.cc\r
54 index 046663a..7381a54 100644\r
55 --- a/lib/query.cc\r
56 +++ b/lib/query.cc\r
57 @@ -39,12 +39,12 @@ typedef struct _notmuch_mset_messages {\r
58  } notmuch_mset_messages_t;\r
59  \r
60  struct _notmuch_doc_id_set {\r
61 -    unsigned int *bitmap;\r
62 +    unsigned char *bitmap;\r
63      unsigned int bound;\r
64  };\r
65  \r
66 -#define DOCIDSET_WORD(bit) ((bit) / (sizeof (unsigned int) * CHAR_BIT))\r
67 -#define DOCIDSET_BIT(bit) ((bit) % (sizeof (unsigned int) * CHAR_BIT))\r
68 +#define DOCIDSET_WORD(bit) ((bit) / CHAR_BIT)\r
69 +#define DOCIDSET_BIT(bit) ((bit) % CHAR_BIT)\r
70  \r
71  struct visible _notmuch_threads {\r
72      notmuch_query_t *query;\r
73 @@ -359,11 +359,11 @@ _notmuch_doc_id_set_init (void *ctx,\r
74                           GArray *arr)\r
75  {\r
76      unsigned int max = 0;\r
77 -    unsigned int *bitmap;\r
78 +    unsigned char *bitmap;\r
79  \r
80      for (unsigned int i = 0; i < arr->len; i++)\r
81         max = MAX(max, g_array_index (arr, unsigned int, i));\r
82 -    bitmap = talloc_zero_array (ctx, unsigned int, (DOCIDSET_WORD(max) + 1) * sizeof (*bitmap));\r
83 +    bitmap = talloc_zero_array (ctx, unsigned char, DOCIDSET_WORD(max) + 1);\r
84  \r
85      if (bitmap == NULL)\r
86         return FALSE;\r
87 -- \r
88 1.7.9.5\r
89 \r