Removed unneeded CAMEL_OBJECT() casts.
authorJeffrey Stedfast <fejj@ximian.com>
Thu, 23 Oct 2003 19:57:58 +0000 (19:57 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Thu, 23 Oct 2003 19:57:58 +0000 (19:57 +0000)
2003-10-23  Jeffrey Stedfast  <fejj@ximian.com>

* *.c: Removed unneeded CAMEL_OBJECT() casts.

24 files changed:
camel/ChangeLog
camel/camel-cipher-context.c
camel/camel-cms-context.c
camel/camel-digest-folder.c
camel/camel-disco-diary.c
camel/camel-filter-driver.c
camel/camel-filter-search.c
camel/camel-folder-search.c
camel/camel-folder.c
camel/camel-gpg-context.c
camel/camel-http-stream.c
camel/camel-medium.c
camel/camel-mime-filter-save.c
camel/camel-mime-message.c
camel/camel-mime-part.c
camel/camel-multipart.c
camel/camel-sasl-anonymous.c
camel/camel-sasl.c
camel/camel-seekable-substream.c
camel/camel-service.c
camel/camel-session.c
camel/camel-smime-context.c
camel/camel-store.c
camel/camel-stream-buffer.c

index 343bbf3..6626346 100644 (file)
@@ -1,3 +1,7 @@
+2003-10-23  Jeffrey Stedfast  <fejj@ximian.com>
+
+       * *.c: Removed unneeded CAMEL_OBJECT() casts.
+
 2003-10-21  Not Zed  <NotZed@Ximian.com>
 
        * providers/local/camel-local-folder.c (local_getv, local_setv):
index ccec652..717f79e 100644 (file)
@@ -74,7 +74,7 @@ camel_cipher_context_finalise (CamelObject *o)
 {
        CamelCipherContext *context = (CamelCipherContext *)o;
        
-       camel_object_unref (CAMEL_OBJECT (context->session));
+       camel_object_unref (context->session);
        
        g_mutex_free (context->priv->lock);
        
@@ -134,7 +134,7 @@ camel_cipher_context_new (CamelSession *session)
        
        context = CAMEL_CIPHER_CONTEXT (camel_object_new (CAMEL_CIPHER_CONTEXT_TYPE));
        
-       camel_object_ref (CAMEL_OBJECT (session));
+       camel_object_ref (session);
        context->session = session;
        
        return context;
@@ -154,7 +154,7 @@ camel_cipher_context_construct (CamelCipherContext *context, CamelSession *sessi
        g_return_if_fail (CAMEL_IS_CIPHER_CONTEXT (context));
        g_return_if_fail (CAMEL_IS_SESSION (session));
        
-       camel_object_ref (CAMEL_OBJECT (session));
+       camel_object_ref (session);
        context->session = session;
 }
 
index 252bb81..7574ea4 100644 (file)
@@ -82,7 +82,7 @@ camel_cms_context_finalise (CamelObject *o)
 {
        CamelCMSContext *context = (CamelCMSContext *)o;
        
-       camel_object_unref (CAMEL_OBJECT (context->session));
+       camel_object_unref (context->session);
        
 #ifdef ENABLE_THREADS
        g_mutex_free (context->priv->lock);
@@ -143,7 +143,7 @@ camel_cms_context_new (CamelSession *session)
        
        context = CAMEL_CMS_CONTEXT (camel_object_new (CAMEL_CMS_CONTEXT_TYPE));
        
-       camel_object_ref (CAMEL_OBJECT (session));
+       camel_object_ref (session);
        context->session = session;
        
        return context;
@@ -163,7 +163,7 @@ camel_cms_context_construct (CamelCMSContext *context, CamelSession *session)
        g_return_if_fail (CAMEL_IS_CMS_CONTEXT (context));
        g_return_if_fail (CAMEL_IS_SESSION (session));
        
-       camel_object_ref (CAMEL_OBJECT (session));
+       camel_object_ref (session);
        context->session = session;
 }
 
index 595be88..b2c81b5 100644 (file)
@@ -116,14 +116,14 @@ digest_finalize (CamelObject *object)
        CamelFolder *folder = CAMEL_FOLDER (object);
        
        if (folder->summary) {
-               camel_object_unref (CAMEL_OBJECT (folder->summary));
+               camel_object_unref (folder->summary);
                folder->summary = NULL;
        }
        
-       camel_object_unref (CAMEL_OBJECT (digest_folder->priv->message));
+       camel_object_unref (digest_folder->priv->message);
        
        if (digest_folder->priv->search)
-               camel_object_unref (CAMEL_OBJECT (digest_folder->priv->search));
+               camel_object_unref (digest_folder->priv->search);
        
        g_mutex_free (digest_folder->priv->search_lock);
        
@@ -231,7 +231,7 @@ camel_digest_folder_new (CamelStore *parent_store, CamelMimeMessage *message)
        
        camel_folder_construct (folder, parent_store, "folder_name", "short_name");
        
-       camel_object_ref (CAMEL_OBJECT (message));
+       camel_object_ref (message);
        digest_folder->priv->message = message;
        
        construct_summary (folder, CAMEL_MULTIPART (wrapper));
@@ -310,7 +310,7 @@ digest_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
                return NULL;
        
        message = CAMEL_MIME_MESSAGE (wrapper);
-       camel_object_ref (CAMEL_OBJECT (message));
+       camel_object_ref (message);
        
        return message;
 }
index d59f8b1..927a97f 100644 (file)
@@ -405,7 +405,7 @@ camel_disco_diary_new (CamelDiscoStore *store, const char *filename, CamelExcept
 
        diary->file = fopen (filename, "a+");
        if (!diary->file) {
-               camel_object_unref (CAMEL_OBJECT (diary));
+               camel_object_unref (diary);
                camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
                                      "Could not open journal file: %s",
                                      g_strerror (errno));
index 8ac4d86..ff6a8a8 100644 (file)
@@ -254,7 +254,7 @@ camel_filter_driver_finalise (CamelObject *obj)
        
        if (p->defaultfolder) {
                camel_folder_thaw (p->defaultfolder);
-               camel_object_unref (CAMEL_OBJECT (p->defaultfolder));
+               camel_object_unref (p->defaultfolder);
        }
 
        while ((node = (struct _filter_rule *)e_dlist_remhead(&p->rules))) {
@@ -345,14 +345,14 @@ camel_filter_driver_set_default_folder (CamelFilterDriver *d, CamelFolder *def)
        
        if (p->defaultfolder) {
                camel_folder_thaw (p->defaultfolder);
-               camel_object_unref (CAMEL_OBJECT (p->defaultfolder));
+               camel_object_unref (p->defaultfolder);
        }
        
        p->defaultfolder = def;
        
        if (p->defaultfolder) {
                camel_folder_freeze (p->defaultfolder);
-               camel_object_ref (CAMEL_OBJECT (p->defaultfolder));
+               camel_object_ref (p->defaultfolder);
        }
 }
 
@@ -934,7 +934,7 @@ close_folder (void *key, void *value, void *data)
        if (folder != FOLDER_INVALID) {
                camel_folder_sync (folder, FALSE, p->ex);
                camel_folder_thaw (folder);
-               camel_object_unref (CAMEL_OBJECT (folder));
+               camel_object_unref (folder);
        }
 
        report_status(driver, CAMEL_FILTER_STATUS_PROGRESS, g_hash_table_size(p->folders)* 100 / p->closed, _("Syncing folders"));
@@ -1141,7 +1141,7 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox, co
                if (camel_mime_part_construct_from_parser (CAMEL_MIME_PART (msg), mp) == -1) {
                        camel_exception_set (ex, (errno==EINTR)?CAMEL_EXCEPTION_USER_CANCEL:CAMEL_EXCEPTION_SYSTEM, _("Cannot open message"));
                        report_status (driver, CAMEL_FILTER_STATUS_END, 100, _("Failed on message %d"), i);
-                       camel_object_unref (CAMEL_OBJECT (msg));
+                       camel_object_unref (msg);
                        goto fail;
                }
                
@@ -1150,7 +1150,7 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver, const char *mbox, co
                last = camel_mime_parser_tell(mp);
                status = camel_filter_driver_filter_message (driver, msg, info, NULL, NULL, source_url, 
                                                             original_source_url ? original_source_url : source_url, ex);
-               camel_object_unref (CAMEL_OBJECT (msg));
+               camel_object_unref (msg);
                if (camel_exception_is_set (ex) || status == -1) {
                        report_status (driver, CAMEL_FILTER_STATUS_END, 100, _("Failed on message %d"), i);
                        camel_message_info_free (info);
@@ -1178,7 +1178,7 @@ fail:
        if (fd != -1)
                close (fd);
        if (mp)
-               camel_object_unref (CAMEL_OBJECT (mp));
+               camel_object_unref (mp);
        
        return -1;
 }
@@ -1352,7 +1352,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
                struct _camel_header_raw *h;
                
                if (message) {
-                       camel_object_ref (CAMEL_OBJECT (message));
+                       camel_object_ref (message);
                } else {
                        message = camel_folder_get_message (source, uid, ex);
                        if (!message)
@@ -1369,7 +1369,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
                uid = camel_message_info_uid (info);
                
                if (message)
-                       camel_object_ref (CAMEL_OBJECT (message));
+                       camel_object_ref (message);
        }
        
        p->ex = ex;
@@ -1458,7 +1458,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
        }
        
        if (p->message)
-               camel_object_unref (CAMEL_OBJECT (p->message));
+               camel_object_unref (p->message);
        
        if (freeinfo)
                camel_message_info_free (info);
@@ -1470,7 +1470,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
                camel_filter_driver_log (driver, FILTER_LOG_END, NULL);
        
        if (p->message)
-               camel_object_unref (CAMEL_OBJECT (p->message));
+               camel_object_unref (p->message);
        
        if (freeinfo)
                camel_message_info_free (info);
index 0fa2c59..8af3392 100644 (file)
@@ -563,7 +563,7 @@ run_command (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessa
        
        camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), stream);
        camel_stream_flush (stream);
