1 Return-Path: <bremner@tethera.net>
\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 3A1836DE1648
\r
6 for <notmuch@notmuchmail.org>; Wed, 23 Sep 2015 05:00:27 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=0.113 tagged_above=-999 required=5 tests=[AWL=0.113]
\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 tz5cnjo6HyLx for <notmuch@notmuchmail.org>;
\r
16 Wed, 23 Sep 2015 05:00:25 -0700 (PDT)
\r
17 Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224])
\r
18 by arlo.cworth.org (Postfix) with ESMTPS id 2B4FC6DE1603
\r
19 for <notmuch@notmuchmail.org>; Wed, 23 Sep 2015 05:00:25 -0700 (PDT)
\r
20 Received: from remotemail by gitolite.debian.net with local (Exim 4.80)
\r
21 (envelope-from <bremner@tethera.net>)
\r
22 id 1Zeii6-0001x2-Pv; Wed, 23 Sep 2015 11:59:42 +0000
\r
23 Received: (nullmailer pid 26809 invoked by uid 1000); Wed, 23 Sep 2015
\r
25 From: David Bremner <david@tethera.net>
\r
26 To: notmuch@notmuchmail.org
\r
27 Subject: [PATCH] lib: constify arguments to notmuch_query_get_*
\r
28 Date: Wed, 23 Sep 2015 08:59:14 -0300
\r
29 Message-Id: <1443009554-26766-1-git-send-email-david@tethera.net>
\r
30 X-Mailer: git-send-email 2.5.1
\r
31 X-BeenThere: notmuch@notmuchmail.org
\r
32 X-Mailman-Version: 2.1.18
\r
34 List-Id: "Use and development of the notmuch mail system."
\r
35 <notmuch.notmuchmail.org>
\r
36 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
37 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
38 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
39 List-Post: <mailto:notmuch@notmuchmail.org>
\r
40 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
41 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
42 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
43 X-List-Received-Date: Wed, 23 Sep 2015 12:00:27 -0000
\r
45 These functions are all just accessors, and it's pretty clear they don't
\r
46 modify the query struct. This also fixes one warning I created when I
\r
47 introduced status.c.
\r
49 lib/notmuch.h | 6 +++---
\r
50 lib/query.cc | 6 +++---
\r
51 2 files changed, 6 insertions(+), 6 deletions(-)
\r
53 diff --git a/lib/notmuch.h b/lib/notmuch.h
\r
54 index 86b5b4d..8775683 100644
\r
57 @@ -728,13 +728,13 @@ typedef enum {
\r
58 * Return the query_string of this query. See notmuch_query_create.
\r
61 -notmuch_query_get_query_string (notmuch_query_t *query);
\r
62 +notmuch_query_get_query_string (const notmuch_query_t *query);
\r
65 * Return the notmuch database of this query. See notmuch_query_create.
\r
67 notmuch_database_t *
\r
68 -notmuch_query_get_database (notmuch_query_t *query);
\r
69 +notmuch_query_get_database (const notmuch_query_t *query);
\r
72 * Exclude values for notmuch_query_set_omit_excluded. The strange
\r
73 @@ -791,7 +791,7 @@ notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort);
\r
74 * notmuch_query_set_sort.
\r
77 -notmuch_query_get_sort (notmuch_query_t *query);
\r
78 +notmuch_query_get_sort (const notmuch_query_t *query);
\r
81 * Add a tag that will be excluded from the query results by default.
\r
82 diff --git a/lib/query.cc b/lib/query.cc
\r
83 index f53215d..8cf0a07 100644
\r
86 @@ -98,7 +98,7 @@ notmuch_query_create (notmuch_database_t *notmuch,
\r
90 -notmuch_query_get_query_string (notmuch_query_t *query)
\r
91 +notmuch_query_get_query_string (const notmuch_query_t *query)
\r
93 return query->query_string;
\r
95 @@ -117,7 +117,7 @@ notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort)
\r
99 -notmuch_query_get_sort (notmuch_query_t *query)
\r
100 +notmuch_query_get_sort (const notmuch_query_t *query)
\r
102 return query->sort;
\r
104 @@ -660,7 +660,7 @@ notmuch_query_count_threads (notmuch_query_t *query)
\r
107 notmuch_database_t *
\r
108 -notmuch_query_get_database (notmuch_query_t *query)
\r
109 +notmuch_query_get_database (const notmuch_query_t *query)
\r
111 return query->notmuch;
\r