aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog17
-rw-r--r--mail/e-searching-tokenizer.c37
-rw-r--r--mail/em-folder-browser.c26
-rw-r--r--mail/em-folder-view.c2
-rw-r--r--mail/em-format-html.c6
-rw-r--r--mail/em-format.c2
-rw-r--r--mail/em-mailer-prefs.c2
-rw-r--r--mail/em-mailer-prefs.h2
-rw-r--r--mail/mail-session.c2
-rw-r--r--mail/mail-session.h2
-rw-r--r--mail/mail-vfolder.c39
-rw-r--r--mail/message-list.c7
12 files changed, 66 insertions, 78 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 47aef1ada1..b7205a1efc 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,20 @@
+2007-10-09 Matthew Barnes <mbarnes@redhat.com>
+
+ ** Fixes part of bug #437579
+
+ * e-searching-tokenizer.c:
+ * em-folder-browser.c:
+ * em-format-html.c:
+ * em-format-view.c:
+ * em-format.c:
+ * em-mailer-prefs.c:
+ * em-mailer-prefs.h:
+ * mail-session.c:
+ * mail-session.h:
+ * mail-vfolder.c:
+ * message-list.c:
+ Fix various compiler warnings. Patch from Milan Crha.
+
2007-10-09 Tobias Mueller <muelli@auftrags-killer.org>
** Fix for bug #482575
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);
}
/* ********************************************************************** */
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index 95638fd74c..4cb10acae4 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -111,7 +111,6 @@ struct _EMFolderBrowserPrivate {
guint search_menu_activated_id;
guint search_activated_id;
- guint search_query_changed_id;
double default_scroll_position;
guint idle_scroll_id;
@@ -142,7 +141,6 @@ static void emfb_set_search_folder(EMFolderView *emfv, CamelFolder *folder, cons
static void emfb_search_config_search(EFilterBar *efb, FilterRule *rule, int id, const char *query, void *data);
static void emfb_search_menu_activated(ESearchBar *esb, int id, EMFolderBrowser *emfb);
static void emfb_search_search_activated(ESearchBar *esb, EMFolderBrowser *emfb);
-static void emfb_search_query_changed(ESearchBar *esb, EMFolderBrowser *emfb);
static void emfb_search_search_cleared(ESearchBar *esb);
static int emfb_list_key_press(ETree *tree, int row, ETreePath path, int col, GdkEvent *ev, EMFolderBrowser *emfb);
@@ -471,7 +469,6 @@ emfb_init(GObject *o)
p->search_menu_activated_id = g_signal_connect(emfb->search, "menu_activated", G_CALLBACK(emfb_search_menu_activated), emfb);
p->search_activated_id = g_signal_connect(emfb->search, "search_activated", G_CALLBACK(emfb_search_search_activated), emfb);
-/* p->search_query_changed_id = g_signal_connect(emfb->search, "query_changed", G_CALLBACK(emfb_search_query_changed), emfb); */
g_signal_connect(emfb->search, "search_cleared", G_CALLBACK(emfb_search_search_cleared), NULL);
gtk_box_pack_start((GtkBox *)emfb, (GtkWidget *)emfb->search, FALSE, TRUE, 0);
@@ -1148,29 +1145,6 @@ emfb_search_search_activated(ESearchBar *esb, EMFolderBrowser *emfb)
}
static void
-emfb_search_query_changed(ESearchBar *esb, EMFolderBrowser *emfb)
-{
- int search_scope;
- int item_id;
-
- search_scope = e_search_bar_get_search_scope (esb);
- item_id = e_search_bar_get_item_id (esb);
-
- /* Close the current message search bar */
- if ( search_scope != E_FILTERBAR_CURRENT_MESSAGE_ID ) {
- em_format_html_display_search_close (emfb->view.preview);
- gtk_widget_set_sensitive (esb->option_button, TRUE);
- } else
- gtk_widget_set_sensitive (esb->option_button, FALSE);
-
- switch (item_id) {
- case E_FILTERBAR_ADVANCED_ID:
- emfb_search_search_activated(esb, emfb);
- break;
- }
-}
-
-static void
emfb_search_search_cleared(ESearchBar *esb)
{
/* FIXME: It should just cancel search.*/
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index 90f3c3418b..3c2fdab81c 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -2408,7 +2408,7 @@ emfv_message_selected_timeout(void *data)
if (emfv->priv->selected_uid) {
if (emfv->displayed_uid == NULL || strcmp(emfv->displayed_uid, emfv->priv->selected_uid) != 0) {
- GtkHTMLStream *hstream;
+ /*GtkHTMLStream *hstream;*/
g_free(emfv->displayed_uid);
emfv->displayed_uid = emfv->priv->selected_uid;
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 6953992f5a..9a1cdf6efe 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -1512,12 +1512,6 @@ static char *addrspec_hdrs[] = {
"resent-to", "resent-cc", "resent-bcc", NULL
};
-/* FIXME: include Sender and Resent-* headers too? */
-/* For Translators only: The following strings are used in the header table in the preview pane */
-static char *i18n_hdrs[] = {
- N_("From"), N_("Reply-To"), N_("To"), N_("Cc"), N_("Bcc")
-};
-
static gchar *
efh_format_address (EMFormatHTML *efh, GString *out, struct _camel_header_address *a, gchar *field)
{
diff --git a/mail/em-format.c b/mail/em-format.c
index aa54470409..94cba750bf 100644
--- a/mail/em-format.c
+++ b/mail/em-format.c
@@ -366,7 +366,7 @@ em_format_add_puri(EMFormat *emf, size_t size, const char *cid, CamelMimePart *p
d(printf("adding puri for part: %s\n", emf->part_id->str));
if (size < sizeof(*puri)) {
- g_warning ("size (%ld) less than size of puri\n", size);
+ g_warning ("size (%d) less than size of puri\n", size);
size = sizeof (*puri);
}
diff --git a/mail/em-mailer-prefs.c b/mail/em-mailer-prefs.c
index a8f64a5728..a47f274e5b 100644
--- a/mail/em-mailer-prefs.c
+++ b/mail/em-mailer-prefs.c
@@ -865,7 +865,7 @@ junk_plugin_setup (GtkWidget *combo, EMMailerPrefs *prefs)
}
GtkWidget *
-create_combo_text_widget () {
+create_combo_text_widget (void) {
return gtk_combo_box_new_text ();
}
diff --git a/mail/em-mailer-prefs.h b/mail/em-mailer-prefs.h
index 28a5e6db10..fe3bb13003 100644
--- a/mail/em-mailer-prefs.h
+++ b/mail/em-mailer-prefs.h
@@ -142,7 +142,7 @@ struct _EMMailerPrefsClass {
};
GtkType em_mailer_prefs_get_type (void);
-GtkWidget * create_combo_text_widget ();
+GtkWidget * create_combo_text_widget (void);
struct _GtkWidget *em_mailer_prefs_new (void);
diff --git a/mail/mail-session.c b/mail/mail-session.c
index a8bc8bf978..3b2308355a 100644
--- a/mail/mail-session.c
+++ b/mail/mail-session.c
@@ -745,7 +745,7 @@ mail_session_add_junk_plugin (const char *plugin_name, CamelJunkPlugin *junk_plu
}
const GList *
-mail_session_get_junk_plugins ()
+mail_session_get_junk_plugins (void)
{
MailSession *ms = (MailSession *) session;
return ms->junk_plugins;
diff --git a/mail/mail-session.h b/mail/mail-session.h
index c507c3a2d5..36c175772b 100644
--- a/mail/mail-session.h
+++ b/mail/mail-session.h
@@ -51,7 +51,7 @@ void mail_session_flush_filter_log (void);
void mail_session_add_junk_plugin (const char *plugin_name, CamelJunkPlugin *junk_plugin);
-const GList * mail_session_get_junk_plugins ();
+const GList * mail_session_get_junk_plugins (void);
extern CamelSession *session;
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index 45f4becef6..a138a06ad3 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -725,15 +725,17 @@ rule_changed(FilterRule *rule, CamelFolder *folder)
/* if the folder has changed name, then add it, then remove the old manually */
if (strcmp(folder->full_name, rule->name) != 0) {
- char *key, *oldname;
- CamelFolder *old;
+ char *oldname;
+
+ gpointer key;
+ gpointer oldfolder;
LOCK();
d(printf("Changing folder name in hash table to '%s'\n", rule->name));
- if (g_hash_table_lookup_extended(vfolder_hash, folder->full_name, (void **)&key, (void **)&old)) {
- g_hash_table_remove(vfolder_hash, key);
- g_free(key);
- g_hash_table_insert(vfolder_hash, g_strdup(rule->name), folder);
+ if (g_hash_table_lookup_extended (vfolder_hash, folder->full_name, &key, &oldfolder)) {
+ g_hash_table_remove (vfolder_hash, key);
+ g_free (key);
+ g_hash_table_insert (vfolder_hash, g_strdup(rule->name), folder);
UNLOCK();
} else {
UNLOCK();
@@ -787,8 +789,9 @@ static void context_rule_added(RuleContext *ctx, FilterRule *rule)
static void context_rule_removed(RuleContext *ctx, FilterRule *rule)
{
- char *key, *path;
- CamelFolder *folder = NULL;
+ char *path;
+
+ gpointer key, folder = NULL;
d(printf("rule removed; %s\n", rule->name));
@@ -802,16 +805,16 @@ static void context_rule_removed(RuleContext *ctx, FilterRule *rule)
g_free(path);
LOCK();
- if (g_hash_table_lookup_extended(vfolder_hash, rule->name, (void **)&key, (void **)&folder)) {
- g_hash_table_remove(vfolder_hash, key);
- g_free(key);
+ if (g_hash_table_lookup_extended (vfolder_hash, rule->name, &key, &folder)) {
+ g_hash_table_remove (vfolder_hash, key);
+ g_free (key);
}
UNLOCK();
camel_store_delete_folder(vfolder_store, rule->name, NULL);
/* this must be unref'd after its deleted */
if (folder)
- camel_object_unref(folder);
+ camel_object_unref ((CamelFolder *) folder);
}
static void
@@ -865,8 +868,8 @@ store_folder_renamed(CamelObject *o, void *event_data, void *data)
CamelRenameInfo *info = event_data;
FilterRule *rule;
char *user;
- char *key;
- CamelFolder *folder;
+
+ gpointer key, folder;
/* This should be more-or-less thread-safe */
@@ -875,10 +878,10 @@ store_folder_renamed(CamelObject *o, void *event_data, void *data)
/* Folder is already renamed? */
LOCK();
d(printf("Changing folder name in hash table to '%s'\n", info->new->full_name));
- if (g_hash_table_lookup_extended(vfolder_hash, info->old_base, (void **)&key, (void **)&folder)) {
- g_hash_table_remove(vfolder_hash, key);
- g_free(key);
- g_hash_table_insert(vfolder_hash, g_strdup(info->new->full_name), folder);
+ if (g_hash_table_lookup_extended (vfolder_hash, info->old_base, &key, &folder)) {
+ g_hash_table_remove (vfolder_hash, key);
+ g_free (key);
+ g_hash_table_insert (vfolder_hash, g_strdup(info->new->full_name), folder);
rule = rule_context_find_rule((RuleContext *)context, info->old_base, NULL);
if (!rule) {
diff --git a/mail/message-list.c b/mail/message-list.c
index bc21e17bae..bb4de2da66 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -2752,11 +2752,10 @@ build_subtree_diff(MessageList *ml, ETreePath parent, ETreePath path, CamelFolde
/* matching nodes, verify details/children */
#if 0
if (bp->message) {
- char *olduid;
- int oldrow;
+ gpointer olduid, oldrow;
/* if this is a message row, check/update the row id map */
- if (g_hash_table_lookup_extended(ml->uid_rowmap, camel_message_info_uid(bp->message), (void *)&olduid, (void *)&oldrow)) {
- if (oldrow != (*row)) {
+ if (g_hash_table_lookup_extended(ml->uid_rowmap, camel_message_info_uid(bp->message), &olduid, &oldrow)) {
+ if ((int)oldrow != (*row)) {
g_hash_table_insert(ml->uid_rowmap, olduid, (void *)(*row));
}
} else {