aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-searching-tokenizer.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2007-10-10 12:54:36 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-10-10 12:54:36 +0800
commitb32649a94cd485f742d2ad5f1b76d7385393e137 (patch)
tree002248795c141c992667d73fbf34c40f394fbbf0 /mail/e-searching-tokenizer.c
parent6a2861c3aa49e9439d3e665b0855222716add3a3 (diff)
downloadgsoc2013-evolution-b32649a94cd485f742d2ad5f1b76d7385393e137.tar.gz
gsoc2013-evolution-b32649a94cd485f742d2ad5f1b76d7385393e137.tar.zst
gsoc2013-evolution-b32649a94cd485f742d2ad5f1b76d7385393e137.zip
** Fixes bug #437579
2007-10-09 Matthew Barnes <mbarnes@redhat.com> ** Fixes bug #437579 * addressbook/conduit/address-conduit.c: * addressbook/gui/component/addressbook-config.c: * addressbook/gui/contact-editor/e-contact-editor.c: * addressbook/gui/widgets/eab-gui-util.c: * calendar/conduits/calendar/calendar-conduit.c: * calendar/conduits/memo/memo-conduit.c: * calendar/conduits/todo/todo-conduit.c: * calendar/gui/dialogs/alarm-dialog.c: * calendar/gui/dialogs/event-page.c: * calendar/gui/dialogs/memo-page.c: * calendar/gui/dialogs/task-page.c: * calendar/gui/e-day-view-layout.c: * calendar/gui/e-day-view-layout.h: * calendar/gui/print.c: * e-util/e-pilot-map.c: * e-util/e-plugin.c: * e-util/e-profile-event.c: * e-util/e-signature.c: * filter/filter-file.c: * mail/e-searching-tokenizer.c: * mail/em-folder-browser.c: * mail/em-format-html.c: * mail/em-format-view.c: * mail/em-format.c: * mail/em-mailer-prefs.c: * mail/em-mailer-prefs.h: * mail/mail-session.c: * mail/mail-session.h: * mail/mail-vfolder.c: * mail/message-list.c: * plugins/bbdb/bbdb.c: * plugins/bbdb/gaimbuddies.c: * plugins/calendar-http/calendar-http.c: * plugins/exchange-operations/exchange-user-dialog.c: * plugins/face/face.c: * shell/e-shell-window.c: * shell/e-shell.c: * smime/lib/e-cert-db.c: * tools/killev.c: * widgets/misc/e-cursors.c: * widgets/misc/e-spinner.c: * widgets/misc/e-unicode.c: * widgets/table/e-table-field-chooser-item.c: * widgets/table/e-table-header-item.c: * widgets/table/e-table-header-item.h: * widgets/table/e-table-header-utils.c: * widgets/table/e-table.c: * widgets/text/e-text.c: Fix various compiler warnings. Patch from Milan Crha. svn path=/trunk/; revision=34368
Diffstat (limited to 'mail/e-searching-tokenizer.c')
-rw-r--r--mail/e-searching-tokenizer.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/mail/e-searching-tokenizer.c b/mail/e-searching-tokenizer.c
index 80d4bae963..9cbb71a09d 100644
--- a/mail/e-searching-tokenizer.c
+++ b/mail/e-searching-tokenizer.c
@@ -162,7 +162,7 @@ loop:
static char *ignored_tags[] = { "B", "I", "FONT", "TT", "EM", /* and more? */};
static int
-ignore_tag(const char *tag)
+ignore_tag (const char *tag)
{
char *t = alloca(strlen(tag)+1), c, *out;
const char *in;
@@ -260,10 +260,10 @@ g(struct _state *q, guint32 c)
}
static struct _trie *
-build_trie(int nocase, int len, char **words)
+build_trie(int nocase, int len, unsigned char **words)
{
struct _state *q, *qt, *r;
- char *word;
+ const unsigned char *word;
struct _match *m, *n = NULL;
int i, depth;
guint32 c;
@@ -294,7 +294,7 @@ build_trie(int nocase, int len, char **words)
word = words[i];
q = &trie->root;
depth = 0;
- while ((c = camel_utf8_getc((const unsigned char **)&word))) {
+ while ((c = camel_utf8_getc (&word))) {
if (nocase)
c = g_unichar_tolower(c);
m = g(q, c);
@@ -439,7 +439,7 @@ searcher_set_tokenfunc(struct _searcher *s, char *(*next)(), void *data)
}
static struct _searcher *
-searcher_new(int flags, int argc, char **argv, const char *tags, const char *tage)
+searcher_new (int flags, int argc, unsigned char **argv, const char *tags, const char *tage)
{
int i, m;
struct _searcher *s;
@@ -717,7 +717,7 @@ static char *
searcher_next_token(struct _searcher *s)
{
struct _token *token;
- char *tok, *stok, *pre_tok;
+ const unsigned char *tok, *stok, *pre_tok;
struct _trie *t = s->t;
struct _state *q = s->state;
struct _match *m = NULL;
@@ -726,7 +726,7 @@ searcher_next_token(struct _searcher *s)
while (e_dlist_empty(&s->output)) {
/* get next token */
- tok = s->next_token(s->next_data);
+ tok = (unsigned char *)s->next_token(s->next_data);
if (tok == NULL) {
output_subpending(s);
output_pending(s);
@@ -734,15 +734,15 @@ searcher_next_token(struct _searcher *s)
}
/* we dont always have to copy each token, e.g. if we dont match anything */
- token = append_token(&s->input, tok, -1);
+ token = append_token(&s->input, (char *)tok, -1);
token->offset = s->offset;
- tok = token->tok;
+ tok = (unsigned char *)token->tok;
d(printf("new token %d '%s'\n", token->offset, token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok));
/* tag test, reset state on unknown tags */
if (tok[0] == TAG_ESCAPE) {
- if (!ignore_tag(tok)) {
+ if (!ignore_tag ((char *)tok)) {
/* force reset */
output_subpending(s);
output_pending(s);
@@ -754,7 +754,7 @@ searcher_next_token(struct _searcher *s)
/* process whole token */
pre_tok = stok = tok;
- while ((c = camel_utf8_getc((const unsigned char **)&tok))) {
+ while ((c = camel_utf8_getc (&tok))) {
if ((s->flags & SEARCH_CASE) == 0)
c = g_unichar_tolower(c);
while (q && (m = g(q, c)) == NULL)
@@ -876,21 +876,22 @@ search_info_set_colour(struct _search_info *si, const char *colour)
static void
search_info_add_string(struct _search_info *si, const char *s)
{
- const char *start;
+ const unsigned char *start;
guint32 c;
if (s && s[0]) {
+ const unsigned char *us = (unsigned char *) s;
/* strip leading whitespace */
- start = s;
- while ((c = camel_utf8_getc((const unsigned char **)&s))) {
- if (!g_unichar_isspace(c)) {
+ start = us;
+ while ((c = camel_utf8_getc (&us))) {
+ if (!g_unichar_isspace (c)) {
break;
}
- start = s;
+ start = us;
}
/* should probably also strip trailing, but i'm lazy today */
if (start[0])
- g_ptr_array_add(si->strv, g_strdup(start));
+ g_ptr_array_add(si->strv, g_strdup ((char *)start));
}
}
@@ -953,7 +954,7 @@ search_info_to_searcher(struct _search_info *si)
tage = alloca(20);
sprintf(tage, "%c</font>", TAG_ESCAPE);
- return searcher_new(si->flags, si->strv->len, (char **)si->strv->pdata, tags, tage);
+ return searcher_new (si->flags, si->strv->len, (unsigned char **)si->strv->pdata, tags, tage);
}
/* ********************************************************************** */