-       camel_object_unref (CAMEL_OBJECT (stream));
+       camel_object_unref (stream);
        
        result = waitpid (pid, &status, 0);
        
@@ -676,13 +676,13 @@ camel_filter_search_match (CamelSession *session,
        e_sexp_unref (sexp);
        
        if (fms.message)
-               camel_object_unref (CAMEL_OBJECT (fms.message));
+               camel_object_unref (fms.message);
        
        return retval;
        
  error:
        if (fms.message)
-               camel_object_unref (CAMEL_OBJECT (fms.message));
+               camel_object_unref (fms.message);
        
        e_sexp_unref (sexp);
        
index 7045726..8262ee3 100644 (file)
@@ -867,7 +867,8 @@ match_words_1message (CamelDataWrapper *object, struct _camel_search_words *word
                                        return TRUE;
                        }
                }
-               camel_object_unref (CAMEL_OBJECT (mem));
+               
+               camel_object_unref (mem);
        }
        
        return truth;
index 034905e..f682ee2 100644 (file)
@@ -702,7 +702,7 @@ set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guint32 s
        camel_folder_summary_touch(folder->summary);
        camel_folder_summary_info_free(folder->summary, info);
 
-       camel_object_trigger_event(CAMEL_OBJECT(folder), "message_changed", (char *) uid);
+       camel_object_trigger_event (folder, "message_changed", (char *) uid);
 }
 
 /**
@@ -779,7 +779,7 @@ set_message_user_flag(CamelFolder *folder, const char *uid, const char *name, gb
        if (camel_flag_set(&info->user_flags, name, value)) {
                info->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
                camel_folder_summary_touch(folder->summary);
-               camel_object_trigger_event(CAMEL_OBJECT(folder), "message_changed", (char *) uid);
+               camel_object_trigger_event (folder, "message_changed", (char *) uid);
        }
        camel_folder_summary_info_free(folder->summary, info);
 }
@@ -859,7 +859,7 @@ set_message_user_tag(CamelFolder *folder, const char *uid, const char *name, con
        if (camel_tag_set(&info->user_tags, name, value)) {
                info->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
                camel_folder_summary_touch(folder->summary);
-               camel_object_trigger_event(CAMEL_OBJECT(folder), "message_changed", (char *) uid);
+               camel_object_trigger_event (folder, "message_changed", (char *) uid);
        }
        camel_folder_summary_info_free(folder->summary, info);
 }
@@ -1289,7 +1289,7 @@ transfer_message_to (CamelFolder *source, const char *uid, CamelFolder *dest,
        }
        
        camel_folder_append_message (dest, msg, info, transferred_uid, ex);
-       camel_object_unref (CAMEL_OBJECT (msg));
+       camel_object_unref (msg);
        
        if (delete_original && !camel_exception_is_set (ex))
                camel_folder_set_message_flags (source, uid, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN, ~0);
@@ -1415,7 +1415,7 @@ camel_folder_delete (CamelFolder *folder)
 
        CAMEL_FOLDER_UNLOCK (folder, lock);
 
-       camel_object_trigger_event (CAMEL_OBJECT (folder), "deleted", NULL);
+       camel_object_trigger_event (folder, "deleted", NULL);
 }
 
 static void
@@ -1451,7 +1451,7 @@ camel_folder_rename(CamelFolder *folder, const char *new)
 
        CF_CLASS (folder)->rename(folder, new);
 
-       camel_object_trigger_event (CAMEL_OBJECT (folder), "renamed", old);
+       camel_object_trigger_event (folder, "renamed", old);
        g_free(old);
 }
 
@@ -1507,7 +1507,7 @@ thaw (CamelFolder * folder)
        CAMEL_FOLDER_UNLOCK(folder, change_lock);
 
        if (info) {
-               camel_object_trigger_event(CAMEL_OBJECT(folder), "folder_changed", info);
+               camel_object_trigger_event (folder, "folder_changed", info);
                camel_folder_change_info_free(info);
        }
 }
index 2ff8006..79c14d9 100644 (file)
@@ -297,7 +297,7 @@ gpg_ctx_new (CamelSession *session)
        gpg = g_new (struct _GpgCtx, 1);
        gpg->mode = GPG_CTX_MODE_SIGN;
        gpg->session = session;
-       camel_object_ref (CAMEL_OBJECT (session));
+       camel_object_ref (session);
        gpg->userid_hint = g_hash_table_new (g_str_hash, g_str_equal);
        gpg->complete = FALSE;
        gpg->seen_eof1 = TRUE;
@@ -411,18 +411,18 @@ gpg_ctx_set_armor (struct _GpgCtx *gpg, gboolean armor)
 static void
 gpg_ctx_set_istream (struct _GpgCtx *gpg, CamelStream *istream)
 {
-       camel_object_ref (CAMEL_OBJECT (istream));
+       camel_object_ref (istream);
        if (gpg->istream)
-               camel_object_unref (CAMEL_OBJECT (gpg->istream));
+               camel_object_unref (gpg->istream);
        gpg->istream = istream;
 }
 
 static void
 gpg_ctx_set_ostream (struct _GpgCtx *gpg, CamelStream *ostream)
 {
-       camel_object_ref (CAMEL_OBJECT (ostream));
+       camel_object_ref (ostream);
        if (gpg->ostream)
-               camel_object_unref (CAMEL_OBJECT (gpg->ostream));
+               camel_object_unref (gpg->ostream);
        gpg->ostream = ostream;
        gpg->seen_eof1 = FALSE;
 }
@@ -455,7 +455,7 @@ gpg_ctx_free (struct _GpgCtx *gpg)
        int i;
        
        if (gpg->session)
-               camel_object_unref (CAMEL_OBJECT (gpg->session));
+               camel_object_unref (gpg->session);
        
        g_hash_table_foreach (gpg->userid_hint, userid_hint_free, NULL);
        g_hash_table_destroy (gpg->userid_hint);
@@ -488,10 +488,10 @@ gpg_ctx_free (struct _GpgCtx *gpg)
                g_free (gpg->passwd);
        
        if (gpg->istream)
-               camel_object_unref (CAMEL_OBJECT (gpg->istream));
+               camel_object_unref (gpg->istream);
        
        if (gpg->ostream)
-               camel_object_unref (CAMEL_OBJECT (gpg->ostream));
+               camel_object_unref (gpg->ostream);
        
        camel_object_unref (gpg->diagnostics);
        
@@ -1349,7 +1349,8 @@ swrite (CamelStream *istream)
                if (ret != -1)
                        ret = camel_stream_close (ostream);
        }
-       camel_object_unref (CAMEL_OBJECT (ostream));
+       
+       camel_object_unref (ostream);
        
        if (ret == -1) {
                unlink (template);
index 40bf71f..b754422 100644 (file)
@@ -200,7 +200,7 @@ http_connect (CamelHttpStream *http, CamelURL *url)
        
        if (camel_tcp_stream_connect (CAMEL_TCP_STREAM (stream), host, url->port ? url->port : 80) == -1) {
                errsave = errno;
-               camel_object_unref (CAMEL_OBJECT (stream));
+               camel_object_unref (stream);
                camel_free_host (host);
                errno = errsave;
                return NULL;
@@ -280,7 +280,7 @@ http_get_headers (CamelHttpStream *http)
        int err;
        
        if (http->parser)
-               camel_object_unref (CAMEL_OBJECT (http->parser));
+               camel_object_unref (http->parser);
        
        http->parser = camel_mime_parser_new ();
        camel_mime_parser_init_with_stream (http->parser, http->read);
@@ -324,7 +324,7 @@ http_get_headers (CamelHttpStream *http)
        err = camel_mime_parser_errno (http->parser);
        
        if (err != 0) {
-               camel_object_unref (CAMEL_OBJECT (http->parser));
+               camel_object_unref (http->parser);
                http->parser = NULL;
                goto exception;
        }
index b3964f2..6a89682 100644 (file)
@@ -91,7 +91,7 @@ camel_medium_finalize (CamelObject *object)
        CamelMedium *medium = CAMEL_MEDIUM (object);
 
        if (medium->content)
-               camel_object_unref (CAMEL_OBJECT (medium->content));
+               camel_object_unref (medium->content);
 }
 
 
@@ -309,8 +309,8 @@ static void
 set_content_object (CamelMedium *medium, CamelDataWrapper *content)
 {
        if (medium->content)
-               camel_object_unref (CAMEL_OBJECT (medium->content));
-       camel_object_ref (CAMEL_OBJECT (content));
+               camel_object_unref (medium->content);
+       camel_object_ref (content);
        medium->content = content;
 }
 
index 1516527..3c6bf4b 100644 (file)
@@ -109,7 +109,7 @@ camel_mime_filter_save_new_with_stream (CamelStream *stream)
        CamelMimeFilterSave *save = CAMEL_MIME_FILTER_SAVE (camel_object_new (CAMEL_MIME_FILTER_SAVE_TYPE));
        
        save->stream = stream;
-       camel_object_ref (CAMEL_OBJECT (stream));
+       camel_object_ref (stream);
        
        return (CamelMimeFilter *) save;
 }
index b292e22..7f4ac93 100644 (file)
@@ -179,7 +179,7 @@ camel_mime_message_get_type (void)
 static void
 unref_recipient (gpointer key, gpointer value, gpointer user_data)
 {
-       camel_object_unref (CAMEL_OBJECT (value));
+       camel_object_unref (value);
 }
 
 CamelMimeMessage *
@@ -527,13 +527,13 @@ process_header (CamelMedium *medium, const char *name, const char *value)
        switch (header_type) {
        case HEADER_FROM:
                if (message->from)
-                       camel_object_unref (CAMEL_OBJECT (message->from));
+                       camel_object_unref (message->from);
                message->from = camel_internet_address_new ();
                camel_address_decode (CAMEL_ADDRESS (message->from), value);
                break;
        case HEADER_REPLY_TO:
                if (message->reply_to)
-                       camel_object_unref (CAMEL_OBJECT (message->reply_to));
+                       camel_object_unref (message->reply_to);
                message->reply_to = camel_internet_address_new ();
                camel_address_decode (CAMEL_ADDRESS (message->reply_to), value);
                break;
@@ -873,7 +873,7 @@ check_content_id (CamelMimeMessage *message, CamelMimePart *part, void *data)
        found = content_id && !strcmp (content_id, check->content_id) ? TRUE : FALSE;
        if (found) {
                check->part = part;
-               camel_object_ref (CAMEL_OBJECT (part));
+               camel_object_ref (part);
        }
        
        return !found;
index 80d6a6b..3a57a51 100644 (file)
@@ -901,12 +901,12 @@ camel_mime_part_set_content (CamelMimePart *camel_mime_part,
                camel_data_wrapper_set_mime_type (dw, type);
                stream = camel_stream_mem_new_with_buffer (data, length);
                camel_data_wrapper_construct_from_stream (dw, stream);
-               camel_object_unref (CAMEL_OBJECT (stream));
+               camel_object_unref (stream);
                camel_medium_set_content_object (medium, dw);
-               camel_object_unref (CAMEL_OBJECT (dw));
+               camel_object_unref (dw);
        } else {
                if (medium->content)
-                       camel_object_unref (CAMEL_OBJECT (medium->content));
+                       camel_object_unref (medium->content);
                medium->content = NULL;
        }
 }
index 6393e29..3ec6014 100644 (file)
@@ -147,7 +147,7 @@ camel_multipart_get_type (void)
 static void
 unref_part (gpointer data, gpointer user_data)
 {
-       CamelObject *part = CAMEL_OBJECT (data);
+       CamelObject *part = data;
 
        camel_object_unref (part);
 }
@@ -176,7 +176,7 @@ static void
 add_part (CamelMultipart *multipart, CamelMimePart *part)
 {
        multipart->parts = g_list_append (multipart->parts, part);
-       camel_object_ref (CAMEL_OBJECT (part));
+       camel_object_ref (part);
 }
 
 /**
@@ -200,7 +200,7 @@ static void
 add_part_at (CamelMultipart *multipart, CamelMimePart *part, guint index)
 {
        multipart->parts = g_list_insert (multipart->parts, part, index);
-       camel_object_ref (CAMEL_OBJECT (part));
+       camel_object_ref (part);
 }
 
 /**
@@ -230,7 +230,7 @@ remove_part (CamelMultipart *multipart, CamelMimePart *part)
        if (!multipart->parts)
                return;
        multipart->parts = g_list_remove (multipart->parts, part);
-       camel_object_unref (CAMEL_OBJECT (part));
+       camel_object_unref (part);
 }
 
 /**
@@ -272,7 +272,7 @@ remove_part_at (CamelMultipart *multipart, guint index)
 
        multipart->parts = g_list_remove_link (parts_list, part_to_remove);
        if (part_to_remove->data)
-               camel_object_unref (CAMEL_OBJECT (part_to_remove->data));
+               camel_object_unref (part_to_remove->data);
        g_list_free_1 (part_to_remove);
 
        return removed_part;
index 9032124..9b97fdb 100644 (file)
@@ -2,7 +2,7 @@
 /*
  *  Authors: Jeffrey Stedfast <fejj@ximian.com>
  *
- *  Copyright 2001 Ximian, Inc. (www.ximian.com)
+ *  Copyright 2001-2003 Ximian, Inc. (www.ximian.com)
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU General Public
@@ -20,6 +20,7 @@
  *
  */
 
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -29,6 +30,7 @@
 #include "camel-internet-address.h"
 #include <string.h>
 
