summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2023-03-02 15:42:18 +0100
committerCarlos Garnacho <carlosg@gnome.org>2023-03-02 16:16:12 +0100
commit65749008603efe9c7182f579d8e8d0e62c238670 (patch)
tree49c379ba1ccb8cda4cd4f98ffedc0fc0b4daa04d /src
parenta4f9885a15d845203f777c87e7109471d216c3d0 (diff)
downloadtracker-65749008603efe9c7182f579d8e8d0e62c238670.tar.gz
libtracker-common: Fix compiler warnings in libunistring module
This was broken and untested for very long, so it accumulated some compiler warnings. This module is still on the hook and makes some tests fail, fix these warnings anyway.
Diffstat (limited to 'src')
-rw-r--r--src/libtracker-common/tracker-parser-libunistring.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libtracker-common/tracker-parser-libunistring.c b/src/libtracker-common/tracker-parser-libunistring.c
index 515521d19..b26b4bae5 100644
--- a/src/libtracker-common/tracker-parser-libunistring.c
+++ b/src/libtracker-common/tracker-parser-libunistring.c
@@ -88,7 +88,7 @@ get_word_info (TrackerParser *parser,
/* Get first character of the word as UCS4 */
first_unichar_len = u8_strmbtouc (&first_unichar,
- &(parser->txt[parser->cursor]));
+ (const guchar *) &(parser->txt[parser->cursor]));
if (first_unichar_len <= 0) {
/* This should only happen if NIL was passed to u8_strmbtouc,
* so better just force stop here */
@@ -110,7 +110,7 @@ get_word_info (TrackerParser *parser,
i = parser->cursor + first_unichar_len;
while (1) {
/* Text bounds reached? */
- if (i >= parser->txt_size)
+ if (i >= (gsize) parser->txt_size)
break;
/* Proper unicode word break detected? */
if (parser->word_break_flags[i])
@@ -185,7 +185,7 @@ tracker_parser_unaccent_nfkd_string (gpointer str,
gint utf8_len;
/* Get next character of the word as UCS4 */
- utf8_len = u8_strmbtouc (&unichar, &word[i]);
+ utf8_len = u8_strmbtouc (&unichar, (const guchar *) &word[i]);
/* Invalid UTF-8 character or end of original string. */
if (utf8_len <= 0) {
@@ -253,12 +253,12 @@ process_word_utf8 (TrackerParser *parser,
/* Casefold and NFKD normalization in output.
* NOTE: if the output buffer is not big enough, u8_casefold will
* return a newly-allocated buffer. */
- normalized = u8_casefold ((const uint8_t *)word,
- length,
- uc_locale_language (),
- UNINORM_NFKD,
- word_buffer,
- &new_word_length);
+ normalized = (gchar*) u8_casefold ((const uint8_t *)word,
+ length,
+ uc_locale_language (),
+ UNINORM_NFKD,
+ (guchar *) word_buffer,
+ &new_word_length);
/* Case folding + Normalization failed, ignore this word */
g_return_val_if_fail (normalized != NULL, NULL);
@@ -279,7 +279,7 @@ process_word_utf8 (TrackerParser *parser,
normalized = length > WORD_BUFFER_LENGTH ? g_malloc (length + 1) : word_buffer;
- for (i = 0; i < length; i++) {
+ for (i = 0; i < (gsize) length; i++) {
normalized[i] = g_ascii_tolower (word[i]);
}
@@ -349,7 +349,7 @@ parser_next (TrackerParser *parser,
/* Loop to look for next valid word */
while (!processed_word &&
- parser->cursor < parser->txt_size) {
+ parser->cursor < (gsize) parser->txt_size) {
TrackerParserWordType type;
gsize truncated_length;
gboolean is_allowed;