Compiler warning fixes from Kjartan Maraas.
authorMatthew Barnes <mbarnes@src.gnome.org>
Sun, 1 Apr 2007 04:43:31 +0000 (04:43 +0000)
committerMatthew Barnes <mbarnes@src.gnome.org>
Sun, 1 Apr 2007 04:43:31 +0000 (04:43 +0000)
svn path=/trunk/; revision=7679

49 files changed:
ChangeLog
addressbook/ChangeLog
addressbook/backends/file/e-book-backend-file.c
addressbook/backends/ldap/e-book-backend-ldap.c
addressbook/libebook/e-book-listener.c
addressbook/libebook/e-book-view-listener.c
addressbook/libebook/e-book.c
addressbook/libebook/e-contact.c
addressbook/libebook/e-vcard.c
addressbook/libedata-book/e-book-backend-cache.c
addressbook/libedata-book/e-book-backend-db-cache.c
addressbook/tests/ebook/test-ebook-async.c
addressbook/tests/ebook/test-ebook.c
calendar/ChangeLog
calendar/backends/caldav/e-cal-backend-caldav.c
calendar/backends/contacts/e-cal-backend-contacts.c
calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
calendar/libecal/e-cal-listener.c
calendar/libedata-cal/e-data-cal-factory.c
calendar/tests/ecal/test-ecal.c
camel/ChangeLog
camel/camel-mime-utils.c
camel/camel-search-private.c
camel/camel-url.c
camel/providers/groupwise/ChangeLog
camel/providers/groupwise/camel-groupwise-store.c
camel/providers/pop3/ChangeLog
camel/providers/pop3/camel-pop3-store.c
libedataserver/e-account.c
libedataserver/e-iconv.c
libedataserver/e-list-iterator.c
libedataserver/e-sexp.c
libedataserver/e-trie.c
libedataserver/e-url.c
libedataserverui/ChangeLog
libedataserverui/e-passwords.c
libedataserverui/e-source-selector.c
servers/exchange/ChangeLog
servers/exchange/lib/e2k-autoconfig.c
servers/exchange/lib/e2k-context.c
servers/exchange/lib/e2k-rule-xml.c
servers/exchange/storage/e-folder-type-registry.c
servers/exchange/storage/exchange-account.c
servers/exchange/storage/exchange-account.h
servers/groupwise/ChangeLog
servers/groupwise/e-gw-item.c
servers/groupwise/e-gw-message.c
servers/groupwise/e-gw-recur-utils.c
servers/groupwise/e-gw-sendoptions.c

index bbb90bc..a3b644e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-04-01  Matthew Barnes  <mbarnes@redhat.com>
+
+       * libedataserver/e-account.c (receipt_policy_to_str):
+       * libedataserver/e-iconv.c (e_dlist_init):
+       * libedataserver/e-list-iterator.c (e_list_iterator_insert):
+       * libedataserver/e-trie.c (e_trie_search):
+       * libedataserver/e-sexp.c (term_eval_castint), (e_sexp_finalise):
+       Fix some compiler warnings.  Patch from Kjartan Maraas.
+
 2007-03-29  Matthew Barnes  <mbarnes@redhat.com>
 
        * libedataserver/e-data-server-util.c:
index bc4b912..027cd58 100644 (file)
@@ -1,3 +1,30 @@
+2007-04-01  Matthew Barnes  <mbarnes@redhat.com>
+
+       ** Various code clean-ups from Kjartan Maraas.
+
+       * libebook/e-book.c (e_book_new_system_address_book),
+       (e_book_new_default_addressbook):
+       * libebook/e-vcard.c (e_vcard_attribute_get_param),
+       (_evc_base64_encode_simple):
+       * backends/ldap/e-book-backend-ldap.c
+       (e_book_backend_ldap_get_contact_list), (member_compare):
+       * libedata-book/e-book-backend-db-cache.c
+       (e_book_backend_db_cache_add_contact):
+       * tests/ebook/test-ebook.c (print_email):
+       * tests/ebook/test-ebook-async.c (print_email):
+       Fix some compiler warnings.
+
+       * backends/ldap/e-book-backend-ldap.c:
+       Disable some unused functions.
+
+       * libedata-book/e-book-backend-cache.c
+       (e_book_backend_cache_constructor):
+       Use the global 'parent_class' variable.
+
+       * libedata-book/e-book-backend-cache.c
+       (e_book_backend_cache_set_time):
+       Return a duplicated string.
+
 2007-03-26  Matthew Barnes  <mbarnes@redhat.com>
 
        * backends/groupwise/e-book-backend-groupwise.c:
index 4b5c84a..6b2e236 100644 (file)
@@ -793,7 +793,7 @@ e_book_backend_file_get_changes (EBookBackendSync *backend,
                                 */
                                contact = create_contact (id_dbt.data, vcard_dbt.data);
 
-#if notyet
+#ifdef notyet
                                g_object_set (card, "last_use", NULL, "use_score", 0.0, NULL);
 #endif
                                vcard_string = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30);
index 7f41795..ef978ba 100644 (file)
@@ -603,7 +603,7 @@ check_schema_support (EBookBackendLDAP *bl)
 
 #ifndef SUNLDAP
 static void
-get_ldap_library_info ()
+get_ldap_library_info (void)
 {
        LDAPAPIInfo info;
        LDAP *ldap;
@@ -2425,6 +2425,10 @@ e_book_backend_ldap_get_contact_list (EBookBackend *backend,
                                     contact_list_handler, contact_list_dtor);
                        if (enable_debug) {
                                g_get_current_time (&end);
+
+                               diff = end.tv_sec * 1000 + end.tv_usec/1000;
+                               diff -= start.tv_sec * 1000 + start.tv_usec/1000;
+
                                printf ("e_book_backend_ldap_get_contact_list invoked contact_list_handler ");
                                printf ("and took %ld.%03ld seconds\n", diff/1000, diff%1000);
                        }
@@ -2641,7 +2645,7 @@ member_compare (EContact *contact_new, EContact *contact_current)
                                                                if (dn_cur) {
                                                                        if (!g_ascii_strcasecmp (dn_new, dn_cur)) {
                                                                                found = TRUE;
-                                                                               g_list_remove (members_cur, attr_cur);
+                                                                               members_cur = g_list_remove (members_cur, attr_cur);
                                                                                goto next_member;
                                                                        }
                                                                }
@@ -4640,6 +4644,7 @@ e_book_backend_ldap_get_static_capabilities (EBookBackend *backend)
        return g_strdup("net,anon-access,do-initial-query,contact-lists");
 }
 