+
 CamelServiceAuthType camel_sasl_anonymous_authtype = {
        N_("Anonymous"),
        
@@ -118,10 +120,10 @@ anon_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
                        camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
                                              _("Invalid email address trace information:\n%s"),
                                              sasl_anon->trace_info);
-                       camel_object_unref (CAMEL_OBJECT (cia));
+                       camel_object_unref (cia);
                        return NULL;
                }
-               camel_object_unref (CAMEL_OBJECT (cia));
+               camel_object_unref (cia);
                ret = g_byte_array_new ();
                g_byte_array_append (ret, sasl_anon->trace_info, strlen (sasl_anon->trace_info));
                break;
index 7f43561..24ee6e4 100644 (file)
@@ -2,7 +2,7 @@
 /*
  *  Authors: Jeffrey Stedfast <fejj@ximian.com>
  *
- *  Copyright 2001 Ximian, Inc. (www.ximian.com)
+ *  Copyright 2001-2003 Ximian, Inc. (www.ximian.com)
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU General Public
@@ -20,6 +20,7 @@
  *
  */
 
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -38,6 +39,7 @@
 #include "camel-sasl-popb4smtp.h"
 #include "camel-sasl-ntlm.h"
 
+
 #define w(x)
 
 static CamelObjectClass *parent_class = NULL;
