talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 5ef69f3066f6152a058fb8c84d67df8584ec9d83
parent 856244f896f0c2e3b242424cac74abee1365b336
Author: Paul <paul@claws-mail.org>
Date:   Sat, 26 May 2018 11:21:19 +0100

fix bug #4023, 'Fix some small issues'

* src/common/plugin.c: Remove redundant 'const' qualifier
* src/jpilot.c: Remove redundant parentheses
* src/mbox.c: Likewise
* src/procmsg.c: Use fabs instead of abs for 'double' arg
* src/ textview.c: Declare 'shortcut' only if not GENERIC_UMPC
* src/toolbar.c: Declare 'toolbar_reply_menu_cb()' and
'toolbar_delete_dup_menu_cb' only if not GENERIC_UMPC

Patch by Avinash Sonawane

Diffstat:
MAUTHORS | 1+
Msrc/common/plugin.c | 2+-
Msrc/gtk/authors.h | 1+
Msrc/jpilot.c | 2+-
Msrc/mbox.c | 4++--
Msrc/procmsg.c | 3++-
Msrc/textview.c | 5++++-
Msrc/toolbar.c | 13++++++++-----
8 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/AUTHORS b/AUTHORS @@ -323,3 +323,4 @@ contributors (in addition to the above; based on Changelog) Ralph Sennhauser Michael Schwendt Eric S. Raymond + Avinash Sonawane diff --git a/src/common/plugin.c b/src/common/plugin.c @@ -80,7 +80,7 @@ const gchar *plugin_feature_names[] = /* The plugin must be at least under one of these licences and have the corresponding token returned by the plugin_licence function. */ -const gchar const *plugin_licence_tokens[] = { +const gchar *plugin_licence_tokens[] = { "LGPL2.1+", "LGPLv2.1+", "LGPL2.1", "LGPLv2.1", "LGPL3+", "LGPLv3+", "LGPL3", "LGPLv3", "GPL3+", "GPLv3+", "GPL3", "GPLv3", diff --git a/src/gtk/authors.h b/src/gtk/authors.h @@ -283,6 +283,7 @@ static char *CONTRIBS_LIST[] = { "Jesse Skinner", "Ville Skyttä", "Dale P. Smith", +"Avinash Sonawane", "Andrea Spadaccini", "Bogdan Sumanariu", "TAKANO", diff --git a/src/jpilot.c b/src/jpilot.c @@ -508,7 +508,7 @@ static int find_next_offset( mem_rec_header *mem_rh, long fpos, /* *attrib = temp_mem_rh->attrib; */ /* *unique_id = temp_mem_rh->unique_id; */ } - if ((temp_mem_rh->offset == fpos)) { + if (temp_mem_rh->offset == fpos) { found = 1; *attrib = temp_mem_rh->attrib; *unique_id = temp_mem_rh->unique_id; diff --git a/src/mbox.c b/src/mbox.c @@ -174,7 +174,7 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox, gboolean apply_filter, /* From separator or quoted From */ offset = 0; /* detect leading '>' char(s) */ - while ((buf[offset] == '>')) { + while (buf[offset] == '>') { offset++; } if (!strncmp(buf+offset, "From ", 5)) { @@ -605,7 +605,7 @@ gint export_list_to_mbox(GSList *mlist, const gchar *mbox) offset = 0; /* detect leading '>' char(s) */ - while ((buf[offset] == '>')) { + while (buf[offset] == '>') { offset++; } if (!strncmp(buf+offset, "From ", 5)) { diff --git a/src/procmsg.c b/src/procmsg.c @@ -23,6 +23,7 @@ #include <stdio.h> #include <stdlib.h> #include <ctype.h> +#include <math.h> #include "main.h" #include "utils.h" @@ -182,7 +183,7 @@ static GNode *subject_hashtable_lookup(GHashTable *hashtable, MsgInfo *msginfo) /* parent node must not be more then thread_by_subject_max_age days older then msginfo */ - if (abs(difftime(msginfo->date_t, hashtable_msginfo->date_t)) > + if (fabs(difftime(msginfo->date_t, hashtable_msginfo->date_t)) > prefs_common.thread_by_subject_max_age * 3600 * 24) match = FALSE; diff --git a/src/textview.c b/src/textview.c @@ -951,8 +951,11 @@ void textview_show_mime_part(TextView *textview, MimeInfo *partinfo) GtkTextBuffer *buffer; GtkTextIter iter; const gchar *name; - gchar *content_type, *shortcut; + gchar *content_type; GtkUIManager *ui_manager; +#ifndef GENERIC_UMPC + gchar *shortcut; +#endif if (!partinfo) return; diff --git a/src/toolbar.c b/src/toolbar.c @@ -2203,6 +2203,7 @@ static void toolbar_buttons_cb(GtkWidget *widget, gtk_widget_show(item); \ } +#ifndef GENERIC_UMPC static void toolbar_reply_menu_cb(GtkWidget *widget, gpointer data) { gpointer int_value = g_object_get_data(G_OBJECT(widget), "int-value"); @@ -2211,22 +2212,24 @@ static void toolbar_reply_menu_cb(GtkWidget *widget, gpointer data) toolbar_reply(toolbar_item, GPOINTER_TO_INT(int_value)); } -static void toolbar_learn_menu_cb(GtkWidget *widget, gpointer data) +static void toolbar_delete_dup_menu_cb(GtkWidget *widget, gpointer data) { gpointer int_value = g_object_get_data(G_OBJECT(widget), "int-value"); ToolbarItem *toolbar_item = (ToolbarItem *)data; - toolbar_learn(toolbar_item, GPOINTER_TO_INT(int_value)); + toolbar_delete_dup(toolbar_item, GPOINTER_TO_INT(int_value)); } +#endif -static void toolbar_delete_dup_menu_cb(GtkWidget *widget, gpointer data) +static void toolbar_learn_menu_cb(GtkWidget *widget, gpointer data) { gpointer int_value = g_object_get_data(G_OBJECT(widget), "int-value"); ToolbarItem *toolbar_item = (ToolbarItem *)data; - - toolbar_delete_dup(toolbar_item, GPOINTER_TO_INT(int_value)); + + toolbar_learn(toolbar_item, GPOINTER_TO_INT(int_value)); } + /** * Create a new toolbar with specified type * if a callback list is passed it will be used before the