[geary/mjog/search-update: 16/17] src/engine/imap-db/imap-db-fts5-*.c: Fix build warnings




commit 5c478b5c50675ff1bdf345a2dbbf25b03627e8ce
Author: Michael Gratton <mike vee net>
Date:   Mon Dec 28 19:18:42 2020 +1030

    src/engine/imap-db/imap-db-fts5-*.c: Fix build warnings

 src/engine/imap-db/imap-db-fts5-matches.c   | 12 +++++++-----
 src/engine/imap-db/imap-db-fts5-tokeniser.c | 12 +++++++-----
 2 files changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/src/engine/imap-db/imap-db-fts5-matches.c b/src/engine/imap-db/imap-db-fts5-matches.c
index 4dff4f32b..a213cb4bb 100644
--- a/src/engine/imap-db/imap-db-fts5-matches.c
+++ b/src/engine/imap-db/imap-db-fts5-matches.c
@@ -27,17 +27,19 @@
 #include <sqlite3.h>
 #include <glib.h>
 
+#define unused __attribute__((unused))
+
+
 typedef struct {
     int start;
     int end;
 } Offset;
 
-
 static int
 offsets_tokenizer_func (void       *data,
-                        int         flags,
-                        const char *token,
-                        int         n_token,
+                        unused int  flags,
+                        unused const char *token,
+                        unused int  n_token,
                         int         start,
                         int         end)
 {
@@ -54,7 +56,7 @@ geary_matches (const Fts5ExtensionApi  *api,
                Fts5Context             *fts_ctx,
                sqlite3_context         *ctx,
                int                      n_args,
-               sqlite3_value          **args)
+               unused sqlite3_value   **args)
 {
     GString *str;
     int rc, n_hits, i;
diff --git a/src/engine/imap-db/imap-db-fts5-tokeniser.c b/src/engine/imap-db/imap-db-fts5-tokeniser.c
index 2991a56e1..0468fd597 100644
--- a/src/engine/imap-db/imap-db-fts5-tokeniser.c
+++ b/src/engine/imap-db/imap-db-fts5-tokeniser.c
@@ -16,6 +16,8 @@ SQLITE_EXTENSION_INIT1
 #include "unicode/utf.h"
 #include "unicode/utypes.h"
 
+#define unused __attribute__((unused))
+
 // Full text search tokeniser for SQLite. This exists since SQLite's
 // existing Unicode tokeniser doesn't work with languages that don't
 // use spaces as word boundaries.
@@ -45,9 +47,9 @@ typedef struct {
 } IcuTokeniser;
 
 
-static int icu_create(void *context,
-                      const char **args,
-                      int n_args,
+static int icu_create(unused void *context,
+                      unused const char **args,
+                      unused int n_args,
                       Fts5Tokenizer **ret) {
     const UNormalizer2 *norm;
     UBreakIterator *iter;
@@ -88,7 +90,7 @@ static void icu_delete(Fts5Tokenizer *fts5_tokeniser) {
 
 static int icu_tokenise(Fts5Tokenizer *fts5_tokeniser,
                         void *context,
-                        int flags,
+                        unused int flags,
                         const char *chars,
                         int32_t chars_len,
                         int (*token_callback)(void*, int, const char*, int, int, int)) {
@@ -267,7 +269,7 @@ gboolean sqlite3_register_fts5_tokeniser(sqlite3 *db) {
 // command line SQLite tool. The name of this function must match the
 // name of the shared module.
 int sqlite3_gearytokeniser_init(sqlite3 *db,
-                                char **error_message,
+                                unused char **error_message,
                                 const sqlite3_api_routines *api) {
     g_info("Loading geary_tokeniser\n");
     SQLITE_EXTENSION_INIT2(api);


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