@@ -60,8 +62,8 @@ static void
 camel_sasl_finalize (CamelSasl *sasl)
 {
        g_free (sasl->service_name);
-       g_free(sasl->mech);
-       camel_object_unref (CAMEL_OBJECT (sasl->service));
+       g_free (sasl->mech);
+       camel_object_unref (sasl->service);
 }
 
 CamelType
@@ -191,32 +193,32 @@ camel_sasl_new (const char *service_name, const char *mechanism, CamelService *s
        /* We don't do ANONYMOUS here, because it's a little bit weird. */
        
        if (!strcmp (mechanism, "CRAM-MD5"))
-               sasl = (CamelSasl *)camel_object_new (CAMEL_SASL_CRAM_MD5_TYPE);
+               sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_CRAM_MD5_TYPE);
        else if (!strcmp (mechanism, "DIGEST-MD5"))
-               sasl = (CamelSasl *)camel_object_new (CAMEL_SASL_DIGEST_MD5_TYPE);
+               sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_DIGEST_MD5_TYPE);
 #ifdef HAVE_KRB5
        else if (!strcmp (mechanism, "GSSAPI"))
-               sasl = (CamelSasl *)camel_object_new (CAMEL_SASL_GSSAPI_TYPE);
+               sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_GSSAPI_TYPE);
 #endif
 #ifdef HAVE_KRB4
        else if (!strcmp (mechanism, "KERBEROS_V4"))
