e_destination_get_email() returns const char* Fix warning about unused
authorKjartan Maraas <kmaraas@gnome.org>
Thu, 17 Aug 2006 09:44:48 +0000 (09:44 +0000)
committerKjartan Maraas <kmaraas@src.gnome.org>
Thu, 17 Aug 2006 09:44:48 +0000 (09:44 +0000)
2006-08-17  Kjartan Maraas  <kmaraas@gnome.org>

* e-destination-store.c: (find_destination_by_email):
e_destination_get_email() returns const char*
* e-name-selector-dialog.c:
(e_name_selector_dialog_populate_categories),
(e_name_selector_dialog_init): Fix warning about unused result
and mixing declarations and code.
* e-name-selector-entry.c: (user_delete_text),
(e_name_selector_entry_init): Remove some unused code and fix
compiler warnings
* e-name-selector-list.c: (enl_tree_button_press_event),
(e_name_selector_list_new): Fix more compiler warnings
* e-passwords.c: (ep_remember_password), (ep_ask_password),
(decode_base64): Fix compiler warnings.

libedataserverui/ChangeLog
libedataserverui/e-destination-store.c
libedataserverui/e-name-selector-dialog.c
libedataserverui/e-name-selector-entry.c
libedataserverui/e-name-selector-list.c
libedataserverui/e-passwords.c

index f6b3f00..359e73c 100644 (file)
@@ -1,3 +1,19 @@
+2006-08-17  Kjartan Maraas  <kmaraas@gnome.org>
+
+       * e-destination-store.c: (find_destination_by_email):
+       e_destination_get_email() returns const char*
+       * e-name-selector-dialog.c:
+       (e_name_selector_dialog_populate_categories),
+       (e_name_selector_dialog_init): Fix warning about unused result
+       and mixing declarations and code.
+       * e-name-selector-entry.c: (user_delete_text),
+       (e_name_selector_entry_init): Remove some unused code and fix
+       compiler warnings
+       * e-name-selector-list.c: (enl_tree_button_press_event),
+       (e_name_selector_list_new): Fix more compiler warnings
+       * e-passwords.c: (ep_remember_password), (ep_ask_password),
+       (decode_base64): Fix compiler warnings.
+
 2006-08-07  Hans Petter Jansson  <hpj@novell.com>
 
        * e-contact-store.c (e_contact_store_finalize): Fix memory leaks.
index 2767d3a..6e6132c 100644 (file)
@@ -262,11 +262,11 @@ static gint
 find_destination_by_email (EDestinationStore *destination_store, EDestination *destination)
 {
        gint i;
-       char *e_mail = e_destination_get_email (destination);
+       const char *e_mail = e_destination_get_email (destination);
 
        for (i = 0; i < destination_store->destinations->len; i++) {
                EDestination *destination_here = g_ptr_array_index (destination_store->destinations, i);
-               char *mail = e_destination_get_email (destination_here);
+               const char *mail = e_destination_get_email (destination_here);
 
                if (g_str_equal (e_mail, mail))
                        return i;
index ad80cbd..7d47508 100644 (file)
@@ -127,7 +127,7 @@ e_name_selector_dialog_populate_categories (ENameSelectorDialog *name_selector_d
 
        category_list = e_categories_get_list () ;
        category_list = g_list_prepend (category_list, "Any Category");
-       g_list_sort (category_list, compare_func);
+       category_list = g_list_sort (category_list, compare_func);
 
        category_menu = gtk_menu_new ();
        l = category_list;
@@ -155,6 +155,8 @@ e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
        GtkTreeSelection  *selection;
        ESourceList       *source_list;
        char              *gladefile;
+       GConfClient *gconf_client;      
+       char *uid;
 
        ENameSelectorDialogPrivate *priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (name_selector_dialog);
        priv->destination_index = 0;
@@ -237,9 +239,6 @@ e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
 
        widget = e_source_option_menu_new (name_selector_dialog->source_list);
         
-       GConfClient *gconf_client;      
-       char *uid;
-       
        gconf_client = gconf_client_get_default();
        uid = gconf_client_get_string (gconf_client, "/apps/evolution/addressbook/display/primary_addressbook",
                        NULL);
index e91a05c..d4e8181 100644 (file)
@@ -535,12 +535,6 @@ utf8_casefold_collate_len (const gchar *str1, const gchar *str2, gint len)
        return rv;
 }
 
-static gint
-utf8_casefold_collate (const gchar *str1, const gchar *str2)
-{
-       return utf8_casefold_collate_len (str1, str2, -1);
-}
-
 static gchar *
 build_textrep_for_contact (EContact *contact, EContactField cue_field)
 {
@@ -942,22 +936,6 @@ modify_destination_at_position (ENameSelectorEntry *name_selector_entry, gint po
 }
 
 static void
-remove_destination_at_position (ENameSelectorEntry *name_selector_entry, gint pos)
-{
-       EDestination *destination;
-
-       destination = find_destination_at_position (name_selector_entry, pos);
-       if (destination) {
-               g_signal_handlers_block_by_func (name_selector_entry->destination_store,
-                                        destination_row_deleted, name_selector_entry);
-               e_destination_store_remove_destination (name_selector_entry->destination_store,
-                                               destination);
-               g_signal_handlers_unblock_by_func (name_selector_entry->destination_store,
-                                          destination_row_deleted, name_selector_entry);
-       }
-}
-
-static void
 sync_destination_at_position (ENameSelectorEntry *name_selector_entry, gint range_pos, gint *cursor_pos)
 {
        EDestination *destination;
@@ -1160,7 +1138,7 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
        const gchar *text;
        gint         index_start, index_end;
        gint         selection_start, selection_end;    
-       gunichar     str_context [2], str_b_context [2];;
+       gunichar     str_context [2], str_b_context [2];
        gint         len;
        gint         i;
        gboolean     already_selected = FALSE;
@@ -1175,7 +1153,7 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
                                               &selection_start, 
                                               &selection_end)) 
                if ((g_utf8_get_char (g_utf8_offset_to_pointer (text, selection_end)) == 0) ||
-                   (g_utf8_get_char (g_utf8_offset_to_pointer (text, selection_end)) == ","))
+                   (g_utf8_get_char (g_utf8_offset_to_pointer (text, selection_end)) == ','))
                        already_selected = TRUE;
        
        get_utf8_string_context (text, start_pos, str_context, 2);
@@ -1250,7 +1228,6 @@ user_delete_text (ENameSelectorEntry *name_selector_entry, gint start_pos, gint
                name_selector_entry->type_ahead_complete_cb_id = 0;
        }
        
-end_of_user_delete_text:
        g_signal_handlers_unblock_by_func (name_selector_entry, user_delete_text, name_selector_entry);
 }
 
