Warning fixes
authorColin Leroy <colin@colino.net>
Fri, 2 May 2014 12:33:05 +0000 (14:33 +0200)
committerColin Leroy <colin@colino.net>
Fri, 2 May 2014 12:33:05 +0000 (14:33 +0200)
24 files changed:
src/common/ssl.c
src/mimeview.c
src/plugins/libravatar/claws.def
src/plugins/libravatar/libravatar_federation.c
src/plugins/notification/notification_command.c
src/plugins/notification/notification_core.c
src/plugins/notification/notification_foldercheck.c
src/plugins/notification/notification_popup.c
src/plugins/rssyl/rssyl_cb_menu.c
src/plugins/rssyl/rssyl_gtk.c
src/plugins/vcalendar/day-view.c
src/plugins/vcalendar/libical/libical/icalcomponent.c
src/plugins/vcalendar/libical/libical/icalmime.c
src/plugins/vcalendar/libical/libical/icalparameter.c
src/plugins/vcalendar/libical/libical/icalparser.c
src/plugins/vcalendar/libical/libical/icalproperty.c
src/plugins/vcalendar/libical/libical/sspm.c
src/plugins/vcalendar/month-view.c
src/plugins/vcalendar/vcal_folder.c
src/plugins/vcalendar/vcal_manager.h
src/plugins/vcalendar/vcal_meeting_gtk.c
src/plugins/vcalendar/vcalendar.c
src/prefs_account.c
src/wizard.c