-               sasl = (CamelSasl *)camel_object_new (CAMEL_SASL_KERBEROS4_TYPE);
+               sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_KERBEROS4_TYPE);
 #endif
        else if (!strcmp (mechanism, "PLAIN"))
-               sasl = (CamelSasl *)camel_object_new (CAMEL_SASL_PLAIN_TYPE);
+               sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_PLAIN_TYPE);
        else if (!strcmp (mechanism, "LOGIN"))
-               sasl = (CamelSasl *)camel_object_new (CAMEL_SASL_LOGIN_TYPE);
+               sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_LOGIN_TYPE);
        else if (!strcmp (mechanism, "POPB4SMTP"))
-               sasl = (CamelSasl *)camel_object_new (CAMEL_SASL_POPB4SMTP_TYPE);
+               sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_POPB4SMTP_TYPE);
        else if (!strcmp (mechanism, "NTLM"))
-               sasl = (CamelSasl *)camel_object_new (CAMEL_SASL_NTLM_TYPE);
+               sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_NTLM_TYPE);
        else
                return NULL;
 
-       sasl->mech = g_strdup(mechanism);
+       sasl->mech = g_strdup (mechanism);
        sasl->service_name = g_strdup (service_name);
        sasl->service = service;
-       camel_object_ref (CAMEL_OBJECT (service));
+       camel_object_ref (service);
        
        return sasl;
 }
