[evolution-data-server/sqlite-refactor: 2/14] EBookQuery: Added end marker for the EBookQueryTest enum



commit 6ab8c7d5a258fc7c2fa38c33e151f37d65818a01
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Thu Nov 21 20:31:46 2013 +0900

    EBookQuery: Added end marker for the EBookQueryTest enum
    
    Also declare the first member with "= 0", just because we now
    use it to index an array, and I'm paranoid/unsure about the C spec
    in this case.

 addressbook/libebook-contacts/e-book-query.c |    3 +++
 addressbook/libebook-contacts/e-book-query.h |    7 +++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/addressbook/libebook-contacts/e-book-query.c b/addressbook/libebook-contacts/e-book-query.c
index 688eeb0..d6180e3 100644
--- a/addressbook/libebook-contacts/e-book-query.c
+++ b/addressbook/libebook-contacts/e-book-query.c
@@ -806,6 +806,8 @@ field_test_name (EBookQueryTest field_test)
                return "regex_normal";
        case E_BOOK_QUERY_REGEX_RAW:
                return "regex_raw";
+       case E_BOOK_QUERY_LAST:
+               g_return_val_if_reached (NULL);
        }
 
        return NULL;
@@ -826,6 +828,7 @@ is_phone_test (EBookQueryTest field_test)
        case E_BOOK_QUERY_ENDS_WITH:
        case E_BOOK_QUERY_REGEX_NORMAL:
        case E_BOOK_QUERY_REGEX_RAW:
+       case E_BOOK_QUERY_LAST:
                break;
        }
 
diff --git a/addressbook/libebook-contacts/e-book-query.h b/addressbook/libebook-contacts/e-book-query.h
index 2c03a61..baf1bb0 100644
--- a/addressbook/libebook-contacts/e-book-query.h
+++ b/addressbook/libebook-contacts/e-book-query.h
@@ -60,13 +60,14 @@ typedef struct _EBookQuery EBookQuery;
  * @E_BOOK_QUERY_REGEX_RAW: A regular expression query against raw contact data, this is usually slower than
  * a %E_BOOK_QUERY_REGEX_NORMAL as it implies that #EVCards must be parsed in order to get the raw data
  * for comparison.
+ * @E_BOOK_QUERY_LAST: End marker for the #EBookQueryTest enumeration, not a valid query test.
  *
  * The kind of test a query created by e_book_query_field_test() shall perform.
  *
  * See also: e_phone_number_compare_strings().
  **/
 typedef enum {
-  E_BOOK_QUERY_IS,
+  E_BOOK_QUERY_IS = 0,
   E_BOOK_QUERY_CONTAINS,
   E_BOOK_QUERY_BEGINS_WITH,
   E_BOOK_QUERY_ENDS_WITH,
@@ -76,7 +77,7 @@ typedef enum {
   E_BOOK_QUERY_EQUALS_SHORT_PHONE_NUMBER,
 
   E_BOOK_QUERY_REGEX_NORMAL,
-  E_BOOK_QUERY_REGEX_RAW
+  E_BOOK_QUERY_REGEX_RAW,
 
   /*
     Consider these "coming soon".
@@ -87,6 +88,8 @@ typedef enum {
     E_BOOK_QUERY_GE,
     E_BOOK_QUERY_EQ,
   */
+
+  E_BOOK_QUERY_LAST
 } EBookQueryTest;
 
 EBookQuery * e_book_query_from_string  (const gchar *query_string);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]