[balsa/gtk3] Silence whining from gcc-4.6
- From: Peter Bloomfield <PeterB src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk3] Silence whining from gcc-4.6
- Date: Mon, 31 Jan 2011 01:31:06 +0000 (UTC)
commit 7c5b4e7cd794707693c52cd8b1191c8355bb66cc
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Sun Jan 30 20:30:08 2011 -0500
Silence whining from gcc-4.6
* libbalsa/files.c (libbalsa_icon_finder):
* libbalsa/filter-funcs.c (libbalsa_filter_export_sieve):
* libbalsa/identity.c (libbalsa_identity_get_signature):
* libbalsa/imap-server.c (libbalsa_imap_server_finalize):
* libbalsa/imap/imap-handle.c (ir_esearch):
* libbalsa/mailbox_imap.c (libbalsa_mailbox_imap_open):
* libbalsa/mailbox_local.c (libbalsa_mailbox_local_load_config):
* libbalsa/mailbox_maildir.c
(libbalsa_mailbox_maildir_add_message):
* libbalsa/rfc2445.c (date_time_2445_to_time_t):
* libbalsa/rfc3156.c (get_passphrase_cb):
* libbalsa/server.c (libbalsa_server_user_cb):
* libbalsa/smtp-server.c (libbalsa_smtp_server_finalize),
(libbalsa_smtp_server_class_init):
* src/address-book-config.c (create_generic_dialog):
* src/main.c (config_init), (mailboxes_init):
* src/save-restore.c (config_filter_load), (config_filters_save),
(config_defclient_save):
* src/sendmsg-window.c (edit_with_gnome_check):
* src/spell-check.c (balsa_spell_check_class_init):
ChangeLog | 25 +++++++++++++++++++++++++
libbalsa/files.c | 4 +---
libbalsa/filter-funcs.c | 4 ++++
libbalsa/identity.c | 5 ++---
libbalsa/imap-server.c | 4 +---
libbalsa/imap/imap-handle.c | 2 --
libbalsa/mailbox_imap.c | 4 +---
libbalsa/mailbox_local.c | 5 +----
libbalsa/mailbox_maildir.c | 2 --
libbalsa/rfc2445.c | 2 --
libbalsa/rfc3156.c | 14 +++++++-------
libbalsa/server.c | 6 ++----
libbalsa/smtp-server.c | 4 ----
src/address-book-config.c | 3 ---
src/main.c | 4 ++++
src/save-restore.c | 28 +++++++++++++++++-----------
src/sendmsg-window.c | 2 --
src/spell-check.c | 4 ----
18 files changed, 65 insertions(+), 57 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 79fc09c..d45f89c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,30 @@
2011-01-30 Peter Bloomfield
+ Silence whining from gcc-4.6
+
+ * libbalsa/files.c (libbalsa_icon_finder):
+ * libbalsa/filter-funcs.c (libbalsa_filter_export_sieve):
+ * libbalsa/identity.c (libbalsa_identity_get_signature):
+ * libbalsa/imap-server.c (libbalsa_imap_server_finalize):
+ * libbalsa/imap/imap-handle.c (ir_esearch):
+ * libbalsa/mailbox_imap.c (libbalsa_mailbox_imap_open):
+ * libbalsa/mailbox_local.c (libbalsa_mailbox_local_load_config):
+ * libbalsa/mailbox_maildir.c
+ (libbalsa_mailbox_maildir_add_message):
+ * libbalsa/rfc2445.c (date_time_2445_to_time_t):
+ * libbalsa/rfc3156.c (get_passphrase_cb):
+ * libbalsa/server.c (libbalsa_server_user_cb):
+ * libbalsa/smtp-server.c (libbalsa_smtp_server_finalize),
+ (libbalsa_smtp_server_class_init):
+ * src/address-book-config.c (create_generic_dialog):
+ * src/main.c (config_init), (mailboxes_init):
+ * src/save-restore.c (config_filter_load), (config_filters_save),
+ (config_defclient_save):
+ * src/sendmsg-window.c (edit_with_gnome_check):
+ * src/spell-check.c (balsa_spell_check_class_init):
+
+2011-01-30 Peter Bloomfield
+
* src/toolbar-factory.c (balsa_toolbar_model_finalize),
(balsa_toolbar_model_new): do not refer to "org.gnome.*" when
not HAVE_GNOME;
diff --git a/libbalsa/files.c b/libbalsa/files.c
index 8869449..fbbd7b2 100644
--- a/libbalsa/files.c
+++ b/libbalsa/files.c
@@ -138,7 +138,6 @@ libbalsa_icon_finder(GtkWidget * widget,
gchar *icon = NULL;
GdkPixbuf *pixbuf = NULL;
gint width, height;
- const gchar * filename = NULL;
GtkIconTheme *icon_theme;
GtkSettings *settings;
@@ -152,7 +151,6 @@ libbalsa_icon_finder(GtkWidget * widget,
content_type = mime_type;
else if (for_file) {
content_type = libbalsa_vfs_get_mime_type(for_file);
- filename = libbalsa_vfs_get_uri(for_file);
} else
content_type = "application/octet-stream";
@@ -172,7 +170,7 @@ libbalsa_icon_finder(GtkWidget * widget,
}
g_strfreev(icon_names);
g_object_unref(icon);
-
+
/* last resort: try gnome-mime-<base mime type> */
if (!pixbuf) {
gchar * base_type_icon = g_strdup_printf("gnome-mime-%s", content_type);
diff --git a/libbalsa/filter-funcs.c b/libbalsa/filter-funcs.c
index 4fbf7dd..53aecf8 100644
--- a/libbalsa/filter-funcs.c
+++ b/libbalsa/filter-funcs.c
@@ -867,13 +867,17 @@ gboolean
libbalsa_filter_export_sieve(LibBalsaFilter* fil, gchar* filename)
{
FILE * fp;
+#if 0
GString * buffer;
+#endif
gint nb = 0;
fp=fopen(filename,"w");
if (!fp) return FALSE;
+#if 0
buffer=g_string_new("# Sieve script automatically generated by Balsa "
"(Exporting a Balsa filter)\n");
+#endif
g_warning("%s: FIXME!\n", __func__);
#if 0
diff --git a/libbalsa/identity.c b/libbalsa/identity.c
index d550d08..e8931d8 100644
--- a/libbalsa/identity.c
+++ b/libbalsa/identity.c
@@ -325,7 +325,6 @@ gchar*
libbalsa_identity_get_signature(LibBalsaIdentity* identity, GtkWindow *parent)
{
FILE *fp = NULL;
- size_t len = 0;
gchar *ret = NULL, *path;
if (identity->signature_path == NULL ||
@@ -337,7 +336,7 @@ libbalsa_identity_get_signature(LibBalsaIdentity* identity, GtkWindow *parent)
/* signature is executable */
fp = popen(path,"r");
if (fp) {
- len = libbalsa_readfile_nostat(fp, &ret);
+ libbalsa_readfile_nostat(fp, &ret);
pclose(fp);
} else
libbalsa_information_parented
@@ -348,7 +347,7 @@ libbalsa_identity_get_signature(LibBalsaIdentity* identity, GtkWindow *parent)
/* sign is normal file */
fp = fopen(path, "r");
if (fp) {
- len = libbalsa_readfile_nostat(fp, &ret);
+ libbalsa_readfile_nostat(fp, &ret);
fclose(fp);
} else
libbalsa_information_parented(parent, LIBBALSA_INFORMATION_ERROR,
diff --git a/libbalsa/imap-server.c b/libbalsa/imap-server.c
index 27af875..00c05e1 100644
--- a/libbalsa/imap-server.c
+++ b/libbalsa/imap-server.c
@@ -233,18 +233,16 @@ libbalsa_imap_server_init(LibBalsaImapServer * imap_server)
static void
libbalsa_imap_server_finalize(GObject * object)
{
- LibBalsaServer *server;
LibBalsaImapServer *imap_server;
g_return_if_fail(LIBBALSA_IS_IMAP_SERVER(object));
- server = LIBBALSA_SERVER(object);
imap_server = LIBBALSA_IMAP_SERVER(object);
LOCK_SERVERS();
g_hash_table_remove(imap_servers, imap_server->key);
UNLOCK_SERVERS();
-
+
g_source_remove(imap_server->connection_cleanup_id);
#if 0
diff --git a/libbalsa/imap/imap-handle.c b/libbalsa/imap/imap-handle.c
index 3922217..8308f29 100644
--- a/libbalsa/imap/imap-handle.c
+++ b/libbalsa/imap/imap-handle.c
@@ -2779,7 +2779,6 @@ static ImapResponse
ir_esearch(ImapMboxHandle *h)
{
char atom[LONG_STRING];
- int uid_data = 0;
int c = sio_getc(h->sio);
if(c == '(') { /* search correlator */
gchar *str;
@@ -2806,7 +2805,6 @@ ir_esearch(ImapMboxHandle *h)
c = imap_get_atom(h->sio, atom, sizeof(atom));
if(g_ascii_strcasecmp(atom, "UID") == 0) {
- uid_data = 1;
c = imap_get_atom(h->sio, atom, sizeof(atom));
}
if(c == EOF) return IMR_SEVERED;
diff --git a/libbalsa/mailbox_imap.c b/libbalsa/mailbox_imap.c
index 3e6d7fe..c2e130c 100644
--- a/libbalsa/mailbox_imap.c
+++ b/libbalsa/mailbox_imap.c
@@ -1073,7 +1073,6 @@ static gboolean
libbalsa_mailbox_imap_open(LibBalsaMailbox * mailbox, GError **err)
{
LibBalsaMailboxImap *mimap;
- LibBalsaServer *server;
unsigned i;
guint total_messages;
struct ImapCacheManager *icm;
@@ -1082,7 +1081,6 @@ libbalsa_mailbox_imap_open(LibBalsaMailbox * mailbox, GError **err)
g_return_val_if_fail(LIBBALSA_IS_MAILBOX_IMAP(mailbox), FALSE);
mimap = LIBBALSA_MAILBOX_IMAP(mailbox);
- server = LIBBALSA_MAILBOX_REMOTE_SERVER(mailbox);
mimap->handle = libbalsa_mailbox_imap_get_selected_handle(mimap, err);
if (!mimap->handle) {
@@ -1094,7 +1092,7 @@ libbalsa_mailbox_imap_open(LibBalsaMailbox * mailbox, GError **err)
mimap->opened = TRUE;
mailbox->disconnected = FALSE;
total_messages = imap_mbox_handle_get_exists(mimap->handle);
- mimap->messages_info = g_array_sized_new(FALSE, TRUE,
+ mimap->messages_info = g_array_sized_new(FALSE, TRUE,
sizeof(struct message_info),
total_messages);
mimap->msgids = g_ptr_array_sized_new(total_messages);
diff --git a/libbalsa/mailbox_local.c b/libbalsa/mailbox_local.c
index d230529..8c5c90a 100644
--- a/libbalsa/mailbox_local.c
+++ b/libbalsa/mailbox_local.c
@@ -418,12 +418,9 @@ static void
libbalsa_mailbox_local_load_config(LibBalsaMailbox * mailbox,
const gchar * prefix)
{
- LibBalsaMailboxLocal *local;
gchar* path;
g_return_if_fail(LIBBALSA_IS_MAILBOX_LOCAL(mailbox));
- local = LIBBALSA_MAILBOX_LOCAL(mailbox);
-
g_free(mailbox->url);
path = libbalsa_conf_get_string("Path");
@@ -434,7 +431,7 @@ libbalsa_mailbox_local_load_config(LibBalsaMailbox * mailbox,
LIBBALSA_MAILBOX_CLASS(parent_class)->load_config(mailbox, prefix);
}
-/*
+/*
* Save and restore the message tree.
*/
diff --git a/libbalsa/mailbox_maildir.c b/libbalsa/mailbox_maildir.c
index 4b1598d..8d6a769 100644
--- a/libbalsa/mailbox_maildir.c
+++ b/libbalsa/mailbox_maildir.c
@@ -901,7 +901,6 @@ libbalsa_mailbox_maildir_add_message(LibBalsaMailbox * mailbox,
char *new_filename;
struct message_info *msg_info;
gint retval;
- LibBalsaMailboxMaildir *mdir;
time_t mtime;
/* open tempfile */
@@ -947,7 +946,6 @@ libbalsa_mailbox_maildir_add_message(LibBalsaMailbox * mailbox,
free_message_info(msg_info);
g_free(tmp);
- mdir = (LibBalsaMailboxMaildir *) mailbox;
if ((mtime = libbalsa_mailbox_get_mtime(mailbox)) != 0)
/* If we checked or synced the mailbox less than 1 second ago,
* the cached modification time could be the same as the new
diff --git a/libbalsa/rfc2445.c b/libbalsa/rfc2445.c
index dc3d3dd..fd2dbf0 100644
--- a/libbalsa/rfc2445.c
+++ b/libbalsa/rfc2445.c
@@ -502,7 +502,6 @@ date_time_2445_to_time_t(const gchar * date_time)
gint len;
struct tm tm_buf;
char strbuf[17];
- gboolean is_utc;
time_t the_time;
struct tm utc_tm;
time_t utc_time;
@@ -519,7 +518,6 @@ date_time_2445_to_time_t(const gchar * date_time)
/* fill for conversion... */
strcpy(strbuf, date_time); /* safe, due to checks above */
if (len == 16) {
- is_utc = TRUE;
strbuf[15] = '\0';
}
FILL_TM(tm_buf.tm_sec, strbuf, 13);
diff --git a/libbalsa/rfc3156.c b/libbalsa/rfc3156.c
index d022d0f..a56e12c 100644
--- a/libbalsa/rfc3156.c
+++ b/libbalsa/rfc3156.c
@@ -1803,11 +1803,11 @@ get_passphrase_cb(void *opaque, const char *uid_hint,
{
GMimeGpgmeContext *context;
gchar *passwd = NULL;
- int foo;
+ int foo, bar;
if (!opaque || !GMIME_IS_GPGME_CONTEXT(opaque)) {
foo = write(fd, "\n", 1);
- return GPG_ERR_USER_1;
+ return foo > 0 ? GPG_ERR_USER_1 : GPG_ERR_EIO;
}
context = GMIME_GPGME_CONTEXT(opaque);
@@ -1818,10 +1818,10 @@ get_passphrase_cb(void *opaque, const char *uid_hint,
/* check if we have the passphrase already cached... */
if ((passwd = check_cache(pcache, uid_hint, prev_was_bad))) {
foo = write(fd, passwd, strlen(passwd));
- foo = write(fd, "\n", 1);
+ bar = write(fd, "\n", 1);
wipe_string(passwd);
g_free(passwd);
- return GPG_ERR_NO_ERROR;
+ return foo > 0 && bar > 0 ? GPG_ERR_NO_ERROR : GPG_ERR_EIO;
}
#endif
@@ -1857,15 +1857,15 @@ get_passphrase_cb(void *opaque, const char *uid_hint,
if (!passwd) {
foo = write(fd, "\n", 1);
- return GPG_ERR_CANCELED;
+ return foo > 0 ? GPG_ERR_CANCELED : GPG_ERR_EIO;
}
/* send the passphrase and erase the string */
foo = write(fd, passwd, strlen(passwd));
wipe_string(passwd);
g_free(passwd);
- foo = write(fd, "\n", 1);
- return GPG_ERR_NO_ERROR;
+ bar = write(fd, "\n", 1);
+ return foo > 0 && bar > 0 ? GPG_ERR_NO_ERROR : GPG_ERR_EIO;
}
diff --git a/libbalsa/server.c b/libbalsa/server.c
index 1b49c51..fd42f06 100644
--- a/libbalsa/server.c
+++ b/libbalsa/server.c
@@ -435,8 +435,7 @@ libbalsa_server_user_cb(ImapUserEventType ue, void *arg, ...)
}
case IME_GET_USER: { /* for eg kerberos */
gchar **user;
- gchar *dummy;
- dummy = va_arg(alist, gchar*); /* Ignore the method */
+ va_arg(alist, gchar*); /* Ignore the method */
user = va_arg(alist, gchar**);
ok = va_arg(alist, int*);
*ok = 1; /* consider popping up a dialog window here */
@@ -448,10 +447,9 @@ libbalsa_server_user_cb(ImapUserEventType ue, void *arg, ...)
long vfy_result;
SSL *ssl;
X509 *cert;
- const char *reason;
ok = va_arg(alist, int*);
vfy_result = va_arg(alist, long);
- reason = X509_verify_cert_error_string(vfy_result);
+ X509_verify_cert_error_string(vfy_result);
#if 0
printf("IMAP:TLS: failed cert verification: %ld : %s.\n",
vfy_result, reason);
diff --git a/libbalsa/smtp-server.c b/libbalsa/smtp-server.c
index 7951857..e0c3179 100644
--- a/libbalsa/smtp-server.c
+++ b/libbalsa/smtp-server.c
@@ -65,12 +65,10 @@ typedef struct _LibBalsaSmtpServerClass {
static void
libbalsa_smtp_server_finalize(GObject * object)
{
- LibBalsaServer *server;
LibBalsaSmtpServer *smtp_server;
g_return_if_fail(LIBBALSA_IS_SMTP_SERVER(object));
- server = LIBBALSA_SERVER(object);
smtp_server = LIBBALSA_SMTP_SERVER(object);
auth_destroy_context(smtp_server->authctx);
@@ -86,10 +84,8 @@ static void
libbalsa_smtp_server_class_init(LibBalsaSmtpServerClass * klass)
{
GObjectClass *object_class;
- LibBalsaServerClass *server_class;
object_class = G_OBJECT_CLASS(klass);
- server_class = LIBBALSA_SERVER_CLASS(klass);
parent_class = g_type_class_peek_parent(klass);
diff --git a/src/address-book-config.c b/src/address-book-config.c
index c55be05..87f3f98 100644
--- a/src/address-book-config.c
+++ b/src/address-book-config.c
@@ -323,18 +323,15 @@ create_generic_dialog(AddressBookConfig * abc, const gchar * type)
GtkWidget *dialog;
gchar *title;
const gchar *action;
- const gchar *name;
LibBalsaAddressBook *ab;
ab = abc->address_book;
if (ab) {
title = g_strdup_printf(_("Modify %s Address Book"), type);
action = GTK_STOCK_APPLY;
- name = ab->name;
} else {
title = g_strdup_printf(_("Add %s Address Book"), type);
action = GTK_STOCK_ADD;
- name = NULL;
}
dialog =
diff --git a/src/main.c b/src/main.c
index b4a181f..70bca10 100644
--- a/src/main.c
+++ b/src/main.c
@@ -432,7 +432,9 @@ config_init(gboolean check_only)
{
while(!config_load() && !check_only) {
balsa_init_begin();
+#if HAVE_GNOME
config_defclient_save();
+#endif /* HAVE_GNOME */
}
}
@@ -443,7 +445,9 @@ mailboxes_init(gboolean check_only)
if (!balsa_app.inbox && !check_only) {
g_warning("*** error loading mailboxes\n");
balsa_init_begin();
+#if HAVE_GNOME
config_defclient_save();
+#endif /* HAVE_GNOME */
return;
}
}
diff --git a/src/save-restore.c b/src/save-restore.c
index c8fb223..ca0ed8c 100644
--- a/src/save-restore.c
+++ b/src/save-restore.c
@@ -1957,6 +1957,8 @@ config_filter_load(const gchar * key, const gchar * value, gpointer data)
long int dummy;
dummy = strtol(value, &endptr, 10);
+ if (dummy == LONG_MIN || dummy == LONG_MAX)
+ g_message("Value is too large");
if (*endptr) { /* Bad format. */
libbalsa_conf_remove_group(key);
return FALSE;
@@ -2006,6 +2008,8 @@ config_filters_save(void)
for(list = balsa_app.filters; list; list = list->next) {
fil = (LibBalsaFilter*)(list->data);
i=snprintf(tmp,tmp_len,"%d",nb++);
+ if (i >= tmp_len)
+ g_message("Group name was truncated");
libbalsa_conf_push_group(buffer);
libbalsa_filter_save_config(fil);
libbalsa_conf_pop_group();
@@ -2014,6 +2018,8 @@ config_filters_save(void)
/* This loop takes care of cleaning up old filter sections */
while (TRUE) {
i=snprintf(tmp,tmp_len,"%d",nb++);
+ if (i >= tmp_len)
+ g_message("Group name was truncated");
if (libbalsa_conf_has_group(buffer)) {
libbalsa_conf_remove_group(buffer);
}
@@ -2110,6 +2116,7 @@ save_mru(GList * mru, const gchar * group)
libbalsa_conf_pop_group();
}
+#if HAVE_GNOME
void
config_defclient_save(void)
{
@@ -2118,25 +2125,24 @@ config_defclient_save(void)
} settings_string[] = { {
"command", "balsa -m \"%s\""}, {
"description", "Email"}};
- static struct {
- const char *key;
- gboolean val;
- } settings_bool[] = { {
- "need-terminal", FALSE}, {
- "-handlers/mailto/enabled", TRUE}};
if (balsa_app.default_client) {
GSettings *settings;
unsigned i;
- settings = g_settings_new("desktop.gnome.url-handlers.mailto");
+ settings = g_settings_new("org.gnome.desktop.url-handlers.mailto");
for (i = 0; i < G_N_ELEMENTS(settings_string); i++) {
g_settings_set_string(settings, settings_string[i].key,
settings_string[i].val);
}
- for (i = 0; i < G_N_ELEMENTS(settings_bool); i++) {
- g_settings_set_boolean(settings, settings_bool[i].key,
- settings_bool[i].val);
- }
+ g_settings_set_boolean(settings, "need-terminal", FALSE);
+ g_object_unref(settings);
+
+ settings =
+ g_settings_new
+ ("org.gnome.desktop.url-handlers.mailto-handlers.mailto");
+ g_settings_set_boolean(settings, "enabled", TRUE);
+ g_object_unref(settings);
}
}
+#endif /* HAVE_GNOME */
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index c7fcac9..c16fcfd 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -1113,7 +1113,6 @@ edit_with_gnome_check(gpointer data) {
GtkTextBuffer *buffer;
pid_t pid;
- gint curposition;
gchar line[81]; /* FIXME:All lines should wrap at this line */
/* Editor not ready */
pid = waitpid (data_real->pid_editor, NULL, WNOHANG);
@@ -1160,7 +1159,6 @@ edit_with_gnome_check(gpointer data) {
#endif /* HAVE_GTKSOURCEVIEW */
sw_buffer_signals_block(data_real->bsmsg, buffer);
gtk_text_buffer_set_text(buffer, "", 0);
- curposition = 0;
while(fgets(line, sizeof(line), tmp))
gtk_text_buffer_insert_at_cursor(buffer, line, -1);
sw_buffer_signals_unblock(data_real->bsmsg, buffer);
diff --git a/src/spell-check.c b/src/spell-check.c
index fa065db..5d36c8a 100644
--- a/src/spell-check.c
+++ b/src/spell-check.c
@@ -192,12 +192,8 @@ static void
balsa_spell_check_class_init(BalsaSpellCheckClass * klass)
{
GObjectClass *object_class;
- GtkWidgetClass *widget_class;
- GtkContainerClass *container_class;
object_class = (GObjectClass *) klass;
- widget_class = (GtkWidgetClass *) klass;
- container_class = (GtkContainerClass *) klass;
parent_class = g_type_class_peek_parent(klass);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]