fix bug #4023, 'Fix some small issues'
authorPaul <paul@claws-mail.org>
Sat, 26 May 2018 10:21:19 +0000 (11:21 +0100)
committerPaul <paul@claws-mail.org>
Sat, 26 May 2018 10:21:19 +0000 (11:21 +0100)
* 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

AUTHORS
src/common/plugin.c
src/gtk/authors.h
src/jpilot.c
src/mbox.c
src/procmsg.c
src/textview.c
src/toolbar.c

diff --git a/AUTHORS b/AUTHORS
index 9bbc156..22e1370 100644 (file)
--- 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
index 5677214..64a6f01 100644 (file)
@@ -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",
index 360f514..2d4a706 100644 (file)
@@ -283,6 +283,7 @@ static char *CONTRIBS_LIST[] = {
 "Jesse Skinner",
 "Ville Skytt√§",
 "Dale P. Smith",
+"Avinash Sonawane",
 "Andrea Spadaccini",
 "Bogdan Sumanariu",
 "TAKANO",
index cedfca9..fc3927c 100644 (file)
@@ -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;
index e2c51cc..9929a29 100644 (file)
@@ -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)) {
index 3e989dd..e484700 100644 (file)
@@ -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;
 
index e033347..e54b2e8 100644 (file)
@@ -948,8 +948,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;
 
index 6212927..823a894 100644 (file)
@@ -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