@@ -2110,7 +2087,8 @@ e_name_selector_entry_init (ENameSelectorEntry *name_selector_entry)
   GConfClient *gconf;
   gconf = gconf_client_get_default();
   if (COMPLETION_CUE_MIN_LEN == 0) {
-         if (COMPLETION_CUE_MIN_LEN = gconf_client_get_int (gconf, MINIMUM_QUERY_LENGTH, NULL));
+         if ((COMPLETION_CUE_MIN_LEN = gconf_client_get_int (gconf, MINIMUM_QUERY_LENGTH, NULL)))
+               ;
          else COMPLETION_CUE_MIN_LEN = 3;
   }
   g_object_unref (G_OBJECT (gconf));
index 3dced51..2f25da2 100644 (file)
@@ -370,8 +370,7 @@ enl_tree_button_press_event (GtkWidget *widget,
        if ( !GTK_WIDGET_HAS_GRAB (list->popup))
                enl_popup_grab (list);
   
-       
-       gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW (list->tree_view), event->x, event->y, &path, GTK_TREE_VIEW_DROP_BEFORE);
+       gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW (list->tree_view), event->x, event->y, &path, NULL);
        selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW (list->tree_view));
        if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (E_NAME_SELECTOR_ENTRY (list)->destination_store), &iter, path))
                return FALSE;
@@ -655,7 +654,7 @@ e_name_selector_list_init (ENameSelectorList *list)
 }
 
 ENameSelectorList *
-e_name_selector_list_new ()
+e_name_selector_list_new (void)
 {
        return g_object_new (e_name_selector_list_get_type (), NULL);
 }
index 4f4178d..2e40fdf 100644 (file)
@@ -97,8 +97,8 @@ struct _EPassMsg {
        /* work variables */
        GtkWidget *entry;
        GtkWidget *check;
-       int ismain:1;
-       int noreply:1;          /* supress replies; when calling
+       guint ismain:1;
+       guint noreply:1;        /* supress replies; when calling
                                 * dispatch functions from others */
 };
 
@@ -446,7 +446,7 @@ ep_remember_password(EPassMsg *msg)
                len = strlen (value);
                pass64 = g_malloc0 ((len + 2) * 4 / 3 + 1);
                state = save = 0;
-               base64_encode_close (value, len, FALSE, pass64, &state, &save);
+               base64_encode_close (value, len, FALSE, (guchar *)pass64, &state, &save);
 
                gnome_config_private_set_string (path, pass64);
                g_free (path);
@@ -800,7 +800,7 @@ ep_ask_password(EPassMsg *msg)
 {
        GtkWidget *vbox;
        int type = msg->flags & E_PASSWORDS_REMEMBER_MASK;
-       int noreply = msg->noreply;
+       guint noreply = msg->noreply;
        AtkObject *a11y;
 
        msg->noreply = 1;
@@ -1326,17 +1326,19 @@ base64_decode_step(unsigned char *in, int len, unsigned char *out, int *state, u
 static char *
 decode_base64 (char *base64)
 {
-       char *plain, *pad = "==";
-       int len, out, state, save;
+       guchar *plain;
+       char *pad = "==";
+       int len, out, state;
+       unsigned int save;
        
        len = strlen (base64);
        plain = g_malloc0 (len);
        state = save = 0;
-       out = base64_decode_step (base64, len, plain, &state, &save);
+       out = base64_decode_step ((guchar *)base64, len, plain, &state, &save);
        if (len % 4) {
-               base64_decode_step (pad, 4 - len % 4, plain + out,
+               base64_decode_step ((guchar *)pad, 4 - len % 4, plain + out,
                                    &state, &save);
        }
        
-       return plain;
+       return (char *)plain;
 }