index c456117..e92f4e0 100644 (file)
@@ -4,7 +4,7 @@
  * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
  *         Michael Zucchi <notzed@ximian.com>
  *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
+ * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU General Public
@@ -70,7 +70,7 @@ camel_seekable_substream_finalize (CamelObject *object)
                CAMEL_SEEKABLE_SUBSTREAM (object);
 
        if (seekable_substream->parent_stream)
-               camel_object_unref (CAMEL_OBJECT (seekable_substream->parent_stream));
+               camel_object_unref (seekable_substream->parent_stream);
 }
 
 
@@ -121,7 +121,7 @@ camel_seekable_substream_new(CamelSeekableStream *parent_stream, off_t start, of
 
        /* Initialize it. */
        seekable_substream->parent_stream = parent_stream;
-       camel_object_ref (CAMEL_OBJECT (parent_stream));
+       camel_object_ref (parent_stream);
 
        /* Set the bound of the substream. We can ignore any possible error
         * here, because if we fail to seek now, it will try again later.
index bc4f4d8..cd66bb9 100644 (file)
@@ -23,6 +23,7 @@
  * USA
  */
 
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -117,7 +118,7 @@ camel_service_finalize (CamelObject *object)
        if (service->url)
                camel_url_free (service->url);
        if (service->session)
-               camel_object_unref (CAMEL_OBJECT (service->session));
+               camel_object_unref (service->session);
        
        e_mutex_destroy (service->priv->connect_lock);
        e_mutex_destroy (service->priv->connect_op_lock);
@@ -299,7 +300,7 @@ construct (CamelService *service, CamelSession *session,
        service->provider = provider;
        service->url = url;
        service->session = session;
-       camel_object_ref (CAMEL_OBJECT (session));
+       camel_object_ref (session);
        
        service->status = CAMEL_SERVICE_DISCONNECTED;
 }
index 9d5fd7e..c4e369b 100644 (file)
@@ -497,7 +497,7 @@ camel_session_get_service_connected (CamelSession *session,
 
        if (svc->status != CAMEL_SERVICE_CONNECTED) {
                if (camel_service_connect (svc, ex) == FALSE) {
-                       camel_object_unref (CAMEL_OBJECT (svc));
+                       camel_object_unref (svc);
                        return NULL;
                }
        }
index dfd7ecd..3c87c83 100644 (file)
@@ -20,6 +20,8 @@
  *
  */
 
+/* Note: much of the NSS code was copied from Mozilla's cmsutil.c program */
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -380,7 +382,7 @@ smime_sign (CamelCMSContext *ctx, CamelMimeMessage *message,
        NSS_CMSEncoder_Update (ecx, buf->data, buf->len);
        NSS_CMSEncoder_Finish (ecx);
        
-       camel_object_unref (CAMEL_OBJECT (stream));
+       camel_object_unref (stream);
        g_free (data);
        
        /* write the result to a camel stream */
@@ -394,7 +396,7 @@ smime_sign (CamelCMSContext *ctx, CamelMimeMessage *message,
        mesg = camel_mime_message_new ();
        camel_stream_reset (stream);
        camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (mesg), stream);
-       camel_object_unref (CAMEL_OBJECT (stream));
+       camel_object_unref (stream);
        
        return mesg;
 }
@@ -495,7 +497,7 @@ smime_certsonly (CamelCMSContext *ctx, CamelMimeMessage *message,
        NSS_CMSEncoder_Update (ecx, buf->data, buf->len);
        NSS_CMSEncoder_Finish (ecx);
        
-       camel_object_unref (CAMEL_OBJECT (stream));
+       camel_object_unref (stream);
        g_free (data);
        
        /* write the result to a camel stream */
@@ -509,7 +511,7 @@ smime_certsonly (CamelCMSContext *ctx, CamelMimeMessage *message,
        mesg = camel_mime_message_new ();
        camel_stream_reset (stream);
        camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (mesg), stream);
-       camel_object_unref (CAMEL_OBJECT (stream));
+       camel_object_unref (stream);
        
        return mesg;
 }
@@ -618,7 +620,7 @@ smime_envelope (CamelCMSContext *ctx, CamelMimeMessage *message,
        NSS_CMSEncoder_Update (ecx, buf->data, buf->len);
        NSS_CMSEncoder_Finish (ecx);
        
-       camel_object_unref (CAMEL_OBJECT (stream));
+       camel_object_unref (stream);
        g_free (data);
        
        /* write the result to a camel stream */
@@ -632,7 +634,7 @@ smime_envelope (CamelCMSContext *ctx, CamelMimeMessage *message,
        mesg = camel_mime_message_new ();
        camel_stream_reset (stream);
        camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (mesg), stream);
-       camel_object_unref (CAMEL_OBJECT (stream));
+       camel_object_unref (stream);
        
        return mesg;
 }
@@ -747,14 +749,14 @@ smime_encrypt (CamelCMSContext *ctx, CamelMimeMessage *message,
        stream = camel_stream_mem_new ();
        camel_stream_mem_set_byte_array (CAMEL_STREAM_MEM (stream), buf);
        camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), stream);
-       camel_object_unref (CAMEL_OBJECT (stream));
+       camel_object_unref (stream);
        
        stream = camel_stream_mem_new ();
        cmsg = encrypted_data (CAMEL_SMIME_CONTEXT (ctx), buf, bulkkey, stream, ex);
        g_byte_array_free (buf, TRUE);
        g_free (bulkkey);
        if (!cmsg) {
-               camel_object_unref (CAMEL_OBJECT (stream));
+               camel_object_unref (stream);
                return NULL;
        }
        
@@ -764,7 +766,7 @@ smime_encrypt (CamelCMSContext *ctx, CamelMimeMessage *message,
        mesg = camel_mime_message_new ();
        camel_stream_reset (stream);
        camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (mesg), stream);
-       camel_object_unref (CAMEL_OBJECT (stream));
+       camel_object_unref (stream);
        
        return mesg;
 }
