Save few warnings around mistyped uses of g_list_length().
authorwwp <wwp@free.fr>
Sat, 5 May 2018 11:46:36 +0000 (13:46 +0200)
committerwwp <wwp@free.fr>
Sat, 5 May 2018 11:46:36 +0000 (13:46 +0200)
src/addr_compl.c
src/addr_compl.h
src/gtk/gtkcmoptionmenu.c
src/ldapctrl.c
src/main.c
src/messageview.c
src/plugins/pdf_viewer/poppler_viewer.c
src/summaryview.c

index 9cf536a..8ce1177 100644 (file)
@@ -437,7 +437,7 @@ static void clear_completion_cache(void)
  * address completion.
  * \return The number of addresses in the completion list.
  */
-gint start_address_completion(gchar *folderpath)
+guint start_address_completion(gchar *folderpath)
 {
        gboolean different_book = FALSE;
        clear_completion_cache();
index 741fa43..bd1ed78 100644 (file)
@@ -36,7 +36,7 @@ typedef struct
     GList *grp_emails;
 } address_entry;
 
-gint start_address_completion          (gchar *folderpath);
+guint start_address_completion         (gchar *folderpath);
 guint complete_address                 (const gchar *str);
 guint complete_matches_found                           (const gchar *str);
 gchar *get_complete_address            (gint index);
index b07694f..1f7fb31 100644 (file)
@@ -1019,19 +1019,18 @@ gtk_cmoption_menu_scroll_event (GtkWidget          *widget,
                              GdkEventScroll     *event)
 {
   GtkCMOptionMenu *option_menu = GTK_CMOPTION_MENU (widget);
-  gint index;
-  gint n_children;
+  gint index, n_children;
   gint index_dir;
   GList *l, *children;
   GtkMenuItem *item;
-    
+
   index = gtk_cmoption_menu_get_history (option_menu);
 
   if (index != -1)
     {
       children = gtk_container_get_children (GTK_CONTAINER (GTK_MENU_SHELL (option_menu->menu)));
-      n_children = g_list_length (children);
-      
+      n_children = (gint)g_list_length (children);
       if (event->direction == GDK_SCROLL_UP)
        index_dir = -1;
       else
@@ -1047,7 +1046,7 @@ gtk_cmoption_menu_scroll_event (GtkWidget          *widget,
          if (index >= n_children)
            break;
 
-         l = g_list_nth (children, index);
+         l = g_list_nth (children, (guint)index);
          item = GTK_MENU_ITEM (l->data);
          if (gtk_widget_get_visible (GTK_WIDGET(item)) && 
              gtk_widget_is_sensitive (GTK_WIDGET(item)))
@@ -1056,9 +1055,9 @@ gtk_cmoption_menu_scroll_event (GtkWidget          *widget,
              gtk_menu_item_activate (GTK_MENU_ITEM (item));
              break;
            }
-             
+
        }
-      
+
        g_list_free (children);
     }
 
index ddc8c25..2bba4f6 100644 (file)
@@ -594,7 +594,7 @@ gchar *ldapctl_format_criteria( LdapControl *ctl, const gchar *searchVal ) {
 char **ldapctl_attribute_array( LdapControl *ctl ) {
        char **ptrArray;
        GList *node;
-       gint cnt, i;
+       guint cnt, i;
        cm_return_val_if_fail( ctl != NULL, NULL );
 
        node = ctl->listCriteria;
@@ -619,7 +619,7 @@ char **ldapctl_full_attribute_array( LdapControl *ctl ) {
        char **ptrArray;
        GList *node, *def;
        GList *tmp = NULL;
-       gint cnt, i;
+       guint cnt, i;
        cm_return_val_if_fail( ctl != NULL, NULL );
 
        def = ctl->listCriteria;
index 89e51e9..bf3a31e 100644 (file)
@@ -987,7 +987,7 @@ int main(int argc, char *argv[])
        FolderView *folderview;
        GdkPixbuf *icon;
        gboolean crash_file_present = FALSE;
-       gint num_folder_class = 0;
+       guint num_folder_class = 0;
        gboolean asked_for_migration = FALSE;
        gboolean start_done = TRUE;
        GSList *plug_list = NULL;
index 4dfb090..95d851f 100644 (file)
@@ -1204,7 +1204,7 @@ static void messageview_register_nav(MessageView *messageview)
                        }
                }
                messageview->trail = g_list_append(messageview->trail, id);
-               messageview->trail_pos = g_list_length(messageview->trail) - 1;
+               messageview->trail_pos = (gint)g_list_length(messageview->trail) - 1;
                
                /* Cut the beginning if needed */
                while (messageview->trail_pos > prefs_common.nav_history_length) {
index 8949098..33ab2d2 100644 (file)
@@ -449,7 +449,7 @@ static gboolean     pdf_viewer_text_search(MimeViewer *_viewer, gboolean backward,
                        if (viewer->page_results != NULL) {
                                debug_print("page_results %p\n", viewer->page_results);
                                /* store results for this page */
-                               gint num_res = 0;
+                               guint num_res = 0;
                                PageResult *res = g_new0(PageResult, 1);
                                res->results = viewer->page_results;
                                res->page_num = i;
index 7a1bc87..cb3d125 100644 (file)
@@ -4478,7 +4478,7 @@ void summary_delete(SummaryView *summaryview)
 
        if (!prefs_common.live_dangerously) {
                gchar *buf = NULL;
-               int num = g_list_length(GTK_CMCLIST(summaryview->ctree)->selection);
+               guint num = g_list_length(GTK_CMCLIST(summaryview->ctree)->selection);
                buf = g_strdup_printf(ngettext(
                        "Do you really want to delete the selected message?",
                        "Do you really want to delete the %d selected messages?", num),