]> git.notmuchmail.org Git - notmuch/commitdiff
lib: constify arguments to notmuch_query_get_*
authorDavid Bremner <david@tethera.net>
Wed, 23 Sep 2015 11:31:19 +0000 (08:31 -0300)
committerDavid Bremner <david@tethera.net>
Wed, 23 Sep 2015 11:58:19 +0000 (08:58 -0300)
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
lib/query.cc

index 86b5b4de4502be96f353b836ffaf22a6171a7f43..87756838d0727f77836e419a2e7f9d5384bb1033 100644 (file)
@@ -728,13 +728,13 @@ typedef enum {
  * Return the query_string of this query. See notmuch_query_create.
  */
 const char *
  * 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 *
 
 /**
  * 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
 
 /**
  * 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_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.
 
 /**
  * Add a tag that will be excluded from the query results by default.
index f53215dbaf5902fca51d3c7dd5ac3628802ded00..8cf0a077e5e74e54267d0470a25b51fa9e84475d 100644 (file)
@@ -98,7 +98,7 @@ notmuch_query_create (notmuch_database_t *notmuch,
 }
 
 const char *
 }
 
 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;
 }
 {
     return query->query_string;
 }
@@ -117,7 +117,7 @@ notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort)
 }
 
 notmuch_sort_t
 }
 
 notmuch_sort_t
-notmuch_query_get_sort (notmuch_query_t *query)
+notmuch_query_get_sort (const notmuch_query_t *query)
 {
     return query->sort;
 }
 {
     return query->sort;
 }
@@ -660,7 +660,7 @@ notmuch_query_count_threads (notmuch_query_t *query)
 }
 
 notmuch_database_t *
 }
 
 notmuch_database_t *
-notmuch_query_get_database (notmuch_query_t *query)
+notmuch_query_get_database (const notmuch_query_t *query)
 {
     return query->notmuch;
 }
 {
     return query->notmuch;
 }