index 28ba896..b1812f9 100644 (file)
@@ -262,7 +262,7 @@ gboolean ssl_init_socket(SockInfo *sockinfo)
 
 gnutls_x509_crt_t *ssl_get_certificate_chain(gnutls_session_t session, gint *list_len)
 {
-       const gnutls_datum *raw_cert_list;
+       const gnutls_datum_t *raw_cert_list;
        gnutls_x509_crt_t *certs = NULL;
        gboolean result = TRUE;
 
index 9326e47..61dd53e 100644 (file)
@@ -2721,7 +2721,8 @@ static gint mime_toggle_button_cb(GtkWidget *button, GdkEventButton *event,
        return TRUE;
 }
 
-void mimeview_update (MimeView *mimeview) {
+void mimeview_update (MimeView *mimeview)
+{
        if (mimeview && mimeview->mimeinfo) {
                icon_list_clear(mimeview);
                icon_list_create(mimeview, mimeview->mimeinfo);
index eb48bb6..cbd9c19 100644 (file)
@@ -1,5 +1,6 @@
 LIBRARY CLAWS-MAIL.EXE
 EXPORTS
+auto_configure_service_sync
 extract_address
 get_locale_dir
 check_plugin_version
@@ -29,4 +30,4 @@ prefs_write_param
 prefs_common_get_prefs
 procmsg_msginfo_add_avatar
 procmsg_msginfo_get_avatar
-md5_hex_digest
+md5_hex_digest
\ No newline at end of file
index aee618e..d35aa9b 100644 (file)
@@ -22,6 +22,7 @@
 #include "libravatar_federation.h"
 #include "libravatar_prefs.h"
 #include "utils.h"
+#include "gtkutils.h"
 
 #define MISSING "x"
 
index 3627715..0da54ec 100644 (file)
@@ -45,7 +45,6 @@ void notification_command_msg(MsgInfo *msginfo)
 {
   gchar *ret_str, *buf;
   gsize by_read = 0, by_written = 0;
-  FolderType ftype;
 
   if(!msginfo || !notify_config.command_enabled || !MSG_IS_NEW(msginfo->flags))
     return;
@@ -83,8 +82,6 @@ void notification_command_msg(MsgInfo *msginfo)
       return;
   } /* folder specific */
 
-  ftype = msginfo->folder->folder->klass->type;
-
   buf = g_strdup(notify_config.command_line);
 
   G_LOCK(command);
index 2a96d55..d797b84 100644 (file)
@@ -454,9 +454,7 @@ static void notification_new_unnotified_do_msg(MsgInfo *msg)
 #ifdef HAVE_LIBCANBERRA_GTK
   /* canberra */
   if(notify_config.canberra_play_sounds && !canberra_new_email_is_playing) {
-    MainWindow *mainwin;
     ca_proplist *proplist;
-    mainwin = mainwindow_get_mainwindow();
     ca_proplist_create(&proplist);
     ca_proplist_sets(proplist,CA_PROP_EVENT_ID ,"message-new-email");
     canberra_new_email_is_playing = TRUE;
index 5c0172c..f1d05b2 100644 (file)
@@ -1,3 +1,4 @@
+
 /* Notification plugin for Claws-Mail
  * Copyright (C) 2005-2007 Holger Berndt
  *
@@ -768,10 +769,6 @@ static void foldercheck_append_item(GtkTreeStore *store, FolderItem *item,
 {
   gchar *name, *tmpname;
   GdkPixbuf *pixbuf, *pixbuf_open;
-  gboolean use_color;
-  PangoWeight weight = PANGO_WEIGHT_NORMAL;
-  GdkColor *foreground = NULL;
-  static GdkColor color_noselect = {0, COLOR_DIM, COLOR_DIM, COLOR_DIM};
 
   name = tmpname = folder_item_get_name(item);
 
@@ -812,23 +809,6 @@ static void foldercheck_append_item(GtkTreeStore *store, FolderItem *item,
   pixbuf = item->no_select ? foldernoselect_pixbuf : folder_pixbuf;
   pixbuf_open =
     item->no_select ? foldernoselect_pixbuf : folderopen_pixbuf;
-
-  if (folder_has_parent_of_type(item, F_DRAFT) ||
-      folder_has_parent_of_type(item, F_OUTBOX) ||
-      folder_has_parent_of_type(item, F_TRASH)) {
-    use_color = FALSE;
-  } else if (folder_has_parent_of_type(item, F_QUEUE)) {
-    use_color = (item->total_msgs > 0);
-    if (item->total_msgs > 0)
-      weight = PANGO_WEIGHT_BOLD;
-  } else {
-    if (item->unread_msgs > 0)
-      weight = PANGO_WEIGHT_BOLD;
-    use_color = (item->new_msgs > 0);
-  }
-  
-  if (item->no_select)
-    foreground = &color_noselect;
   
   /* insert this node */
   gtk_tree_store_append(store, iter, parent);
index e74148c..7393af2 100644 (file)
@@ -92,11 +92,12 @@ static gboolean notification_popup_button(GtkWidget*, GdkEventButton*, gpointer)
 
 void notification_popup_msg(MsgInfo *msginfo)
 {
-  gboolean retval;
   FolderType ftype;
-  NotificationPopup *ppopup;
 #if HAVE_LIBNOTIFY
   gchar *uistr;
+#else
+  NotificationPopup *ppopup;
+  gboolean retval;
 #endif
   NotificationFolderType nftype;
 
@@ -171,8 +172,7 @@ void notification_popup_msg(MsgInfo *msginfo)
     return;
   }
 
-  ppopup = &(popup[nftype]);
-  retval = notification_libnotify_add_msg(msginfo, nftype);
+  notification_libnotify_add_msg(msginfo, nftype);
 #else /* !HAVE_LIBNOTIFY */
   ppopup = &popup;
   retval = notification_popup_add_msg(msginfo);
index 85b51fe..f3047de 100644 (file)
@@ -220,7 +220,6 @@ void rssyl_remove_folder_cb(GtkAction *action, gpointer data)
        FolderItem *item;
        gchar *message, *name;
        AlertValue avalue;
-       gchar *old_path;
        gchar *old_id;
 
        item = folderview_get_selected_item(folderview);
@@ -240,7 +239,6 @@ void rssyl_remove_folder_cb(GtkAction *action, gpointer data)
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
 
-       Xstrdup_a(old_path, item->path, return);
        old_id = folder_item_get_identifier(item);
 
        if (folderview->opened == folderview->selected ||
index c4dba86..2c75492 100644 (file)
@@ -236,7 +236,7 @@ static RSSylFeedProp *rssyl_gtk_prop_real(RSSylFolderItem *ritem)
                                                *ok_hbox, *ok_image, *ok_label, *silent_update_label;
 
        GtkObject *refresh_adj, *expired_adj, *fetch_comments_for_adj;
-       gint refresh, expired;
+       gint refresh;
        gint row = 0;
 
        g_return_val_if_fail(ritem != NULL, NULL);
@@ -283,11 +283,6 @@ static RSSylFeedProp *rssyl_gtk_prop_real(RSSylFolderItem *ritem)
        feedprop->fetch_comments_for = gtk_spin_button_new(GTK_ADJUSTMENT(fetch_comments_for_adj),
                        1, 0);
 
-       if( ritem->default_expired_num )
-               expired = rssyl_prefs_get()->expired;
-       else
-               expired = ritem->expired_num;
-
        /* Refresh interval spinbutton */
        refresh_adj = gtk_adjustment_new(refresh,
                        0, 100000, 1, 10, 0);
index d8bd717..53cc7cb 100644 (file)
@@ -739,7 +739,6 @@ static void fill_hour(day_win *dw, gint col, gint row, char *text)
 static void build_day_view_table(day_win *dw)
 {
     gint days;   /* number of days to show */
-    int year, month, day;
     gint i = 0;
     GtkWidget *label, *button;
     char text[5+1], *date, *today;
@@ -781,9 +780,6 @@ static void build_day_view_table(day_win *dw)
 
     tm_date = dw->startdate;
 
-    year = tm_date.tm_year + 1900;
-    month = tm_date.tm_mon;
-    day = tm_date.tm_mday;
     if (((tm_date.tm_year%4) == 0) && (((tm_date.tm_year%100) != 0) 
             || ((tm_date.tm_year%400) == 0)))
         monthdays[1] = 29;
index 5c8cf16..26754b2 100644 (file)
@@ -397,15 +397,12 @@ icalcomponent_remove_property (icalcomponent* component, icalproperty* property)
 {
     struct icalcomponent_impl *impl;
     pvl_elem itr, next_itr;
-    struct icalproperty_impl *pimpl;
 
     icalerror_check_arg_rv( (component!=0), "component");
     icalerror_check_arg_rv( (property!=0), "property");
     
     impl = (struct icalcomponent_impl*)component;
 
-    pimpl = (struct icalproperty_impl*)property;
-
     icalerror_assert( (icalproperty_get_parent(property)),"The property is not a member of a component");
 
     
index 78cd414..1eeff36 100644 (file)
@@ -168,14 +168,15 @@ icalcomponent* icalmime_parse(char* (*get_string)(char *s, size_t size,
     struct sspm_part *parts;
     int i, last_level=0;
     icalcomponent *root=0, *parent=0, *comp=0, *last = 0;
+    size_t alloc_len = NUM_PARTS * sizeof(struct sspm_part);
 
     if ( (parts = (struct sspm_part *)
-         malloc(NUM_PARTS*sizeof(struct sspm_part)))==0) {
+         malloc(alloc_len))==0) {
        icalerror_set_errno(ICAL_NEWFAILED_ERROR);
        return 0;
     }
 
-    memset(parts,0,sizeof(parts));
+    memset(parts, 0, alloc_len);
 
     sspm_parse_mime(parts, 
                    NUM_PARTS, /* Max parts */
@@ -354,14 +355,15 @@ int icalmime_test(char* (*get_string)(char *s, size_t size, void *d),
     char *out;
     struct sspm_part *parts;
     int i;
+    size_t alloc_len = NUM_PARTS * sizeof(struct sspm_part);
 
     if ( (parts = (struct sspm_part *)
-         malloc(NUM_PARTS*sizeof(struct sspm_part)))==0) {
+         malloc(alloc_len))==0) {
        icalerror_set_errno(ICAL_NEWFAILED_ERROR);
        return 0;
     }
 
-    memset(parts,0,sizeof(parts));
+    memset(parts,0,alloc_len);
 
     sspm_parse_mime(parts, 
                    NUM_PARTS, /* Max parts */
index 156ecdb..4a04380 100644 (file)
@@ -106,7 +106,7 @@ icalparameter_free (icalparameter* parameter)
        free ((void*)impl->x_name);
     }
     
-    memset(impl,0,sizeof(impl));
+    memset(impl,0,sizeof(*impl));
 
     impl->parent = 0;
     impl->id[0] = 'X';
index e4f6bba..bfcccdf 100644 (file)
@@ -619,7 +619,6 @@ icalcomponent* icalparser_parse(icalparser *parser,
 icalcomponent* icalparser_add_line(icalparser* parser,
                                        char* line)
 { 
-    char *p; 
     char *str;
     char *end;
     int vcount = 0;
@@ -794,7 +793,6 @@ icalcomponent* icalparser_add_line(icalparser* parser,
 
     /* Now, add any parameters to the last property */
 
-    p = 0;
     while(1) {
 
        if (*(end-1) == ':'){
index c563882..a848a89 100644 (file)
@@ -514,7 +514,7 @@ const char* icalproperty_get_parameter_as_string(icalproperty* prop,
     
     kind = icalparameter_string_to_kind(name);
 
-    if(kind == ICAL_NO_PROPERTY){
+    if(kind == ICAL_NO_PARAMETER){
         /* icalenum_string_to_parameter_kind will set icalerrno */
         return 0;
     }
index a9ae54f..6d1d470 100644 (file)
@@ -438,7 +438,7 @@ enum sspm_major_type sspm_find_major_content_type(char* type)
 
     char* ltype = sspm_lowercase(type);
 
-    for (i=0; major_content_type_map[i].type !=  SSPM_UNKNOWN_MINOR_TYPE; i++){
+    for (i=0; major_content_type_map[i].type !=  SSPM_UNKNOWN_MAJOR_TYPE; i++){
        if(strncmp(ltype, major_content_type_map[i].str,
                   strlen(major_content_type_map[i].str))==0){
            free(ltype);
@@ -478,7 +478,7 @@ char* sspm_major_type_string(enum sspm_major_type type)
 {
     int i;
 
-    for (i=0; major_content_type_map[i].type !=  SSPM_UNKNOWN_MINOR_TYPE; 
+    for (i=0; major_content_type_map[i].type !=  SSPM_UNKNOWN_MAJOR_TYPE; 
         i++){
 
        if(type == major_content_type_map[i].type){
index 6ecc834..93c504b 100644 (file)
@@ -821,7 +821,6 @@ static void fill_hour(month_win *mw, gint col, gint row, char *text)
 static void build_month_view_table(month_win *mw)
 {
     gint days;   /* number of days to show */
-    int year, month, day;
     gint i = 0;
     GtkWidget *button;
     struct tm tm_date, tm_today;
@@ -885,9 +884,6 @@ static void build_month_view_table(month_win *mw)
 
     tm_date = mw->startdate;
 
-    year = tm_date.tm_year + 1900;
-    month = tm_date.tm_mon;
-    day = tm_date.tm_mday;
     if (((tm_date.tm_year%4) == 0) && (((tm_date.tm_year%100) != 0) 
             || ((tm_date.tm_year%400) == 0)))
         ++monthdays[1];
@@ -958,6 +954,7 @@ static void build_month_view_table(month_win *mw)
 
     /* hours column = hour rows */
     for (i = 0; i <= 6; i++) {
+       int day;
        for (day = 1; day <= monthdays[tm_date.tm_mon]; day++) {
            date = g_date_new_dmy(day, tm_date.tm_mon+1, tm_date.tm_year+1900);
            int row = (int)g_date_get_monday_week_of_year(date);
index e18240a..a376914 100644 (file)
@@ -1626,12 +1626,10 @@ gchar *vcal_curl_read(const char *url, const gchar *label, gboolean verbose,
        pthread_attr_t pta;
 #endif
        void *res;
-       gboolean killed;
        gchar *error = NULL;
        result = NULL;
        td = g_new0(thread_data, 1);
        res = NULL;
-       killed = FALSE;
 
        td->url  = url;
        td->result  = NULL;
@@ -1941,7 +1939,6 @@ static void unsubscribe_cal_cb(GtkAction *action, gpointer data)
        FolderItem *item;
        gchar *message;
        AlertValue avalue;
-       gchar *old_path;
        gchar *old_id;
 
        if (!folderview->selected) return;
@@ -1959,7 +1956,6 @@ static void unsubscribe_cal_cb(GtkAction *action, gpointer data)
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
 
-       Xstrdup_a(old_path, item->path, return);
        old_id = folder_item_get_identifier(item);
 
        vcal_item_closed(item);
index 9d40fb0..4545cd6 100644 (file)
@@ -51,7 +51,7 @@ struct _VCalEvent
        enum icalproperty_method method;
        gint sequence;  
        gchar *url;
-       enum icalproperty_kind type;
+       enum icalcomponent_kind type;
        time_t postponed;
        gboolean rec_occurence;
 };
index c2d1419..c5cf89e 100644 (file)
@@ -1392,12 +1392,10 @@ static VCalMeeting *vcal_meeting_create_real(VCalEvent *event, gboolean visible)
        GtkTextBuffer *buffer = NULL;
        GtkWidget *date_hbox, *date_vbox, *save_hbox, *label, *hbox;
        gchar *s = NULL;
-       GtkObject *start_h_adj, *start_m_adj, *end_h_adj, *end_m_adj;
        int i = 0, num = 0;
        GtkWidget *scrolledwin;
        GList *times = NULL;
        GList *accounts;
-       GtkListStore *menu;
        gchar *time_text = NULL;
 #ifdef GENERIC_UMPC
        GtkWidget *notebook;
@@ -1411,10 +1409,6 @@ static VCalMeeting *vcal_meeting_create_real(VCalEvent *event, gboolean visible)
        meet->tips = tips;
 #endif
        meet->visible = visible;
-       start_h_adj = gtk_adjustment_new (0, 0, 23, 1, 10, 10);
-       start_m_adj = gtk_adjustment_new (0, 0, 59, 1, 10, 10);
-       end_h_adj   = gtk_adjustment_new (0, 0, 23, 1, 10, 10);
-       end_m_adj   = gtk_adjustment_new (0, 0, 59, 1, 10, 10);
 
        meet->window            = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "vcal_meeting_gtk");
 #ifndef GENERIC_UMPC
@@ -1440,7 +1434,6 @@ static VCalMeeting *vcal_meeting_create_real(VCalEvent *event, gboolean visible)
        meet->start_time = gtk_combo_box_text_new_with_entry();
 #endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(meet->start_time), -1);
-       menu = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(meet->start_time)));
 #if !GTK_CHECK_VERSION(2, 24, 0)       
        combobox_set_popdown_strings(GTK_COMBO_BOX(meet->start_time), times);
 #else  
@@ -1453,7 +1446,6 @@ static VCalMeeting *vcal_meeting_create_real(VCalEvent *event, gboolean visible)
        meet->end_time = gtk_combo_box_text_new_with_entry();
 #endif
        gtk_combo_box_set_active(GTK_COMBO_BOX(meet->end_time), -1);
-       menu = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(meet->end_time)));
 #if !GTK_CHECK_VERSION(2, 24, 0)       
        combobox_set_popdown_strings(GTK_COMBO_BOX(meet->end_time), times);
 #else  
index 1362ded..263d542 100644 (file)
@@ -1380,7 +1380,6 @@ void vcalendar_done(void)
        MainWindow *mainwin = mainwindow_get_mainwindow();
        FolderView *folderview = NULL;
        FolderItem *fitem = NULL;
-       SummaryView *summaryview = NULL;
 
        icalmemory_free_ring();
 
@@ -1389,7 +1388,6 @@ void vcalendar_done(void)
        if (mainwin == NULL)
                return;
 
-       summaryview = mainwin->summaryview;
        folderview = mainwin->folderview;
        fitem = folderview->summaryview->folder_item;
 
index d9d52bb..cae698d 100644 (file)
@@ -3888,7 +3888,7 @@ static void auto_configure_cb (GtkWidget *widget, gpointer data)
        send_data->ssl_checkbtn = NULL;
        send_data->default_port = 25;
        send_data->default_ssl_port = -1;
-       send_data->auth_checkbtn = send_page.smtp_auth_checkbtn;
+       send_data->auth_checkbtn = GTK_TOGGLE_BUTTON(send_page.smtp_auth_checkbtn);
 
        auto_configure_service(send_data);
 
index c17e13d..1686aff 100644 (file)
@@ -1429,7 +1429,7 @@ static void auto_configure_cb (GtkWidget *widget, gpointer data)
        send_data->ssl_checkbtn = GTK_TOGGLE_BUTTON(wizard->smtp_use_ssl);
        send_data->default_port = 25;
        send_data->default_ssl_port = -1;
-       send_data->auth_checkbtn = wizard->smtp_auth;
+       send_data->auth_checkbtn = GTK_TOGGLE_BUTTON(wizard->smtp_auth);
 
        auto_configure_service(send_data);