+#if 0
 static void
 stop_views (EBookBackend *backend)
 {
@@ -4677,6 +4682,7 @@ start_views (EBookBackend *backend)
        g_object_unref (iter);
        g_object_unref (book_views);
 }
+#endif
 
 static void 
 e_book_backend_ldap_set_mode (EBookBackend *backend, int mode)
index 67b6b55..b11c364 100644 (file)
@@ -399,7 +399,7 @@ impl_BookListener_respond_progress (PortableServer_Servant servant,
  * Returns: a new #EBookListener
  */
 EBookListener *
-e_book_listener_new ()
+e_book_listener_new (void)
 {
        static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
        static PortableServer_POA poa = NULL;
index c21bc72..d27cbad 100644 (file)
@@ -281,7 +281,7 @@ e_book_view_listener_convert_status (const GNOME_Evolution_Addressbook_CallStatu
  * Return value: a new #EBookViewListener
  */
 EBookViewListener *
-e_book_view_listener_new ()
+e_book_view_listener_new (void)
 {
        static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
        static PortableServer_POA poa = NULL;
index c9a26cd..fa7fad6 100644 (file)
@@ -3767,7 +3767,7 @@ startup_mainloop (void *arg)
 
 /* one-time start up for libebook */
 static void
-e_book_activate()
+e_book_activate(void)
 {
        static GStaticMutex e_book_lock = G_STATIC_MUTEX_INIT;
        static gboolean activated = FALSE;
@@ -3837,7 +3837,7 @@ e_book_new_from_uri (const char *uri, GError **error)
        ESource *source;
        EBook *book;
 
-       e_return_error_if_fail (uri,                      E_BOOK_ERROR_INVALID_ARG);
+       e_return_error_if_fail (uri, E_BOOK_ERROR_INVALID_ARG);
 
        group = e_source_group_new ("", uri);
        source = e_source_new ("", "");
@@ -3874,7 +3874,7 @@ e_book_new_system_addressbook    (GError **error)
        if (!e_book_get_addressbooks (&sources, &err)) {
                if (error)
                        g_propagate_error (error, err);
-               return FALSE;
+               return NULL;
        }
 
        for (g = e_source_list_peek_groups (sources); g; g = g->next) {
@@ -3944,7 +3944,7 @@ e_book_new_default_addressbook   (GError **error)
        if (!e_book_get_addressbooks (&sources, &err)) {
                if (error)
                        g_propagate_error (error, err);
-               return FALSE;
+               return NULL;
        }
 
        for (g = e_source_list_peek_groups (sources); g; g = g->next) {
index 3e71501..14e1632 100644 (file)
@@ -1648,7 +1648,7 @@ e_contact_set_attributes (EContact *contact, EContactField field_id, GList *attr
  * Return value: A new #EContactName struct.
  **/
 EContactName*
-e_contact_name_new ()
+e_contact_name_new (void)
 {
        return g_new0 (EContactName, 1);
 }
index ac82b27..9ffa5ff 100644 (file)
@@ -753,7 +753,7 @@ e_vcard_construct (EVCard *evc, const char *str)
  * Return value: A new, blank #EVCard.
  **/
 EVCard *
-e_vcard_new ()
+e_vcard_new (void)
 {
        return e_vcard_new_from_string ("");
 }
@@ -1848,8 +1848,8 @@ e_vcard_attribute_get_param (EVCardAttribute *attr, const char *name)
 {
        GList *params, *p;
        
-       g_return_val_if_fail (attr != NULL, FALSE);
-       g_return_val_if_fail (name != NULL, FALSE);
+       g_return_val_if_fail (attr != NULL, NULL);
+       g_return_val_if_fail (name != NULL, NULL);
        
        params = e_vcard_attribute_get_params (attr);
 
@@ -2103,7 +2103,7 @@ _evc_base64_encode_simple (const char *data, size_t len)
 {
        unsigned char *out;
        int state = 0, outlen;
-       unsigned int save = 0;
+       int save = 0;
 
        g_return_val_if_fail (data != NULL, NULL);
 
index 05eeefe..a122320 100644 (file)
@@ -143,12 +143,8 @@ e_book_backend_cache_constructor (GType type,
        GObject *obj;
        const char *uri;
        char *cache_file;
-       EBookBackendCacheClass *klass;
-       GObjectClass *parent_class;
 
        /* Invoke parent constructor. */
-       klass = E_BOOK_BACKEND_CACHE_CLASS (g_type_class_peek (E_TYPE_BOOK_BACKEND_CACHE));
-       parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
        obj = parent_class->constructor (type,
                                         n_construct_properties,
                                         construct_properties);
@@ -509,7 +505,7 @@ e_book_backend_cache_set_time (EBookBackendCache *cache, const char *t)
 char *
 e_book_backend_cache_get_time (EBookBackendCache *cache)
 {
-       g_return_val_if_fail (E_IS_BOOK_BACKEND_CACHE (cache), 0);
-       return e_file_cache_get_object (E_FILE_CACHE (cache), "last_update_time");
+       g_return_val_if_fail (E_IS_BOOK_BACKEND_CACHE (cache), NULL);
+       return g_strdup (e_file_cache_get_object (E_FILE_CACHE (cache), "last_update_time"));
 }
 
index ac3a1fb..b93f433 100644 (file)
@@ -175,7 +175,7 @@ e_book_backend_db_cache_add_contact (DB *db,
        if (!uid) {
                printf ("no uid\n");
                printf("name:%s, email:%s\n", e_contact_get (contact, E_CONTACT_GIVEN_NAME), e_contact_get (contact, E_CONTACT_EMAIL_1));
-               return NULL
+               return FALSE
        }
        string_to_dbt (uid, &uid_dbt);
        
index 1f72885..abb95cd 100644 (file)
@@ -7,8 +7,8 @@
 static void
 print_email (EContact *contact)
 {
-       char *file_as = e_contact_get_const (contact, E_CONTACT_FILE_AS);
-       char *name_or_org = e_contact_get_const (contact, E_CONTACT_NAME_OR_ORG);
+       const char *file_as = e_contact_get_const (contact, E_CONTACT_FILE_AS);
+       const char *name_or_org = e_contact_get_const (contact, E_CONTACT_NAME_OR_ORG);
        GList *emails, *e;
 
        printf ("Contact: %s\n", file_as);
index 92e1b0f..fdcb79d 100644 (file)
@@ -7,8 +7,8 @@
 static void
 print_email (EContact *contact)
 {
-       char *file_as = e_contact_get_const (contact, E_CONTACT_FILE_AS);
-       char *name_or_org = e_contact_get_const (contact, E_CONTACT_NAME_OR_ORG);
+       const char *file_as = e_contact_get_const (contact, E_CONTACT_FILE_AS);
+       const char *name_or_org = e_contact_get_const (contact, E_CONTACT_NAME_OR_ORG);
        GList *emails, *e;
 
        printf ("Contact: %s\n", file_as);
index b411d84..2f983dc 100644 (file)
@@ -1,3 +1,16 @@
+2007-04-01  Matthew Barnes  <mbarnes@redhat.com>
+
+       * libedata-cal/e-data-cal-factory.c (get_backend_factory):
+       * backends/groupwise/e-cal-backend-groupwise-utils
+       (e_cal_backend_groupwise_set_attachments_from_comp),
+       (e_gw_connection_get_freebusy_info):
+       * backends/caldav/e-cal-backend-caldav.c (process_object):
+       * backends/contacts/e-cal-backend-contacts.c (book_record_new),
+       (contact_record_cb_new), (source_group_removed_cb),
+       (cdate_to_icaltime), (create_component):
+       * libecal/e-cal-listener.c (ECalListenerPrivate):
+       Fix some compiler warnings.  Patch from Kjartan Maraas.
+
 2007-03-29  Matthew Barnes  <mbarnes@redhat.com>
 
        * backends/file/e-cal-backend-file.c:
index 15ef5b6..7558111 100644 (file)
@@ -1859,7 +1859,7 @@ process_object (ECalBackendCalDAV   *cbdav,
                case ICAL_METHOD_REPLY:
 
                if (online) {
-                       CalDAVObject object = { 0, };
+                       CalDAVObject object = { NULL, };
 
                        if (ccomp) {
                                const char *href;
index 3314639..7b0bba2 100644 (file)
@@ -87,7 +87,7 @@ static BookRecord *
 book_record_new (ECalBackendContacts *cbc, ESource *source)
 {
         EBook      *book;
-        GList      *fields = 0;
+        GList      *fields = NULL;
         EBookQuery *query;
         EBookView  *book_view;
         BookRecord *br;
@@ -214,7 +214,7 @@ contact_record_cb_new (ECalBackendContacts *cbc, ECalBackendSExp *sexp)
 
         cb_data->cbc = cbc;
         cb_data->sexp = sexp;
-        cb_data->result = 0;
+        cb_data->result = NULL;
 
         return cb_data;
 }
@@ -222,7 +222,7 @@ contact_record_cb_new (ECalBackendContacts *cbc, ECalBackendSExp *sexp)
 static void
 contact_record_cb_free (ContactRecordCB *cb_data)
 {
-        g_list_foreach (cb_data->result, (GFunc) g_free, 0);
+        g_list_foreach (cb_data->result, (GFunc) g_free, NULL);
         g_list_free (cb_data->result);
         
         g_free (cb_data);
@@ -306,7 +306,7 @@ static void
 source_group_removed_cb (ESourceList *source_list, ESourceGroup *group, gpointer user_data)
 {
         ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
-        GSList *i = 0;
+        GSList *i = NULL;
         
         g_return_if_fail (cbc);
         
@@ -396,6 +396,7 @@ cdate_to_icaltime (EContactDate *cdate)
        ret.is_date = TRUE;
        ret.is_utc = FALSE;
        ret.zone = NULL;
+       ret.is_daylight = FALSE;
        
        ret.hour = ret.minute = ret.second = 0;
 
@@ -414,7 +415,7 @@ create_component (ECalBackendContacts *cbc, const char *uid, EContactDate *cdate
        struct icalrecurrencetype  r;
         GSList recur_list;
 
-        g_return_val_if_fail (E_IS_CAL_BACKEND_CONTACTS (cbc), 0);
+        g_return_val_if_fail (E_IS_CAL_BACKEND_CONTACTS (cbc), NULL);
 
         if (!cdate)
                 return NULL;
index d80d5a5..3dd244f 100644 (file)
@@ -272,7 +272,7 @@ e_cal_backend_groupwise_set_attachments_from_comp (ECalComponent *comp,
                
                EGwItemAttachment *attach_item;
                char *file_contents, *encoded_data;
-               int file_len;
+               guint file_len;
                char *attach_filename_full, *filename;
                const char *uid;
 
@@ -1749,7 +1749,7 @@ e_gw_connection_get_freebusy_info (EGwConnection *cnc, GList *users, time_t star
                        if (tmp) {
                                start = soup_soap_parameter_get_string_value (tmp);
                                t = e_gw_connection_get_date_from_string (start);
-                               itt = icaltime_from_timet_with_zone (t, 0, default_zone ? default_zone : 0);
+                               itt = icaltime_from_timet_with_zone (t, 0, default_zone ? default_zone : NULL);
                                ipt.start = itt;
                        }        
 
@@ -1757,7 +1757,7 @@ e_gw_connection_get_freebusy_info (EGwConnection *cnc, GList *users, time_t star
                        if (tmp) {
                                end = soup_soap_parameter_get_string_value (tmp);
                                t = e_gw_connection_get_date_from_string (end);
-                               itt = icaltime_from_timet_with_zone (t, 0, default_zone ? default_zone : 0);
+                               itt = icaltime_from_timet_with_zone (t, 0, default_zone ? default_zone : NULL);
                                ipt.end = itt;
                        }
                        icalprop = icalproperty_new_freebusy (ipt);
index 4376b97..6019da8 100644 (file)
@@ -34,7 +34,7 @@ struct ECalListenerPrivate {
        gpointer fn_data;
 
        /* Whether notification is desired */
-       gboolean notify : 1;
+       guint notify : 1;
 };
 
 /* Signal IDs */
index c27d70f..50ed16c 100644 (file)
@@ -86,7 +86,7 @@ get_backend_factory (GHashTable *methods, const char *method, icalcomponent_kind
        
        kinds = g_hash_table_lookup (methods, method);
        if (!kinds)
-               return 0;
+               return NULL;
 
        factory = g_hash_table_lookup (kinds, GINT_TO_POINTER (kind));
 
index acfc076..2c99b39 100644 (file)
@@ -445,7 +445,7 @@ test_e_cal_remove (ECal *ecal, const char *uri)
 #endif
 
 static char *
-test_new_system_calendar()
+test_new_system_calendar(void)
 {
        ECal *cal;
        char *uri;
@@ -462,7 +462,7 @@ test_new_system_calendar()
 }
 
 static char *
-test_new_system_tasks()
+test_new_system_tasks(void)
 {
        ECal *cal;
        char *uri;
@@ -479,7 +479,7 @@ test_new_system_tasks()
 }
 
 static char *
-test_new_system_memos()
+test_new_system_memos(void)
 {
        ECal *cal;
        char *uri;
index d4e62eb..051934c 100644 (file)
@@ -1,3 +1,13 @@
+2007-04-01  Matthew Barnes  <mbarnes@redhat.com>
+
+       * camel-mime-utils.c (rfc2047_encode_word):
+       Properly escape what would otherwise be a trigraph (??=).
+       Patch from Kjartan Maraas.
+
+       * camel-search-private.c (header_match):
+       * camel-url.c (camel_url_to_string):
+       Fix a compiler warning.  Patch from Kjartan Maraas.
+
 2007-03-29  Matthew Barnes  <mbarnes@redhat.com>
 
        * camel-private.h:
index afd81ca..9f68a6d 100644 (file)
@@ -1330,7 +1330,7 @@ rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *
                        proclen = -1;
                        p = inptr;
                        i = 0;
-                       while (p < (in+len) && convlen < (75 - strlen("=?utf-8?q\?\?="))) {
+                       while (p < (in+len) && convlen < (75 - strlen("=?utf-8?q?\?="))) {
                                unsigned char c = *p++;
 
                                if (c >= 0xc0)
@@ -1343,7 +1343,7 @@ rfc2047_encode_word(GString *outstring, const char *in, size_t len, const char *
                                else
                                        convlen += 3;
                        }
-                       if (proclen >= 0 && proclen < i && convlen < (75 - strlen("=?utf-8?q\?\?=")))
+                       if (proclen >= 0 && proclen < i && convlen < (75 - strlen("=?utf-8?q?\?=")))
                                proclen = i;
                        /* well, we probably have broken utf8, just copy it anyway what the heck */
                        if (proclen == -1) {
index 87fe8d0..eef253f 100644 (file)
@@ -381,7 +381,7 @@ header_match(const char *value, const char *match, camel_search_match_t how)
        /* from dan the man, if we have mixed case, perform a case-sensitive match,
           otherwise not */
        p = (const unsigned char *)match;
-       while (c = camel_utf8_getc(&p)) {
+       while ((c = camel_utf8_getc(&p))) {
                if (g_unichar_isupper(c)) {
                        switch (how) {
                        case CAMEL_SEARCH_MATCH_EXACT:
index c975f49..b82bc7b 100644 (file)
@@ -328,7 +328,7 @@ camel_url_to_string (CamelURL *url, guint32 flags)
 #ifdef G_OS_WIN32
        if (url->protocol && !strcmp(url->protocol, "file"))
                return g_filename_to_uri(url->path, url->host, NULL);
-#endif G_OS_WIN32
+#endif
        
        str = g_string_sized_new (20);
        
index f2208b2..2f665f8 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-01  Matthew Barnes  <mbarnes@redhat.com>
+
+       * camel-groupwise-store.c:
+       Disable unused functions.  Patch from Kjartan Maraas.
+
 2007-03-29  Matthew Barnes  <mbarnes@redhat.com>
 
        * camel-groupwise-utils.c:
index 82afdbc..c7d02b0 100644 (file)
@@ -328,6 +328,7 @@ groupwise_connect (CamelService *service, CamelException *ex)
        return FALSE;
 
 }
+#if 0
 static void
 groupwise_disconnect_cleanup (CamelService *service, gboolean clean, CamelException *ex)
 {
@@ -381,6 +382,7 @@ groupwise_disconnect_cleanup (CamelService *service, gboolean clean, CamelExcept
                groupwise_store->priv = NULL;
        }
 }
+#endif
 
 static gboolean
 groupwise_disconnect (CamelService *service, gboolean clean, CamelException *ex)
@@ -1070,6 +1072,7 @@ struct _store_refresh_msg {
        CamelException ex;
 };
 
+#if 0
 static void
 store_refresh_refresh (CamelSession *session, CamelSessionThreadMsg *msg)
 {
@@ -1101,6 +1104,7 @@ static CamelSessionThreadOps store_refresh_ops = {
        store_refresh_refresh,
        store_refresh_free,
 };
+#endif
 
 /*** Thread stuff ends ***/
 
index 23cb834..7058e94 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-01  Matthew Barnes  <mbarnes@redhat.com>
+
+       * camel-pop3-store.c (connect_to_server):
+       Fix a compiler warning.  Patch from Kjartan Maraas.
+
 2007-03-26  Matthew Barnes  <mbarnes@redhat.com>
 
        * camel-pop3-folder.c:
index a72d1fa..ce02b55 100644 (file)
@@ -154,7 +154,7 @@ connect_to_server (CamelService *service, struct addrinfo *ai, int ssl_mode, Cam
        guint32 flags = 0;
        int clean_quit = TRUE;
        int ret;
-       gchar *delete_days;
+       const gchar *delete_days;
        
        if (ssl_mode != MODE_CLEAR) {
 #ifdef HAVE_SSL
index be58cea..307b28f 100644 (file)
@@ -282,7 +282,7 @@ str_to_receipt_policy (const char *str)
 static char*
 receipt_policy_to_str (EAccountReceiptPolicy val)
 {
-       char *ret = 0;
+       char *ret = NULL;
        
        switch (val) {
        case E_ACCOUNT_RECEIPT_NEVER:
index 7c3bbe7..8a656ce 100644 (file)
@@ -163,7 +163,7 @@ struct {
 static void e_dlist_init(EDList *v)
 {
         v->head = (EDListNode *)&v->tail;
-        v->tail = 0;
+        v->tail = NULL;
         v->tailpred = (EDListNode *)&v->head;
 }
 
index 1ad19e6..7acf004 100644 (file)
@@ -158,9 +158,9 @@ e_list_iterator_insert   (EIterator  *_iterator,
                        iterator->iterator = iterator->iterator->prev;
                } else {
                        if (iterator->iterator->next)
-                               g_list_prepend(iterator->iterator->next, data);
+                               iterator->iterator->next = g_list_prepend(iterator->iterator->next, data);
                        else
-                               g_list_append(iterator->iterator, data);
+                               iterator->iterator = g_list_append(iterator->iterator, data);
                        iterator->iterator = iterator->iterator->next;
                }
                e_list_invalidate_iterators(iterator->list, E_ITERATOR(iterator));
index 81d0a06..400f174 100644 (file)
@@ -583,7 +583,7 @@ term_eval_castint(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *
                r->value.number = argv[0]->value.bool != 0;
                break;
        case ESEXP_RES_STRING:
-               r->value.number = strtoul(argv[0]->value.string, 0, 10);
+               r->value.number = strtoul(argv[0]->value.string, NULL, 10);
                break;
        default:
                e_sexp_result_free(f, r);
@@ -1089,7 +1089,7 @@ e_sexp_finalise(void *o)
        e_memchunk_destroy(s->term_chunks);
        e_memchunk_destroy(s->result_chunks);
 
-       g_scanner_scope_foreach_symbol(s->scanner, 0, free_symbol, 0);
+       g_scanner_scope_foreach_symbol(s->scanner, 0, free_symbol, NULL);
        g_scanner_destroy(s->scanner);
 
 #ifdef E_SEXP_IS_G_OBJECT
index 44e7fe5..06d39c4 100644 (file)
@@ -340,7 +340,7 @@ e_trie_search (ETrie *trie, const char *buffer, size_t buflen, int *matched_id)
        const unsigned char *inptr, *inend, *prev, *pat;
        register size_t inlen = buflen;
        struct _trie_state *q;
-       struct _trie_match *m;
+       struct _trie_match *m = NULL; /* init to please gcc */
        gunichar c;
        
        inptr = (const unsigned char *) buffer;
index 3600dd0..94ea979 100644 (file)
@@ -237,20 +237,20 @@ e_uri_new (const char *uri_string)
        semi = memchr (uri_string, ';', end - uri_string);
        if (semi) {
                if (semi[1]) {
-                       const char *cur, *p, *eq;
+                       const char *cur, *ptr, *eq;
                        char *name, *value;
 
-                       for (cur = semi + 1; cur < end; cur = p + 1) {
-                               p = memchr (cur, ';', end - cur);
-                               if (!p)
-                                       p = end;
-                               eq = memchr (cur, '=', p - cur);
+                       for (cur = semi + 1; cur < end; cur = ptr + 1) {
+                               ptr = memchr (cur, ';', end - cur);
+                               if (!ptr)
+                                       ptr = end;
+                               eq = memchr (cur, '=', ptr - cur);
                                if (eq) {
                                        name = g_strndup (cur, eq - cur);
-                                       value = g_strndup (eq + 1, p - (eq + 1));
+                                       value = g_strndup (eq + 1, ptr - (eq + 1));
                                        uri_decode (value);
                                } else {
-                                       name = g_strndup (cur, p - cur);
+                                       name = g_strndup (cur, ptr - cur);
                                        value = g_strdup ("");
                                }
                                uri_decode (name);
index 0406b0c..51c8b6b 100644 (file)
@@ -1,3 +1,11 @@
+2007-04-01  Matthew Barnes  <mbarnes@redhat.com>
+
+       * e-source-selector.c (group_search_function):
+       Fix a compiler warning.  Patch from Kjartan Maraas.
+
+       * e-passwords.c: Use #ifdef WITH_GNOME_KEYRING, not #if.
+       Patch from Kjartan Maraas.
+
 2007-03-29  Matthew Barnes  <mbarnes@redhat.com>
 
        * e-source-selector.c:
index 12d7f0b..3d53623 100644 (file)
@@ -54,7 +54,7 @@
 #include "libedataserver/e-msgport.h"
 #include "libedataserver/e-url.h"
 
-#if WITH_GNOME_KEYRING
+#ifdef WITH_GNOME_KEYRING
 #include <gnome-keyring.h>
 #endif
 
@@ -192,7 +192,7 @@ ep_msg_send(EPassMsg *msg)
 }
 
 /* the functions that actually do the work */
-#if WITH_GNOME_KEYRING
+#ifdef WITH_GNOME_KEYRING
 static void
 ep_clear_passwords_keyring(EPassMsg *msg)
 {
@@ -268,7 +268,7 @@ free_entry (gpointer key, gpointer value, gpointer user_data)
        return TRUE;
 }
 
-#if WITH_GNOME_KEYRING
+#ifdef WITH_GNOME_KEYRING
 static void
 ep_forget_passwords_keyring(EPassMsg *msg)
 {
@@ -367,7 +367,7 @@ password_path (const char *component_name, const char *key)
        return path;
 }
 
-#if WITH_GNOME_KEYRING
+#ifdef WITH_GNOME_KEYRING
 static void
 ep_remember_password_keyring(EPassMsg *msg)
 {
@@ -463,7 +463,7 @@ ep_remember_password_file(EPassMsg *msg)
                e_msgport_reply(&msg->msg);
 }
 
-#if WITH_GNOME_KEYRING
+#ifdef WITH_GNOME_KEYRING
 static void
 ep_forget_password_keyring (EPassMsg *msg)
 {
@@ -597,7 +597,7 @@ ep_forget_password_file (EPassMsg *msg)
 }
 
 
-#if WITH_GNOME_KEYRING
+#ifdef WITH_GNOME_KEYRING
 static void
 ep_get_password_keyring (EPassMsg *msg)
 {
@@ -754,7 +754,7 @@ pass_response(GtkDialog *dialog, int response, void *data)
                                msg->oldpass = msg->password;
                                ep_add_password(msg);
                        }
-#if WITH_GNOME_KEYRING
+#ifdef WITH_GNOME_KEYRING
                        if (*msg->remember && type == E_PASSWORDS_REMEMBER_FOREVER) {
                                if (gnome_keyring_is_available())
                                        ep_remember_password_keyring(msg);
@@ -781,12 +781,12 @@ pass_response(GtkDialog *dialog, int response, void *data)
        mw = (EPassMsg *)request_list.head;
        mn = (EPassMsg *)mw->msg.ln.next;
        while (mn) {
-#if WITH_GNOME_KEYRING         
+#ifdef WITH_GNOME_KEYRING              
                if ((mw->dispatch == (gnome_keyring_is_available() ? ep_forget_password_keyring : ep_forget_password_file)
 #else
                if ((mw->dispatch == ep_forget_password_file                 
 #endif
-#if WITH_GNOME_KEYRING                              
+#ifdef WITH_GNOME_KEYRING                                   
                     || mw->dispatch == (gnome_keyring_is_available() ? ep_get_password_keyring : ep_get_password_file)
 #else
                     || mw->dispatch == ep_get_password_file                 
@@ -852,7 +852,7 @@ ep_ask_password(EPassMsg *msg)
        gtk_widget_grab_focus (msg->entry);
        
        if ((msg->flags & E_PASSWORDS_REPROMPT)) {
-#if WITH_GNOME_KEYRING
+#ifdef WITH_GNOME_KEYRING
                if (gnome_keyring_is_available())
                        ep_get_password_keyring(msg);
                else
@@ -986,7 +986,7 @@ e_passwords_set_online(int state)
 void
 e_passwords_forget_passwords (void)
 {
-#if WITH_GNOME_KEYRING 
+#ifdef WITH_GNOME_KEYRING      
        EPassMsg *msg = ep_msg_new(gnome_keyring_is_available() ? ep_forget_passwords_keyring : ep_forget_passwords_file);
 #else
        EPassMsg *msg = ep_msg_new(ep_forget_passwords_file);
@@ -1004,7 +1004,7 @@ e_passwords_forget_passwords (void)
 void
 e_passwords_clear_passwords (const char *component_name)
 {
-#if WITH_GNOME_KEYRING 
+#ifdef WITH_GNOME_KEYRING      
        EPassMsg *msg = ep_msg_new(gnome_keyring_is_available() ? ep_clear_passwords_keyring : ep_clear_passwords_file);
 #else
        EPassMsg *msg = ep_msg_new(ep_clear_passwords_file);            
@@ -1029,7 +1029,7 @@ e_passwords_remember_password (const char *component_name, const char *key)
        g_return_if_fail(component_name != NULL);
        g_return_if_fail(key != NULL);
 
-#if WITH_GNOME_KEYRING
+#ifdef WITH_GNOME_KEYRING
        msg = ep_msg_new(gnome_keyring_is_available() ? ep_remember_password_keyring : ep_remember_password_file);
 #else
        msg = ep_msg_new(ep_remember_password_file);
@@ -1055,7 +1055,7 @@ e_passwords_forget_password (const char *component_name, const char *key)
        g_return_if_fail(component_name != NULL);
        g_return_if_fail(key != NULL);
 
-#if WITH_GNOME_KEYRING 
+#ifdef WITH_GNOME_KEYRING      
        msg = ep_msg_new(gnome_keyring_is_available() ? ep_forget_password_keyring : ep_forget_password_file);
 #else  
        msg = ep_msg_new(ep_forget_password_file);
@@ -1083,7 +1083,7 @@ e_passwords_get_password (const char *component_name, const char *key)
        g_return_val_if_fail(component_name != NULL, NULL);
        g_return_val_if_fail(key != NULL, NULL);
 
-#if WITH_GNOME_KEYRING 
+#ifdef WITH_GNOME_KEYRING      
        msg = ep_msg_new(gnome_keyring_is_available() ? ep_get_password_keyring : ep_get_password_file);
 #else
        msg = ep_msg_new(ep_get_password_file);
index 4e3cd54..72d2afa 100644 (file)
@@ -737,7 +737,7 @@ group_search_function   (GtkTreeModel *model,
                         gpointer dummy)
 {
        void *data;
-       char *name=NULL;
+       const char *name = NULL;
        gboolean status = TRUE;
        
        gtk_tree_model_get (model, iter, 0, &data, -1);
index 4a69876..1c869fd 100644 (file)
@@ -1,3 +1,26 @@
+2007-04-01  Matthew Barnes  <mbarnes@redhat.com>
+
+       ** Various code clean-ups from Kjartan Maraas.
+
+       * storage/exchange-account.h (exchange_account_set_password):
+       Function declaration should not be subject to conditional compilation.
+
+       * storage/e-folder-type-registry.c
+       (e_folder_type_registry_get_display_name_for_type),
+       (e_folder_type_registry_get_description_for_type):
+       Return NULL, not FALSE.
+
+       * lib/e2k-rule-xml.c: Declare private arrays as static.
+
+       * lib/e2k-context.c (e2k_context_new), (e2k_debug_print_request),
+       (e2k_debug_print_response): Use NULL instead of zero (0).
+
+       * lib/e2k-context.c (do_notification):
+       g_io_channel_read_chars() returns GIOStatus, not GIOError.
+
+       * lib/e2k-autoconfig.c (e2k_autoconfig_check_exchange):
+       Fix a compiler warning.
+
 2007-03-26  Matthew Barnes  <mbarnes@redhat.com>
 
        * storage/e-folder-exchange.c:
index 46634cd..0c87ad8 100644 (file)
@@ -643,7 +643,8 @@ e2k_autoconfig_check_exchange (E2kAutoconfig *ac, E2kOperation *op)
        E2kResultIter *iter;
        E2kResult *results;
        GByteArray *entryid;
-       const char *exchange_dn, *timezone, *prop, *hrefs[] = { "" };
+       const char *exchange_dn, *timezone, *hrefs[] = { "" };
+       xmlChar *prop;
        char *body;
        int len;
        E2kUri *euri;
index 5559798..98a760e 100644 (file)
@@ -326,7 +326,7 @@ e2k_context_new (const char *uri)
        g_object_ref (ctx);
        ctx->priv->get_local_address_sock =
                soup_socket_client_new_async (
-                       suri->host, suri->port, FALSE,
+                       suri->host, suri->port, NULL,
                        got_connection, ctx);
        soup_uri_free (suri);
 
@@ -451,7 +451,7 @@ e2k_debug_print_request (SoupMessage *msg, const char *note)
                msg->method, uri->path,
                uri->query ? "?" : "",
                uri->query ? uri->query : "",
-               msg, (unsigned long)time (0));
+               msg, (unsigned long)time (NULL));
        if (note)
                printf (" [%s]\n", note);
        else
@@ -476,7 +476,7 @@ e2k_debug_print_response (SoupMessage *msg)
 {
        printf ("%d %s\nE2k-Debug: %p @ %lu\n",
                msg->status_code, msg->reason_phrase,
-               msg, time (0));
+               msg, time (NULL));
        if (e2k_debug_level > 1) {
                soup_message_foreach_header (msg->response_headers,
                                             print_header, NULL);
@@ -2450,11 +2450,11 @@ do_notification (GIOChannel *source, GIOCondition condition, gpointer data)
        E2kSubscription *sub;
        char buffer[1024], *id, *lasts;
        gsize len;
-       GIOError err;
+       GIOStatus status;
 
-       err = g_io_channel_read_chars (source, buffer, sizeof (buffer) - 1, &len, NULL);
-       if (err != G_IO_ERROR_NONE && err != G_IO_ERROR_AGAIN) {
-               g_warning ("do_notification I/O error: %d (%s)", err,
+       status = g_io_channel_read_chars (source, buffer, sizeof (buffer) - 1, &len, NULL);
+       if (status != G_IO_STATUS_NORMAL && status != G_IO_STATUS_AGAIN) {
+               g_warning ("do_notification I/O error: %d (%s)", status,
                           g_strerror (errno));
                return FALSE;
        }
index 1e07b8a..419e856 100644 (file)
@@ -31,8 +31,8 @@
 #include "e2k-utils.h"
 #include "mapi.h"
 
-const char *contains_types[] = { NULL, "contains", NULL, NULL, NULL, "not contains", NULL, NULL };
-const char *subject_types[] = { "is", "contains", "starts with", NULL, "is not", "not contains", "not starts with", NULL };
+static const char *contains_types[] = { NULL, "contains", NULL, NULL, NULL, "not contains", NULL, NULL };
+static const char *subject_types[] = { "is", "contains", "starts with", NULL, "is not", "not contains", "not starts with", NULL };
 #define E2K_FL_NEGATE 4
 #define E2K_FL_MAX 8
 
@@ -65,10 +65,10 @@ fuzzy_level_to_name (int fuzzy_level, gboolean negated, const char *map[])
        return map[fuzzy_level];
 }
 
-const char *is_types[] = { NULL, NULL, NULL, NULL, "is", "is not" };
-const char *include_types[] = { NULL, NULL, NULL, NULL, "include", "not include" };
-const char *date_types[] = { "before", "before", "after", "after", NULL, NULL };
-const char *size_types[] = { "less than", "less than", "greater than", "greater than", NULL, NULL };
+static const char *is_types[] = { NULL, NULL, NULL, NULL, "is", "is not" };
+static const char *include_types[] = { NULL, NULL, NULL, NULL, "include", "not include" };
+static const char *date_types[] = { "before", "before", "after", "after", NULL, NULL };
+static const char *size_types[] = { "less than", "less than", "greater than", "greater than", NULL, NULL };
 
 #if 0
 static gboolean
index 2ff12fb..f538aac 100644 (file)
@@ -369,7 +369,7 @@ e_folder_type_registry_get_display_name_for_type (EFolderTypeRegistry *folder_ty
 
        folder_type = get_folder_type (folder_type_registry, type_name);
        if (folder_type == NULL)
-               return FALSE;
+               return NULL;
 
        return folder_type->display_name;
 }
@@ -385,7 +385,7 @@ e_folder_type_registry_get_description_for_type (EFolderTypeRegistry *folder_typ
 
        folder_type = get_folder_type (folder_type_registry, type_name);
        if (folder_type == NULL)
-               return FALSE;
+               return NULL;
 
        return folder_type->description;
 }
index 2d0f2db..a3c1f1a 100644 (file)
@@ -1365,7 +1365,7 @@ exchange_account_connect (ExchangeAccount *account, const char *pword,
        E2kResult *results;
        int nresults = 0, mode;
        GByteArray *entryid;
-       const char *timezone;
+       const char *tz;
        E2kGlobalCatalogStatus gcstatus;
        E2kGlobalCatalogEntry *entry;
        E2kOperation gcop;
@@ -1546,9 +1546,9 @@ exchange_account_connect (ExchangeAccount *account, const char *pword,
                if (entryid)
                        account->legacy_exchange_dn = g_strdup (e2k_entryid_to_dn (entryid));
 
-               timezone = e2k_properties_get_prop (results[0].props, E2K_PR_EXCHANGE_TIMEZONE);
-               if (timezone)
-                       account->default_timezone = g_strdup (timezone);
+               tz = e2k_properties_get_prop (results[0].props, E2K_PR_EXCHANGE_TIMEZONE);
+               if (tz)
+                       account->default_timezone = g_strdup (tz);
        }
 
        if (!setup_account_hierarchies (account)) {
@@ -1964,7 +1964,7 @@ exchange_account_get_quota_limit (ExchangeAccount *account)
 int
 exchange_account_check_password_expiry (ExchangeAccount *account)
 {
-       E2kGlobalCatalogEntry *entry;
+       E2kGlobalCatalogEntry *entry; /* This is never set before it's used! */
        int max_pwd_age_days = -1;
 
        g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), 0);
index aabd40e..432edad 100644 (file)
@@ -110,11 +110,9 @@ void                   exchange_account_rescan_tree          (ExchangeAccount  *
 
 char                 *exchange_account_get_password         (ExchangeAccount  *acct);
 
-#ifdef HAVE_KRB5
 ExchangeAccountResult exchange_account_set_password         (ExchangeAccount  *acct,
                                                              char             *old_password,
                                                              char             *new_password);
-#endif
 
 void                  exchange_account_forget_password       (ExchangeAccount  *acct);
 
index 4b02e51..db3e94b 100644 (file)
@@ -1,3 +1,12 @@
+2007-04-01  Matthew Barnes  <mbarnes@redhat.com>
+
+       ** Various code-cleanups from Kjartan Maraas.
+
+       * e-gw-recur-utils.c: Declare private array as static.
+
+       * e-gw-message.c (debug_handler), (setup_debug):
+       Use NULL instead of zero (0).
+
 2007-03-26  Matthew Barnes  <mbarnes@redhat.com>
 
        * e-gw-connection.c:
index 38f2b23..c2863c4 100644 (file)
@@ -1620,7 +1620,7 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
 {
        EGwItem *item;
         char *item_type;
-       SoupSoapParameter *subparam, *child, *category_param, *attachment_param;
+       SoupSoapParameter *subparameter, *child, *category_param, *attachment_param;
        gboolean is_group_item = TRUE;
        GList *user_email = NULL;
        
@@ -1687,19 +1687,19 @@ e_gw_item_new_from_soap_parameter (const char *email, const char *container, Sou
        e_gw_item_set_email_list (item, user_email);
 
        /* If the parameter consists of changes - populate deltas */
-       subparam = soup_soap_parameter_get_first_child_by_name (param, "changes");
-       if (subparam) {
-               SoupSoapParameter *changes = subparam;
-               subparam = soup_soap_parameter_get_first_child_by_name (changes, "add");
-               if (!subparam)
-                       subparam = soup_soap_parameter_get_first_child_by_name (changes, "delete");
-               if (!subparam)
-                       subparam = soup_soap_parameter_get_first_child_by_name (changes, "update");
-       }
-       else subparam = param; /* The item is a complete one, not a delta  */
+       subparameter = soup_soap_parameter_get_first_child_by_name (param, "changes");
+       if (subparameter) {
+               SoupSoapParameter *changes = subparameter;
+               subparameter = soup_soap_parameter_get_first_child_by_name (changes, "add");
+               if (!subparameter)
+                       subparameter = soup_soap_parameter_get_first_child_by_name (changes, "delete");
+               if (!subparameter)
+                       subparameter = soup_soap_parameter_get_first_child_by_name (changes, "update");
+       }
+       else subparameter = param; /* The item is a complete one, not a delta  */
        
        /* now add all properties to the private structure */
-       for (child = soup_soap_parameter_get_first_child (subparam);
+       for (child = soup_soap_parameter_get_first_child (subparameter);
                        child != NULL;
                        child = soup_soap_parameter_get_next_child (child)) {
                const char *name;
index e8233bf..ac8e262 100644 (file)
@@ -37,7 +37,7 @@ debug_handler (SoupMessage *msg, gpointer user_data)
 {
        g_print ("%d %s\nSOAP-Debug: %p @ %lu\n",
                 msg->status_code, msg->reason_phrase,
-                msg, time (0));
+                msg, time (NULL));
 
        /* print headers */
        soup_message_foreach_header (msg->response_headers, print_header, NULL);
@@ -60,7 +60,7 @@ setup_debug (SoupSoapMessage *msg)
                 SOUP_MESSAGE (msg)->method, suri->path,
                 suri->query ? "?" : "",
                 suri->query ? suri->query : "",
-                msg, (unsigned long) time (0));
+                msg, (unsigned long) time (NULL));
 
        /* print message headers */
        print_header ("Host", suri->host, NULL);
index 4082330..90aaa8c 100644 (file)
@@ -25,7 +25,7 @@
 #endif
 #include "e-gw-recur-utils.h"
 
-const char *days_of_week[7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
+static const char *days_of_week[7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
 
 const char *
 e_gw_recur_get_day_of_week (short day) 
index 65748c5..283fd1f 100644 (file)
@@ -630,7 +630,7 @@ e_gw_sendoptions_form_message_to_modify (SoupSoapMessage *msg, EGwSendOptions *n
 }
 
 EGwSendOptions *
-e_gw_sendoptions_new ()
+e_gw_sendoptions_new (void)
 {
        EGwSendOptions *opts;