* [PATCH] lib: constify arguments to notmuch_query_get_*
@ 2015-09-23 11:59 David Bremner
2015-09-24 10:39 ` David Bremner
0 siblings, 1 reply; 2+ messages in thread
From: David Bremner @ 2015-09-23 11:59 UTC (permalink / raw)
To: notmuch
These functions are all just accessors, and it's pretty clear they don't
modify the query struct. This also fixes one warning I created when I
introduced status.c.
---
lib/notmuch.h | 6 +++---
lib/query.cc | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/notmuch.h b/lib/notmuch.h
index 86b5b4d..8775683 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -728,13 +728,13 @@ typedef enum {
* Return the query_string of this query. See notmuch_query_create.
*/
const char *
-notmuch_query_get_query_string (notmuch_query_t *query);
+notmuch_query_get_query_string (const notmuch_query_t *query);
/**
* Return the notmuch database of this query. See notmuch_query_create.
*/
notmuch_database_t *
-notmuch_query_get_database (notmuch_query_t *query);
+notmuch_query_get_database (const notmuch_query_t *query);
/**
* Exclude values for notmuch_query_set_omit_excluded. The strange
@@ -791,7 +791,7 @@ notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort);
* notmuch_query_set_sort.
*/
notmuch_sort_t
-notmuch_query_get_sort (notmuch_query_t *query);
+notmuch_query_get_sort (const notmuch_query_t *query);
/**
* Add a tag that will be excluded from the query results by default.
diff --git a/lib/query.cc b/lib/query.cc
index f53215d..8cf0a07 100644
--- a/lib/query.cc
+++ b/lib/query.cc
@@ -98,7 +98,7 @@ notmuch_query_create (notmuch_database_t *notmuch,
}
const char *
-notmuch_query_get_query_string (notmuch_query_t *query)
+notmuch_query_get_query_string (const notmuch_query_t *query)
{
return query->query_string;
}
@@ -117,7 +117,7 @@ notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort)
}
notmuch_sort_t
-notmuch_query_get_sort (notmuch_query_t *query)
+notmuch_query_get_sort (const notmuch_query_t *query)
{
return query->sort;
}
@@ -660,7 +660,7 @@ notmuch_query_count_threads (notmuch_query_t *query)
}
notmuch_database_t *
-notmuch_query_get_database (notmuch_query_t *query)
+notmuch_query_get_database (const notmuch_query_t *query)
{
return query->notmuch;
}
--
2.5.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-24 10:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-23 11:59 [PATCH] lib: constify arguments to notmuch_query_get_* David Bremner
2015-09-24 10:39 ` David Bremner
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).