@@ -933,9 +935,9 @@ smime_decode (CamelCMSContext *ctx, CamelMimeMessage *message,
        
        ostream = camel_stream_mem_new ();
        cmsg = decode_data (CAMEL_SMIME_CONTEXT (ctx), buf, ostream, info, ex);
-       camel_object_unref (CAMEL_OBJECT (stream));
+       camel_object_unref (stream);
        if (!cmsg) {
-               camel_object_unref (CAMEL_OBJECT (ostream));
+               camel_object_unref (ostream);
                return NULL;
        }
        
@@ -943,7 +945,7 @@ smime_decode (CamelCMSContext *ctx, CamelMimeMessage *message,
        mesg = camel_mime_message_new ();
        camel_stream_reset (ostream);
        camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (mesg), ostream);
-       camel_object_unref (CAMEL_OBJECT (ostream));
+       camel_object_unref (ostream);
        
        return mesg;
 }
index 3c49f31..96d840d 100644 (file)
@@ -424,7 +424,7 @@ camel_store_rename_folder (CamelStore *store, const char *old_name, const char *
                reninfo.old_base = (char *)old_name;
                reninfo.new = ((CamelStoreClass *)((CamelObject *)store)->klass)->get_folder_info(store, new_name, flags, ex);
                if (reninfo.new != NULL) {
-                       camel_object_trigger_event(CAMEL_OBJECT(store), "folder_renamed", &reninfo);
+                       camel_object_trigger_event (store, "folder_renamed", &reninfo);
                        ((CamelStoreClass *)((CamelObject *)store)->klass)->free_folder_info(store, reninfo.new);
                }
        } else {
@@ -490,7 +490,7 @@ init_trash (CamelStore *store)
        if (store->vtrash) {
                /* FIXME: this should probably use the object bag or another one ? ... */
                /* attach to the finalise event of the vtrash */
-               camel_object_hook_event (CAMEL_OBJECT (store->vtrash), "finalize",
+               camel_object_hook_event (store->vtrash, "finalize",
                                         trash_finalize, store);
                
                /* add all the pre-opened folders to the vtrash */
@@ -512,14 +512,14 @@ static CamelFolder *
 get_trash (CamelStore *store, CamelException *ex)
 {
        if (store->vtrash) {
-               camel_object_ref (CAMEL_OBJECT (store->vtrash));
+               camel_object_ref (store->vtrash);
                return store->vtrash;
        } else {
                CS_CLASS (store)->init_trash (store);
                if (store->vtrash) {
                        /* We don't ref here because we don't want the
                            store to own a ref on the trash folder */
-                       /*camel_object_ref (CAMEL_OBJECT (store->vtrash));*/
+                       /*camel_object_ref (store->vtrash);*/
                        return store->vtrash;
                } else {
                        w(g_warning ("This store does not support vTrash."));
index e8b0526..8051441 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Authors: Michael Zucchi <notzed@ximian.com>
  *
- * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
+ * Copyright 1999-2003 Ximian, Inc. (www.ximian.com)
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU General Public
@@ -93,7 +93,7 @@ camel_stream_buffer_finalize (CamelObject *object)
                g_free(sbf->buf);
        }
        if (sbf->stream)
-               camel_object_unref(CAMEL_OBJECT(sbf->stream));
+               camel_object_unref (sbf->stream);
 
        g_free(sbf->linebuf);
 }
@@ -140,9 +140,9 @@ init_vbuf(CamelStreamBuffer *sbf, CamelStream *s, CamelStreamBufferMode mode, ch
 {
        set_vbuf(sbf, buf, mode, size);
        if (sbf->stream)
-               camel_object_unref(CAMEL_OBJECT(sbf->stream));
+               camel_object_unref (sbf->stream);
        sbf->stream = s;
-       camel_object_ref(CAMEL_OBJECT(sbf->stream));
+       camel_object_ref (sbf->stream);
 }
 
 static void