[gmime: 1/2] Use g_object_new instead of g_object_newv
- From: Jeffrey Stedfast <fejj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gmime: 1/2] Use g_object_new instead of g_object_newv
- Date: Sat, 1 Apr 2017 15:01:07 +0000 (UTC)
commit 8454d1be208d849c7687561eab89c92b912072f1
Author: Jeffrey Stedfast <jestedfa microsoft com>
Date: Sat Apr 1 10:57:31 2017 -0400
Use g_object_new instead of g_object_newv
gmime/gmime-application-pkcs7-mime.c | 2 +-
gmime/gmime-certificate.c | 4 ++--
gmime/gmime-content-type.c | 4 ++--
gmime/gmime-crypto-context.c | 2 +-
gmime/gmime-data-wrapper.c | 2 +-
gmime/gmime-disposition.c | 4 ++--
gmime/gmime-filter-basic.c | 2 +-
gmime/gmime-filter-best.c | 10 +++++-----
gmime/gmime-filter-charset.c | 12 ++++++------
gmime/gmime-filter-checksum.c | 4 ++--
gmime/gmime-filter-dos2unix.c | 2 +-
gmime/gmime-filter-enriched.c | 8 ++++----
gmime/gmime-filter-from.c | 12 ++++++------
gmime/gmime-filter-gzip.c | 16 ++++++++--------
gmime/gmime-filter-html.c | 2 +-
gmime/gmime-filter-smtp-data.c | 2 +-
gmime/gmime-filter-strip.c | 2 +-
gmime/gmime-filter-unix2dos.c | 2 +-
gmime/gmime-filter-windows.c | 2 +-
gmime/gmime-filter-yenc.c | 2 +-
gmime/gmime-gpg-context.c | 2 +-
gmime/gmime-header.c | 4 ++--
gmime/gmime-message-part.c | 4 ++--
gmime/gmime-message-partial.c | 14 +++++++-------
gmime/gmime-message.c | 2 +-
gmime/gmime-multipart-encrypted.c | 2 +-
gmime/gmime-multipart-signed.c | 4 ++--
gmime/gmime-multipart.c | 19 ++++---------------
gmime/gmime-object.c | 4 ++--
gmime/gmime-param.c | 4 ++--
gmime/gmime-parser.c | 2 +-
gmime/gmime-part.c | 15 +++------------
gmime/gmime-pkcs7-context.c | 2 +-
gmime/gmime-signature.c | 4 ++--
gmime/gmime-stream-buffer.c | 4 ++--
gmime/gmime-stream-cat.c | 6 +++---
gmime/gmime-stream-file.c | 20 ++++++++++----------
gmime/gmime-stream-filter.c | 4 ++--
gmime/gmime-stream-fs.c | 14 +++++++-------
gmime/gmime-stream-gio.c | 14 +++++++-------
gmime/gmime-stream-mem.c | 20 ++++++++------------
gmime/gmime-stream-mmap.c | 16 +++++++---------
gmime/gmime-stream-null.c | 4 ++--
gmime/gmime-stream-pipe.c | 14 +++++++++++---
gmime/gmime-text-part.c | 8 ++++----
gmime/internet-address.c | 6 +++---
46 files changed, 145 insertions(+), 163 deletions(-)
---
diff --git a/gmime/gmime-application-pkcs7-mime.c b/gmime/gmime-application-pkcs7-mime.c
index a0816bb..74db382 100644
--- a/gmime/gmime-application-pkcs7-mime.c
+++ b/gmime/gmime-application-pkcs7-mime.c
@@ -149,7 +149,7 @@ g_mime_application_pkcs7_mime_new (GMimeSecureMimeType type)
g_return_val_if_fail (type != GMIME_SECURE_MIME_TYPE_UNKNOWN, NULL);
- pkcs7_mime = g_object_newv (GMIME_TYPE_APPLICATION_PKCS7_MIME, 0, NULL);
+ pkcs7_mime = g_object_new (GMIME_TYPE_APPLICATION_PKCS7_MIME, NULL);
content_type = g_mime_content_type_new ("application", "pkcs7-mime");
switch (type) {
diff --git a/gmime/gmime-certificate.c b/gmime/gmime-certificate.c
index cd4adc9..5687174 100644
--- a/gmime/gmime-certificate.c
+++ b/gmime/gmime-certificate.c
@@ -122,7 +122,7 @@ g_mime_certificate_finalize (GObject *object)
GMimeCertificate *
g_mime_certificate_new (void)
{
- return g_object_newv (GMIME_TYPE_CERTIFICATE, 0, NULL);
+ return g_object_new (GMIME_TYPE_CERTIFICATE, NULL);
}
@@ -571,7 +571,7 @@ g_mime_certificate_list_finalize (GObject *object)
GMimeCertificateList *
g_mime_certificate_list_new (void)
{
- return g_object_newv (GMIME_TYPE_CERTIFICATE_LIST, 0, NULL);
+ return g_object_new (GMIME_TYPE_CERTIFICATE_LIST, NULL);
}
diff --git a/gmime/gmime-content-type.c b/gmime/gmime-content-type.c
index c44dc48..3891ad3 100644
--- a/gmime/gmime-content-type.c
+++ b/gmime/gmime-content-type.c
@@ -144,7 +144,7 @@ g_mime_content_type_new (const char *type, const char *subtype)
{
GMimeContentType *content_type;
- content_type = g_object_newv (GMIME_TYPE_CONTENT_TYPE, 0, NULL);
+ content_type = g_object_new (GMIME_TYPE_CONTENT_TYPE, NULL);
if (type && *type && subtype && *subtype) {
content_type->type = g_strdup (type);
@@ -197,7 +197,7 @@ g_mime_content_type_parse (GMimeParserOptions *options, const char *str)
if (!g_mime_parse_content_type (&inptr, &type, &subtype))
return g_mime_content_type_new ("application", "octet-stream");
- content_type = g_object_newv (GMIME_TYPE_CONTENT_TYPE, 0, NULL);
+ content_type = g_object_new (GMIME_TYPE_CONTENT_TYPE, NULL);
content_type->subtype = subtype;
content_type->type = type;
diff --git a/gmime/gmime-crypto-context.c b/gmime/gmime-crypto-context.c
index 29b12d4..16ca934 100644
--- a/gmime/gmime-crypto-context.c
+++ b/gmime/gmime-crypto-context.c
@@ -668,7 +668,7 @@ g_mime_decrypt_result_finalize (GObject *object)
GMimeDecryptResult *
g_mime_decrypt_result_new (void)
{
- return g_object_newv (GMIME_TYPE_DECRYPT_RESULT, 0, NULL);
+ return g_object_new (GMIME_TYPE_DECRYPT_RESULT, NULL);
}
diff --git a/gmime/gmime-data-wrapper.c b/gmime/gmime-data-wrapper.c
index 0381fd7..07f7a7d 100644
--- a/gmime/gmime-data-wrapper.c
+++ b/gmime/gmime-data-wrapper.c
@@ -117,7 +117,7 @@ g_mime_data_wrapper_finalize (GObject *object)
GMimeDataWrapper *
g_mime_data_wrapper_new (void)
{
- return g_object_newv (GMIME_TYPE_DATA_WRAPPER, 0, NULL);
+ return g_object_new (GMIME_TYPE_DATA_WRAPPER, NULL);
}
diff --git a/gmime/gmime-disposition.c b/gmime/gmime-disposition.c
index 253afd4..1c3c1e6 100644
--- a/gmime/gmime-disposition.c
+++ b/gmime/gmime-disposition.c
@@ -129,7 +129,7 @@ g_mime_content_disposition_new (void)
{
GMimeContentDisposition *disposition;
- disposition = g_object_newv (GMIME_TYPE_CONTENT_DISPOSITION, 0, NULL);
+ disposition = g_object_new (GMIME_TYPE_CONTENT_DISPOSITION, NULL);
disposition->disposition = g_strdup (GMIME_DISPOSITION_ATTACHMENT);
return disposition;
@@ -156,7 +156,7 @@ g_mime_content_disposition_parse (GMimeParserOptions *options, const char *str)
if (str == NULL)
return g_mime_content_disposition_new ();
- disposition = g_object_newv (GMIME_TYPE_CONTENT_DISPOSITION, 0, NULL);
+ disposition = g_object_new (GMIME_TYPE_CONTENT_DISPOSITION, NULL);
/* get content disposition part */
diff --git a/gmime/gmime-filter-basic.c b/gmime/gmime-filter-basic.c
index 541a85f..f179fb6 100644
--- a/gmime/gmime-filter-basic.c
+++ b/gmime/gmime-filter-basic.c
@@ -245,7 +245,7 @@ g_mime_filter_basic_new (GMimeContentEncoding encoding, gboolean encode)
{
GMimeFilterBasic *basic;
- basic = g_object_newv (GMIME_TYPE_FILTER_BASIC, 0, NULL);
+ basic = g_object_new (GMIME_TYPE_FILTER_BASIC, NULL);
if (encode)
g_mime_encoding_init_encode (&basic->encoder, encoding);
diff --git a/gmime/gmime-filter-best.c b/gmime/gmime-filter-best.c
index 64dc96d..208bf2f 100644
--- a/gmime/gmime-filter-best.c
+++ b/gmime/gmime-filter-best.c
@@ -243,13 +243,13 @@ filter_reset (GMimeFilter *filter)
GMimeFilter *
g_mime_filter_best_new (GMimeFilterBestFlags flags)
{
- GMimeFilterBest *new;
+ GMimeFilterBest *best;
- new = g_object_newv (GMIME_TYPE_FILTER_BEST, 0, NULL);
- new->flags = flags;
- filter_reset ((GMimeFilter *) new);
+ best = g_object_new (GMIME_TYPE_FILTER_BEST, NULL);
+ best->flags = flags;
+ filter_reset ((GMimeFilter *) best);
- return (GMimeFilter *) new;
+ return (GMimeFilter *) best;
}
diff --git a/gmime/gmime-filter-charset.c b/gmime/gmime-filter-charset.c
index 2fcf487..b53a176 100644
--- a/gmime/gmime-filter-charset.c
+++ b/gmime/gmime-filter-charset.c
@@ -304,17 +304,17 @@ filter_reset (GMimeFilter *filter)
GMimeFilter *
g_mime_filter_charset_new (const char *from_charset, const char *to_charset)
{
- GMimeFilterCharset *new;
+ GMimeFilterCharset *charset;
iconv_t cd;
cd = g_mime_iconv_open (to_charset, from_charset);
if (cd == (iconv_t) -1)
return NULL;
- new = g_object_newv (GMIME_TYPE_FILTER_CHARSET, 0, NULL);
- new->from_charset = g_strdup (from_charset);
- new->to_charset = g_strdup (to_charset);
- new->cd = cd;
+ charset = g_object_new (GMIME_TYPE_FILTER_CHARSET, NULL);
+ charset->from_charset = g_strdup (from_charset);
+ charset->to_charset = g_strdup (to_charset);
+ charset->cd = cd;
- return (GMimeFilter *) new;
+ return (GMimeFilter *) charset;
}
diff --git a/gmime/gmime-filter-checksum.c b/gmime/gmime-filter-checksum.c
index 9c21356..be3b4f5 100644
--- a/gmime/gmime-filter-checksum.c
+++ b/gmime/gmime-filter-checksum.c
@@ -115,7 +115,7 @@ filter_copy (GMimeFilter *filter)
GChecksum *checksum = ((GMimeFilterChecksum *) filter)->checksum;
GMimeFilterChecksum *copy;
- copy = g_object_newv (GMIME_TYPE_FILTER_CHECKSUM, 0, NULL);
+ copy = g_object_new (GMIME_TYPE_FILTER_CHECKSUM, NULL);
copy->checksum = checksum ? g_checksum_copy (checksum) : NULL;
return (GMimeFilter *) copy;
@@ -164,7 +164,7 @@ g_mime_filter_checksum_new (GChecksumType type)
{
GMimeFilterChecksum *checksum;
- checksum = g_object_newv (GMIME_TYPE_FILTER_CHECKSUM, 0, NULL);
+ checksum = g_object_new (GMIME_TYPE_FILTER_CHECKSUM, NULL);
checksum->checksum = g_checksum_new (type);
return (GMimeFilter *) checksum;
diff --git a/gmime/gmime-filter-dos2unix.c b/gmime/gmime-filter-dos2unix.c
index 9d7e6e0..62e51b2 100644
--- a/gmime/gmime-filter-dos2unix.c
+++ b/gmime/gmime-filter-dos2unix.c
@@ -181,7 +181,7 @@ g_mime_filter_dos2unix_new (gboolean ensure_newline)
{
GMimeFilterDos2Unix *dos2unix;
- dos2unix = g_object_newv (GMIME_TYPE_FILTER_DOS2UNIX, 0, NULL);
+ dos2unix = g_object_new (GMIME_TYPE_FILTER_DOS2UNIX, NULL);
dos2unix->ensure_newline = ensure_newline;
return (GMimeFilter *) dos2unix;
diff --git a/gmime/gmime-filter-enriched.c b/gmime/gmime-filter-enriched.c
index 4638328..88f643f 100644
--- a/gmime/gmime-filter-enriched.c
+++ b/gmime/gmime-filter-enriched.c
@@ -602,10 +602,10 @@ filter_reset (GMimeFilter *filter)
GMimeFilter *
g_mime_filter_enriched_new (guint32 flags)
{
- GMimeFilterEnriched *new;
+ GMimeFilterEnriched *enriched;
- new = g_object_newv (GMIME_TYPE_FILTER_ENRICHED, 0, NULL);
- new->flags = flags;
+ enriched = g_object_new (GMIME_TYPE_FILTER_ENRICHED, NULL);
+ enriched->flags = flags;
- return (GMimeFilter *) new;
+ return (GMimeFilter *) enriched;
}
diff --git a/gmime/gmime-filter-from.c b/gmime/gmime-filter-from.c
index 34d87aa..97af72b 100644
--- a/gmime/gmime-filter-from.c
+++ b/gmime/gmime-filter-from.c
@@ -250,19 +250,19 @@ filter_reset (GMimeFilter *filter)
GMimeFilter *
g_mime_filter_from_new (GMimeFilterFromMode mode)
{
- GMimeFilterFrom *new;
+ GMimeFilterFrom *from;
- new = g_object_newv (GMIME_TYPE_FILTER_FROM, 0, NULL);
- new->midline = FALSE;
+ from = g_object_new (GMIME_TYPE_FILTER_FROM, NULL);
+ from->midline = FALSE;
switch (mode) {
case GMIME_FILTER_FROM_MODE_ARMOR:
- new->mode = mode;
+ from->mode = mode;
break;
case GMIME_FILTER_FROM_MODE_ESCAPE:
default:
- new->mode = GMIME_FILTER_FROM_MODE_ESCAPE;
+ from->mode = GMIME_FILTER_FROM_MODE_ESCAPE;
break;
}
- return (GMimeFilter *) new;
+ return (GMimeFilter *) from;
}
diff --git a/gmime/gmime-filter-gzip.c b/gmime/gmime-filter-gzip.c
index e1b4f8e..ddc5ebf 100644
--- a/gmime/gmime-filter-gzip.c
+++ b/gmime/gmime-filter-gzip.c
@@ -503,22 +503,22 @@ filter_reset (GMimeFilter *filter)
GMimeFilter *
g_mime_filter_gzip_new (GMimeFilterGZipMode mode, int level)
{
- GMimeFilterGZip *new;
+ GMimeFilterGZip *gzip;
int retval;
- new = g_object_newv (GMIME_TYPE_FILTER_GZIP, 0, NULL);
- new->mode = mode;
- new->level = level;
+ gzip = g_object_new (GMIME_TYPE_FILTER_GZIP, NULL);
+ gzip->mode = mode;
+ gzip->level = level;
if (mode == GMIME_FILTER_GZIP_MODE_ZIP)
- retval = deflateInit2 (new->priv->stream, level, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL,
Z_DEFAULT_STRATEGY);
+ retval = deflateInit2 (gzip->priv->stream, level, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL,
Z_DEFAULT_STRATEGY);
else
- retval = inflateInit2 (new->priv->stream, -MAX_WBITS);
+ retval = inflateInit2 (gzip->priv->stream, -MAX_WBITS);
if (retval != Z_OK) {
- g_object_unref (new);
+ g_object_unref (gzip);
return NULL;
}
- return (GMimeFilter *) new;
+ return (GMimeFilter *) gzip;
}
diff --git a/gmime/gmime-filter-html.c b/gmime/gmime-filter-html.c
index 309afab..4221132 100644
--- a/gmime/gmime-filter-html.c
+++ b/gmime/gmime-filter-html.c
@@ -568,7 +568,7 @@ g_mime_filter_html_new (guint32 flags, guint32 colour)
GMimeFilterHTML *filter;
guint i;
- filter = g_object_newv (GMIME_TYPE_FILTER_HTML, 0, NULL);
+ filter = g_object_new (GMIME_TYPE_FILTER_HTML, NULL);
filter->flags = flags;
filter->colour = colour;
diff --git a/gmime/gmime-filter-smtp-data.c b/gmime/gmime-filter-smtp-data.c
index bb8dc15..ed5593e 100644
--- a/gmime/gmime-filter-smtp-data.c
+++ b/gmime/gmime-filter-smtp-data.c
@@ -163,5 +163,5 @@ filter_reset (GMimeFilter *filter)
GMimeFilter *
g_mime_filter_smtp_data_new (void)
{
- return g_object_newv (GMIME_TYPE_FILTER_SMTP_DATA, 0, NULL);
+ return g_object_new (GMIME_TYPE_FILTER_SMTP_DATA, NULL);
}
diff --git a/gmime/gmime-filter-strip.c b/gmime/gmime-filter-strip.c
index 5b0c964..314c602 100644
--- a/gmime/gmime-filter-strip.c
+++ b/gmime/gmime-filter-strip.c
@@ -213,5 +213,5 @@ filter_reset (GMimeFilter *filter)
GMimeFilter *
g_mime_filter_strip_new (void)
{
- return g_object_newv (GMIME_TYPE_FILTER_STRIP, 0, NULL);
+ return g_object_new (GMIME_TYPE_FILTER_STRIP, NULL);
}
diff --git a/gmime/gmime-filter-unix2dos.c b/gmime/gmime-filter-unix2dos.c
index f1d6865..65223e6 100644
--- a/gmime/gmime-filter-unix2dos.c
+++ b/gmime/gmime-filter-unix2dos.c
@@ -181,7 +181,7 @@ g_mime_filter_unix2dos_new (gboolean ensure_newline)
{
GMimeFilterUnix2Dos *unix2dos;
- unix2dos = g_object_newv (GMIME_TYPE_FILTER_UNIX2DOS, 0, NULL);
+ unix2dos = g_object_new (GMIME_TYPE_FILTER_UNIX2DOS, NULL);
unix2dos->ensure_newline = ensure_newline;
return (GMimeFilter *) unix2dos;
diff --git a/gmime/gmime-filter-windows.c b/gmime/gmime-filter-windows.c
index ab2ecd2..a4b0065 100644
--- a/gmime/gmime-filter-windows.c
+++ b/gmime/gmime-filter-windows.c
@@ -185,7 +185,7 @@ g_mime_filter_windows_new (const char *claimed_charset)
g_return_val_if_fail (claimed_charset != NULL, NULL);
- new = g_object_newv (GMIME_TYPE_FILTER_WINDOWS, 0, NULL);
+ new = g_object_new (GMIME_TYPE_FILTER_WINDOWS, NULL);
new->claimed_charset = g_strdup (claimed_charset);
return (GMimeFilter *) new;
diff --git a/gmime/gmime-filter-yenc.c b/gmime/gmime-filter-yenc.c
index 41bfd72..8d406f0 100644
--- a/gmime/gmime-filter-yenc.c
+++ b/gmime/gmime-filter-yenc.c
@@ -282,7 +282,7 @@ g_mime_filter_yenc_new (gboolean encode)
{
GMimeFilterYenc *new;
- new = g_object_newv (GMIME_TYPE_FILTER_YENC, 0, NULL);
+ new = g_object_new (GMIME_TYPE_FILTER_YENC, NULL);
new->encode = encode;
if (encode)
diff --git a/gmime/gmime-gpg-context.c b/gmime/gmime-gpg-context.c
index 175191c..31c9ffa 100644
--- a/gmime/gmime-gpg-context.c
+++ b/gmime/gmime-gpg-context.c
@@ -407,7 +407,7 @@ g_mime_gpg_context_new (void)
if (gpgme_new (&ctx) != GPG_ERR_NO_ERROR)
return NULL;
- gpg = g_object_newv (GMIME_TYPE_GPG_CONTEXT, 0, NULL);
+ gpg = g_object_new (GMIME_TYPE_GPG_CONTEXT, NULL);
gpgme_set_protocol (ctx, GPGME_PROTOCOL_OpenPGP);
gpgme_set_armor (ctx, TRUE);
gpg->ctx = ctx;
diff --git a/gmime/gmime-header.c b/gmime/gmime-header.c
index a83b8a5..49768e4 100644
--- a/gmime/gmime-header.c
+++ b/gmime/gmime-header.c
@@ -169,7 +169,7 @@ g_mime_header_new (GMimeParserOptions *options, const char *name, const char *va
GMimeHeader *header;
guint i;
- header = g_object_newv (GMIME_TYPE_HEADER, 0, NULL);
+ header = g_object_new (GMIME_TYPE_HEADER, NULL);
header->raw_value = raw_value ? g_strdup (raw_value) : NULL;
header->value = value ? g_strdup (value) : NULL;
header->raw_name = g_strdup (raw_name);
@@ -1039,7 +1039,7 @@ g_mime_header_list_new (GMimeParserOptions *options)
{
GMimeHeaderList *headers;
- headers = g_object_newv (GMIME_TYPE_HEADER_LIST, 0, NULL);
+ headers = g_object_new (GMIME_TYPE_HEADER_LIST, NULL);
headers->options = g_mime_parser_options_clone (options);
return headers;
diff --git a/gmime/gmime-message-part.c b/gmime/gmime-message-part.c
index 38ce5b7..eae283b 100644
--- a/gmime/gmime-message-part.c
+++ b/gmime/gmime-message-part.c
@@ -190,10 +190,10 @@ g_mime_message_part_new (const char *subtype)
GMimeContentType *content_type;
GMimeMessagePart *part;
- part = g_object_newv (GMIME_TYPE_MESSAGE_PART, 0, NULL);
+ part = g_object_new (GMIME_TYPE_MESSAGE_PART, NULL);
content_type = g_mime_content_type_new ("message", subtype ? subtype : "rfc822");
- g_mime_object_set_content_type (GMIME_OBJECT (part), content_type);
+ g_mime_object_set_content_type ((GMimeObject *) part, content_type);
g_object_unref (content_type);
return part;
diff --git a/gmime/gmime-message-partial.c b/gmime/gmime-message-partial.c
index 570fb14..08effd5 100644
--- a/gmime/gmime-message-partial.c
+++ b/gmime/gmime-message-partial.c
@@ -148,7 +148,7 @@ g_mime_message_partial_new (const char *id, int number, int total)
GMimeMessagePartial *partial;
char *num;
- partial = g_object_newv (GMIME_TYPE_MESSAGE_PARTIAL, 0, NULL);
+ partial = g_object_new (GMIME_TYPE_MESSAGE_PARTIAL, NULL);
content_type = g_mime_content_type_new ("message", "partial");
@@ -165,7 +165,7 @@ g_mime_message_partial_new (const char *id, int number, int total)
g_mime_content_type_set_parameter (content_type, "total", num);
g_free (num);
- g_mime_object_set_content_type (GMIME_OBJECT (partial), content_type);
+ g_mime_object_set_content_type ((GMimeObject *) partial, content_type);
g_object_unref (content_type);
return partial;
@@ -294,11 +294,11 @@ g_mime_message_partial_reconstruct_message (GMimeMessagePartial **partials, size
if ((size_t) number != i + 1)
goto exception;
- wrapper = g_mime_part_get_content (GMIME_PART (partial));
+ wrapper = g_mime_part_get_content ((GMimePart *) partial);
stream = g_mime_data_wrapper_get_stream (wrapper);
g_mime_stream_reset (stream);
- g_mime_stream_cat_add_source (GMIME_STREAM_CAT (cat), stream);
+ g_mime_stream_cat_add_source ((GMimeStreamCat *) cat, stream);
}
parser = g_mime_parser_new ();
@@ -432,14 +432,14 @@ g_mime_message_partial_split_message (GMimeMessage *message, size_t max_size, si
for (i = 0; i < parts->len; i++) {
partial = g_mime_message_partial_new (id, i + 1, parts->len);
- wrapper = g_mime_data_wrapper_new_with_stream (GMIME_STREAM (parts->pdata[i]),
+ wrapper = g_mime_data_wrapper_new_with_stream ((GMimeStream *) parts->pdata[i],
GMIME_CONTENT_ENCODING_DEFAULT);
g_object_unref (parts->pdata[i]);
- g_mime_part_set_content (GMIME_PART (partial), wrapper);
+ g_mime_part_set_content ((GMimePart *) partial, wrapper);
g_object_unref (wrapper);
parts->pdata[i] = message_partial_message_new (message);
- g_mime_message_set_mime_part (GMIME_MESSAGE (parts->pdata[i]), GMIME_OBJECT (partial));
+ g_mime_message_set_mime_part ((GMimeMessage *) parts->pdata[i], (GMimeObject *) partial);
g_object_unref (partial);
}
diff --git a/gmime/gmime-message.c b/gmime/gmime-message.c
index 639f4fe..752e5a2 100644
--- a/gmime/gmime-message.c
+++ b/gmime/gmime-message.c
@@ -616,7 +616,7 @@ g_mime_message_new (gboolean pretty_headers)
GMimeMessage *message;
guint i;
- message = g_object_newv (GMIME_TYPE_MESSAGE, 0, NULL);
+ message = g_object_new (GMIME_TYPE_MESSAGE, NULL);
if (pretty_headers) {
/* Populate with the "standard" rfc822 headers so we can have a standard order */
diff --git a/gmime/gmime-multipart-encrypted.c b/gmime/gmime-multipart-encrypted.c
index 5570367..97c84db 100644
--- a/gmime/gmime-multipart-encrypted.c
+++ b/gmime/gmime-multipart-encrypted.c
@@ -127,7 +127,7 @@ g_mime_multipart_encrypted_new (void)
GMimeMultipartEncrypted *multipart;
GMimeContentType *content_type;
- multipart = g_object_newv (GMIME_TYPE_MULTIPART_ENCRYPTED, 0, NULL);
+ multipart = g_object_new (GMIME_TYPE_MULTIPART_ENCRYPTED, NULL);
content_type = g_mime_content_type_new ("multipart", "encrypted");
g_mime_object_set_content_type ((GMimeObject *) multipart, content_type);
diff --git a/gmime/gmime-multipart-signed.c b/gmime/gmime-multipart-signed.c
index b269eb6..5913c10 100644
--- a/gmime/gmime-multipart-signed.c
+++ b/gmime/gmime-multipart-signed.c
@@ -141,7 +141,7 @@ g_mime_multipart_signed_new (void)
GMimeMultipartSigned *multipart;
GMimeContentType *content_type;
- multipart = g_object_newv (GMIME_TYPE_MULTIPART_SIGNED, 0, NULL);
+ multipart = g_object_new (GMIME_TYPE_MULTIPART_SIGNED, NULL);
content_type = g_mime_content_type_new ("multipart", "signed");
g_mime_object_set_content_type ((GMimeObject *) multipart, content_type);
@@ -389,7 +389,7 @@ g_mime_multipart_signed_verify (GMimeMultipartSigned *mps, GMimeVerifyFlags flag
return NULL;
}
- if (!(protocol = g_mime_object_get_content_type_parameter (GMIME_OBJECT (mps), "protocol"))) {
+ if (!(protocol = g_mime_object_get_content_type_parameter ((GMimeObject *) mps, "protocol"))) {
g_set_error_literal (err, GMIME_ERROR, GMIME_ERROR_PROTOCOL_ERROR,
_("Cannot verify multipart/signed part: unspecified signature
protocol."));
diff --git a/gmime/gmime-multipart.c b/gmime/gmime-multipart.c
index b2c614e..8c23cff 100644
--- a/gmime/gmime-multipart.c
+++ b/gmime/gmime-multipart.c
@@ -254,18 +254,7 @@ multipart_encode (GMimeObject *object, GMimeEncodingConstraint constraint)
GMimeMultipart *
g_mime_multipart_new (void)
{
- GMimeContentType *content_type;
- GMimeMultipart *multipart;
-
- multipart = g_object_newv (GMIME_TYPE_MULTIPART, 0, NULL);
-
- content_type = g_mime_content_type_new ("multipart", "mixed");
- g_mime_object_set_content_type (GMIME_OBJECT (multipart), content_type);
- g_object_unref (content_type);
-
- g_mime_multipart_set_boundary (multipart, NULL);
-
- return multipart;
+ return g_mime_multipart_new_with_subtype ("mixed");
}
@@ -285,10 +274,10 @@ g_mime_multipart_new_with_subtype (const char *subtype)
GMimeContentType *content_type;
GMimeMultipart *multipart;
- multipart = g_object_newv (GMIME_TYPE_MULTIPART, 0, NULL);
+ multipart = g_object_new (GMIME_TYPE_MULTIPART, NULL);
content_type = g_mime_content_type_new ("multipart", subtype ? subtype : "mixed");
- g_mime_object_set_content_type (GMIME_OBJECT (multipart), content_type);
+ g_mime_object_set_content_type ((GMimeObject *) multipart, content_type);
g_object_unref (content_type);
g_mime_multipart_set_boundary (multipart, NULL);
@@ -710,7 +699,7 @@ multipart_set_boundary (GMimeMultipart *multipart, const char *boundary)
boundary = bbuf;
}
- g_mime_object_set_content_type_parameter (GMIME_OBJECT (multipart), "boundary", boundary);
+ g_mime_object_set_content_type_parameter ((GMimeObject *) multipart, "boundary", boundary);
}
diff --git a/gmime/gmime-object.c b/gmime/gmime-object.c
index 92377ae..00d011a 100644
--- a/gmime/gmime-object.c
+++ b/gmime/gmime-object.c
@@ -431,7 +431,7 @@ g_mime_object_new (GMimeParserOptions *options, GMimeContentType *content_type)
return NULL;
}
- object = g_object_newv (obj_type, 0, NULL);
+ object = g_object_new (obj_type, NULL);
_g_mime_header_list_set_options (object->headers, options);
g_mime_object_set_content_type (object, content_type);
@@ -487,7 +487,7 @@ g_mime_object_new_type (GMimeParserOptions *options, const char *type, const cha
return NULL;
}
- object = g_object_newv (obj_type, 0, NULL);
+ object = g_object_new (obj_type, NULL);
_g_mime_header_list_set_options (object->headers, options);
return object;
diff --git a/gmime/gmime-param.c b/gmime/gmime-param.c
index 29db3de..10d432f 100644
--- a/gmime/gmime-param.c
+++ b/gmime/gmime-param.c
@@ -142,7 +142,7 @@ g_mime_param_finalize (GObject *object)
static GMimeParam *
g_mime_param_new (void)
{
- return g_object_newv (GMIME_TYPE_PARAM, 0, NULL);
+ return g_object_new (GMIME_TYPE_PARAM, NULL);
}
@@ -394,7 +394,7 @@ g_mime_param_list_finalize (GObject *object)
GMimeParamList *
g_mime_param_list_new (void)
{
- return g_object_newv (GMIME_TYPE_PARAM_LIST, 0, NULL);
+ return g_object_new (GMIME_TYPE_PARAM_LIST, NULL);
}
diff --git a/gmime/gmime-parser.c b/gmime/gmime-parser.c
index 2313cc2..fdc14df 100644
--- a/gmime/gmime-parser.c
+++ b/gmime/gmime-parser.c
@@ -441,7 +441,7 @@ parser_close (GMimeParser *parser)
GMimeParser *
g_mime_parser_new (void)
{
- return g_object_newv (GMIME_TYPE_PARSER, 0, NULL);
+ return g_object_new (GMIME_TYPE_PARSER, NULL);
}
diff --git a/gmime/gmime-part.c b/gmime/gmime-part.c
index 4ec5ba3..520a490 100644
--- a/gmime/gmime-part.c
+++ b/gmime/gmime-part.c
@@ -484,16 +484,7 @@ mime_part_encode (GMimeObject *object, GMimeEncodingConstraint constraint)
GMimePart *
g_mime_part_new (void)
{
- GMimeContentType *content_type;
- GMimePart *mime_part;
-
- mime_part = g_object_newv (GMIME_TYPE_PART, 0, NULL);
-
- content_type = g_mime_content_type_new ("application", "octet-stream");
- g_mime_object_set_content_type (GMIME_OBJECT (mime_part), content_type);
- g_object_unref (content_type);
-
- return mime_part;
+ return g_mime_part_new_with_type ("application", "octet-stream");
}
@@ -512,10 +503,10 @@ g_mime_part_new_with_type (const char *type, const char *subtype)
GMimeContentType *content_type;
GMimePart *mime_part;
- mime_part = g_object_newv (GMIME_TYPE_PART, 0, NULL);
+ mime_part = g_object_new (GMIME_TYPE_PART, NULL);
content_type = g_mime_content_type_new (type, subtype);
- g_mime_object_set_content_type (GMIME_OBJECT (mime_part), content_type);
+ g_mime_object_set_content_type ((GMimeObject *) mime_part, content_type);
g_object_unref (content_type);
return mime_part;
diff --git a/gmime/gmime-pkcs7-context.c b/gmime/gmime-pkcs7-context.c
index 15b6292..a451460 100644
--- a/gmime/gmime-pkcs7-context.c
+++ b/gmime/gmime-pkcs7-context.c
@@ -393,7 +393,7 @@ g_mime_pkcs7_context_new (void)
if (gpgme_new (&ctx) != GPG_ERR_NO_ERROR)
return NULL;
- pkcs7 = g_object_newv (GMIME_TYPE_PKCS7_CONTEXT, 0, NULL);
+ pkcs7 = g_object_new (GMIME_TYPE_PKCS7_CONTEXT, NULL);
gpgme_set_protocol (ctx, GPGME_PROTOCOL_CMS);
gpgme_set_textmode (ctx, FALSE);
gpgme_set_armor (ctx, FALSE);
diff --git a/gmime/gmime-signature.c b/gmime/gmime-signature.c
index 300ecad..f83c2b9 100644
--- a/gmime/gmime-signature.c
+++ b/gmime/gmime-signature.c
@@ -111,7 +111,7 @@ g_mime_signature_finalize (GObject *object)
GMimeSignature *
g_mime_signature_new (void)
{
- return g_object_newv (GMIME_TYPE_SIGNATURE, 0, NULL);
+ return g_object_new (GMIME_TYPE_SIGNATURE, NULL);
}
@@ -334,7 +334,7 @@ g_mime_signature_list_finalize (GObject *object)
GMimeSignatureList *
g_mime_signature_list_new (void)
{
- return g_object_newv (GMIME_TYPE_SIGNATURE_LIST, 0, NULL);
+ return g_object_new (GMIME_TYPE_SIGNATURE_LIST, NULL);
}
diff --git a/gmime/gmime-stream-buffer.c b/gmime/gmime-stream-buffer.c
index 7944099..88bbafb 100644
--- a/gmime/gmime-stream-buffer.c
+++ b/gmime/gmime-stream-buffer.c
@@ -502,7 +502,7 @@ g_mime_stream_buffer_new (GMimeStream *source, GMimeStreamBufferMode mode)
g_return_val_if_fail (GMIME_IS_STREAM (source), NULL);
- buffer = g_object_newv (GMIME_TYPE_STREAM_BUFFER, 0, NULL);
+ buffer = g_object_new (GMIME_TYPE_STREAM_BUFFER, NULL);
buffer->source = source;
g_object_ref (source);
@@ -550,7 +550,7 @@ g_mime_stream_buffer_gets (GMimeStream *stream, char *buf, size_t max)
outend = buf + max - 1;
if (GMIME_IS_STREAM_BUFFER (stream)) {
- GMimeStreamBuffer *buffer = GMIME_STREAM_BUFFER (stream);
+ GMimeStreamBuffer *buffer = (GMimeStreamBuffer *) stream;
if (buffer->mode == GMIME_STREAM_BUFFER_BLOCK_READ) {
while (outptr < outend) {
diff --git a/gmime/gmime-stream-cat.c b/gmime/gmime-stream-cat.c
index 3160a57..4b9cff0 100644
--- a/gmime/gmime-stream-cat.c
+++ b/gmime/gmime-stream-cat.c
@@ -641,11 +641,11 @@ stream_substream (GMimeStream *stream, gint64 start, gint64 end)
} while (n != NULL);
d(fprintf (stderr, "returning a substream containing multiple source streams\n"));
- cat = g_object_newv (GMIME_TYPE_STREAM_CAT, 0, NULL);
+ cat = g_object_new (GMIME_TYPE_STREAM_CAT, NULL);
/* Note: we could pass -1 as bound_end, it should Just
* Work(tm) but setting absolute bounds is kinda
* nice... */
- g_mime_stream_construct (GMIME_STREAM (cat), 0, subend);
+ g_mime_stream_construct ((GMimeStream *) cat, 0, subend);
while (streams != NULL) {
s = streams->next;
@@ -684,7 +684,7 @@ g_mime_stream_cat_new (void)
{
GMimeStream *stream;
- stream = g_object_newv (GMIME_TYPE_STREAM_CAT, 0, NULL);
+ stream = g_object_new (GMIME_TYPE_STREAM_CAT, NULL);
g_mime_stream_construct (stream, 0, -1);
return stream;
diff --git a/gmime/gmime-stream-file.c b/gmime/gmime-stream-file.c
index e95f7f0..d69a77b 100644
--- a/gmime/gmime-stream-file.c
+++ b/gmime/gmime-stream-file.c
@@ -345,12 +345,12 @@ stream_substream (GMimeStream *stream, gint64 start, gint64 end)
{
GMimeStreamFile *fstream;
- fstream = g_object_newv (GMIME_TYPE_STREAM_FILE, 0, NULL);
- g_mime_stream_construct (GMIME_STREAM (fstream), start, end);
+ fstream = g_object_new (GMIME_TYPE_STREAM_FILE, NULL);
+ g_mime_stream_construct ((GMimeStream *) fstream, start, end);
+ fstream->fp = ((GMimeStreamFile *) stream)->fp;
fstream->owner = FALSE;
- fstream->fp = GMIME_STREAM_FILE (stream)->fp;
- return GMIME_STREAM (fstream);
+ return (GMimeStream *) fstream;
}
@@ -380,12 +380,12 @@ g_mime_stream_file_new (FILE *fp)
if ((start = ftell (fp)) == -1)
start = 0;
- fstream = g_object_newv (GMIME_TYPE_STREAM_FILE, 0, NULL);
- g_mime_stream_construct (GMIME_STREAM (fstream), start, -1);
+ fstream = g_object_new (GMIME_TYPE_STREAM_FILE, NULL);
+ g_mime_stream_construct ((GMimeStream *) fstream, start, -1);
fstream->owner = TRUE;
fstream->fp = fp;
- return GMIME_STREAM (fstream);
+ return (GMimeStream *) fstream;
}
@@ -414,12 +414,12 @@ g_mime_stream_file_new_with_bounds (FILE *fp, gint64 start, gint64 end)
_setmode (_fileno (fp), O_BINARY);
#endif
- fstream = g_object_newv (GMIME_TYPE_STREAM_FILE, 0, NULL);
- g_mime_stream_construct (GMIME_STREAM (fstream), start, end);
+ fstream = g_object_new (GMIME_TYPE_STREAM_FILE, NULL);
+ g_mime_stream_construct ((GMimeStream *) fstream, start, end);
fstream->owner = TRUE;
fstream->fp = fp;
- return GMIME_STREAM (fstream);
+ return (GMimeStream *) fstream;
}
diff --git a/gmime/gmime-stream-filter.c b/gmime/gmime-stream-filter.c
index faa4471..47a72a2 100644
--- a/gmime/gmime-stream-filter.c
+++ b/gmime/gmime-stream-filter.c
@@ -368,7 +368,7 @@ stream_substream (GMimeStream *stream, gint64 start, gint64 end)
GMimeStreamFilter *filter = (GMimeStreamFilter *) stream;
GMimeStreamFilter *sub;
- sub = g_object_newv (GMIME_TYPE_STREAM_FILTER, 0, NULL);
+ sub = g_object_new (GMIME_TYPE_STREAM_FILTER, NULL);
sub->source = filter->source;
g_object_ref (sub->source);
@@ -418,7 +418,7 @@ g_mime_stream_filter_new (GMimeStream *stream)
g_return_val_if_fail (GMIME_IS_STREAM (stream), NULL);
- filter = g_object_newv (GMIME_TYPE_STREAM_FILTER, 0, NULL);
+ filter = g_object_new (GMIME_TYPE_STREAM_FILTER, NULL);
filter->source = stream;
g_object_ref (stream);
diff --git a/gmime/gmime-stream-fs.c b/gmime/gmime-stream-fs.c
index 66ab740..b9f2c21 100644
--- a/gmime/gmime-stream-fs.c
+++ b/gmime/gmime-stream-fs.c
@@ -394,9 +394,9 @@ stream_substream (GMimeStream *stream, gint64 start, gint64 end)
{
GMimeStreamFs *fs;
- fs = g_object_newv (GMIME_TYPE_STREAM_FS, 0, NULL);
- g_mime_stream_construct (GMIME_STREAM (fs), start, end);
- fs->fd = GMIME_STREAM_FS (stream)->fd;
+ fs = g_object_new (GMIME_TYPE_STREAM_FS, NULL);
+ g_mime_stream_construct ((GMimeStream *) fs, start, end);
+ fs->fd = ((GMimeStreamFs *) stream)->fd;
fs->owner = FALSE;
fs->eos = FALSE;
@@ -425,8 +425,8 @@ g_mime_stream_fs_new (int fd)
if ((start = lseek (fd, (off_t) 0, SEEK_CUR)) == -1)
start = 0;
- fs = g_object_newv (GMIME_TYPE_STREAM_FS, 0, NULL);
- g_mime_stream_construct (GMIME_STREAM (fs), start, -1);
+ fs = g_object_new (GMIME_TYPE_STREAM_FS, NULL);
+ g_mime_stream_construct ((GMimeStream *) fs, start, -1);
fs->owner = TRUE;
fs->eos = FALSE;
fs->fd = fd;
@@ -455,8 +455,8 @@ g_mime_stream_fs_new_with_bounds (int fd, gint64 start, gint64 end)
_setmode (fd, O_BINARY);
#endif
- fs = g_object_newv (GMIME_TYPE_STREAM_FS, 0, NULL);
- g_mime_stream_construct (GMIME_STREAM (fs), start, end);
+ fs = g_object_new (GMIME_TYPE_STREAM_FS, NULL);
+ g_mime_stream_construct ((GMimeStream *) fs, start, end);
fs->owner = TRUE;
fs->eos = FALSE;
fs->fd = fd;
diff --git a/gmime/gmime-stream-gio.c b/gmime/gmime-stream-gio.c
index 37e5dd8..9d089ba 100644
--- a/gmime/gmime-stream-gio.c
+++ b/gmime/gmime-stream-gio.c
@@ -620,9 +620,9 @@ stream_substream (GMimeStream *stream, gint64 start, gint64 end)
{
GMimeStreamGIO *gio;
- gio = g_object_newv (GMIME_TYPE_STREAM_GIO, 0, NULL);
- g_mime_stream_construct (GMIME_STREAM (gio), start, end);
- gio->file = GMIME_STREAM_GIO (stream)->file;
+ gio = g_object_new (GMIME_TYPE_STREAM_GIO, NULL);
+ g_mime_stream_construct ((GMimeStream *) gio, start, end);
+ gio->file = ((GMimeStreamGIO *) stream)->file;
gio->owner = FALSE;
gio->eos = FALSE;
@@ -645,8 +645,8 @@ g_mime_stream_gio_new (GFile *file)
g_return_val_if_fail (G_IS_FILE (file), NULL);
- gio = g_object_newv (GMIME_TYPE_STREAM_GIO, 0, NULL);
- g_mime_stream_construct (GMIME_STREAM (gio), 0, -1);
+ gio = g_object_new (GMIME_TYPE_STREAM_GIO, NULL);
+ g_mime_stream_construct ((GMimeStream *) gio, 0, -1);
gio->file = file;
gio->owner = TRUE;
gio->eos = FALSE;
@@ -674,8 +674,8 @@ g_mime_stream_gio_new_with_bounds (GFile *file, gint64 start, gint64 end)
g_return_val_if_fail (G_IS_FILE (file), NULL);
- gio = g_object_newv (GMIME_TYPE_STREAM_GIO, 0, NULL);
- g_mime_stream_construct (GMIME_STREAM (gio), start, end);
+ gio = g_object_new (GMIME_TYPE_STREAM_GIO, NULL);
+ g_mime_stream_construct ((GMimeStream *) gio, start, end);
gio->file = file;
gio->owner = TRUE;
gio->eos = FALSE;
diff --git a/gmime/gmime-stream-mem.c b/gmime/gmime-stream-mem.c
index 33856e6..0ec55bb 100644
--- a/gmime/gmime-stream-mem.c
+++ b/gmime/gmime-stream-mem.c
@@ -319,9 +319,9 @@ stream_substream (GMimeStream *stream, gint64 start, gint64 end)
{
GMimeStreamMem *mem;
- mem = g_object_newv (GMIME_TYPE_STREAM_MEM, 0, NULL);
+ mem = g_object_new (GMIME_TYPE_STREAM_MEM, NULL);
g_mime_stream_construct ((GMimeStream *) mem, start, end);
- mem->buffer = GMIME_STREAM_MEM (stream)->buffer;
+ mem->buffer = ((GMimeStreamMem *) stream)->buffer;
mem->owner = FALSE;
return (GMimeStream *) mem;
@@ -340,7 +340,7 @@ g_mime_stream_mem_new (void)
{
GMimeStreamMem *mem;
- mem = g_object_newv (GMIME_TYPE_STREAM_MEM, 0, NULL);
+ mem = g_object_new (GMIME_TYPE_STREAM_MEM, NULL);
g_mime_stream_construct ((GMimeStream *) mem, 0, -1);
mem->buffer = g_byte_array_new ();
mem->owner = TRUE;
@@ -362,7 +362,7 @@ g_mime_stream_mem_new_with_byte_array (GByteArray *array)
{
GMimeStreamMem *mem;
- mem = g_object_newv (GMIME_TYPE_STREAM_MEM, 0, NULL);
+ mem = g_object_new (GMIME_TYPE_STREAM_MEM, NULL);
g_mime_stream_construct ((GMimeStream *) mem, 0, -1);
mem->buffer = array;
mem->owner = TRUE;
@@ -385,12 +385,10 @@ GMimeStream *
g_mime_stream_mem_new_with_buffer (const char *buffer, size_t len)
{
GMimeStreamMem *mem;
+
+ g_return_val_if_fail (buffer != NULL, NULL);
- mem = g_object_newv (GMIME_TYPE_STREAM_MEM, 0, NULL);
- g_mime_stream_construct ((GMimeStream *) mem, 0, -1);
- mem->buffer = g_byte_array_new ();
- mem->owner = TRUE;
-
+ mem = (GMimeStreamMem *) g_mime_stream_mem_new ();
g_byte_array_append (mem->buffer, (unsigned char *) buffer, len);
return (GMimeStream *) mem;
@@ -427,7 +425,7 @@ g_mime_stream_mem_get_byte_array (GMimeStreamMem *mem)
void
g_mime_stream_mem_set_byte_array (GMimeStreamMem *mem, GByteArray *array)
{
- GMimeStream *stream;
+ GMimeStream *stream = (GMimeStream *) mem;
g_return_if_fail (GMIME_IS_STREAM_MEM (mem));
g_return_if_fail (array != NULL);
@@ -438,8 +436,6 @@ g_mime_stream_mem_set_byte_array (GMimeStreamMem *mem, GByteArray *array)
mem->buffer = array;
mem->owner = FALSE;
- stream = GMIME_STREAM (mem);
-
stream->position = 0;
stream->bound_start = 0;
stream->bound_end = -1;
diff --git a/gmime/gmime-stream-mmap.c b/gmime/gmime-stream-mmap.c
index 112405f..c70692c 100644
--- a/gmime/gmime-stream-mmap.c
+++ b/gmime/gmime-stream-mmap.c
@@ -361,17 +361,15 @@ stream_length (GMimeStream *stream)
static GMimeStream *
stream_substream (GMimeStream *stream, gint64 start, gint64 end)
{
- /* FIXME: maybe we should return a GMimeStreamFs? */
GMimeStreamMmap *mstream;
- mstream = g_object_newv (GMIME_TYPE_STREAM_MMAP, 0, NULL);
- g_mime_stream_construct (GMIME_STREAM (mstream), start, end);
- mstream->fd = GMIME_STREAM_MMAP (stream)->fd;
+ mstream = g_object_new (GMIME_TYPE_STREAM_MMAP, NULL);
+ g_mime_stream_construct ((GMimeStream *) mstream, start, end);
+ mstream->maplen = ((GMimeStreamMmap *) stream)->maplen;
+ mstream->map = ((GMimeStreamMmap *) stream)->map;
+ mstream->fd = ((GMimeStreamMmap *) stream)->fd;
mstream->owner = FALSE;
- mstream->maplen = GMIME_STREAM_MMAP (stream)->maplen;
- mstream->map = GMIME_STREAM_MMAP (stream)->map;
-
return (GMimeStream *) mstream;
}
@@ -405,7 +403,7 @@ g_mime_stream_mmap_new (int fd, int prot, int flags)
if (map == MAP_FAILED)
return NULL;
- mstream = g_object_newv (GMIME_TYPE_STREAM_MMAP, 0, NULL);
+ mstream = g_object_new (GMIME_TYPE_STREAM_MMAP, NULL);
g_mime_stream_construct ((GMimeStream *) mstream, start, -1);
mstream->owner = TRUE;
mstream->eos = FALSE;
@@ -453,7 +451,7 @@ g_mime_stream_mmap_new_with_bounds (int fd, int prot, int flags, gint64 start, g
if ((map = mmap (NULL, len, prot, flags, fd, 0)) == MAP_FAILED)
return NULL;
- mstream = g_object_newv (GMIME_TYPE_STREAM_MMAP, 0, NULL);
+ mstream = g_object_new (GMIME_TYPE_STREAM_MMAP, NULL);
g_mime_stream_construct ((GMimeStream *) mstream, start, end);
mstream->owner = TRUE;
mstream->eos = FALSE;
diff --git a/gmime/gmime-stream-null.c b/gmime/gmime-stream-null.c
index 26ac924..712fe31 100644
--- a/gmime/gmime-stream-null.c
+++ b/gmime/gmime-stream-null.c
@@ -231,7 +231,7 @@ stream_substream (GMimeStream *stream, gint64 start, gint64 end)
{
GMimeStream *null;
- null = g_object_newv (GMIME_TYPE_STREAM_NULL, 0, NULL);
+ null = g_object_new (GMIME_TYPE_STREAM_NULL, NULL);
g_mime_stream_construct (null, start, end);
return null;
@@ -250,7 +250,7 @@ g_mime_stream_null_new (void)
{
GMimeStream *null;
- null = g_object_newv (GMIME_TYPE_STREAM_NULL, 0, NULL);
+ null = g_object_new (GMIME_TYPE_STREAM_NULL, NULL);
g_mime_stream_construct (null, 0, -1);
return null;
diff --git a/gmime/gmime-stream-pipe.c b/gmime/gmime-stream-pipe.c
index d69d62d..37e73a4 100644
--- a/gmime/gmime-stream-pipe.c
+++ b/gmime/gmime-stream-pipe.c
@@ -279,7 +279,15 @@ stream_length (GMimeStream *stream)
static GMimeStream *
stream_substream (GMimeStream *stream, gint64 start, gint64 end)
{
- return NULL;
+ GMimeStreamPipe *pipes;
+
+ pipes = g_object_new (GMIME_TYPE_STREAM_PIPE, NULL);
+ g_mime_stream_construct ((GMimeStream *) pipes, start, end);
+ pipes->fd = ((GMimeStreamPipe *) stream)->fd;
+ pipes->owner = FALSE;
+ pipes->eos = FALSE;
+
+ return (GMimeStream *) pipes;
}
@@ -296,8 +304,8 @@ g_mime_stream_pipe_new (int fd)
{
GMimeStreamPipe *pipes;
- pipes = g_object_newv (GMIME_TYPE_STREAM_PIPE, 0, NULL);
- g_mime_stream_construct (GMIME_STREAM (pipes), 0, -1);
+ pipes = g_object_new (GMIME_TYPE_STREAM_PIPE, NULL);
+ g_mime_stream_construct ((GMimeStream *) pipes, 0, -1);
pipes->owner = TRUE;
pipes->eos = FALSE;
pipes->fd = fd;
diff --git a/gmime/gmime-text-part.c b/gmime/gmime-text-part.c
index cc63b9f..ea72530 100644
--- a/gmime/gmime-text-part.c
+++ b/gmime/gmime-text-part.c
@@ -116,10 +116,10 @@ g_mime_text_part_new (void)
GMimeContentType *content_type;
GMimeTextPart *mime_part;
- mime_part = g_object_newv (GMIME_TYPE_TEXT_PART, 0, NULL);
+ mime_part = g_object_new (GMIME_TYPE_TEXT_PART, NULL);
content_type = g_mime_content_type_new ("text", "plain");
- g_mime_object_set_content_type (GMIME_OBJECT (mime_part), content_type);
+ g_mime_object_set_content_type ((GMimeObject *) mime_part, content_type);
g_object_unref (content_type);
return mime_part;
@@ -140,10 +140,10 @@ g_mime_text_part_new_with_subtype (const char *subtype)
GMimeContentType *content_type;
GMimeTextPart *mime_part;
- mime_part = g_object_newv (GMIME_TYPE_TEXT_PART, 0, NULL);
+ mime_part = g_object_new (GMIME_TYPE_TEXT_PART, NULL);
content_type = g_mime_content_type_new ("text", subtype);
- g_mime_object_set_content_type (GMIME_OBJECT (mime_part), content_type);
+ g_mime_object_set_content_type ((GMimeObject *) mime_part, content_type);
g_object_unref (content_type);
return mime_part;
diff --git a/gmime/internet-address.c b/gmime/internet-address.c
index 5161153..1dcfa7a 100644
--- a/gmime/internet-address.c
+++ b/gmime/internet-address.c
@@ -364,7 +364,7 @@ internet_address_mailbox_new (const char *name, const char *addr)
g_return_val_if_fail (addr != NULL, NULL);
- mailbox = g_object_newv (INTERNET_ADDRESS_TYPE_MAILBOX, 0, NULL);
+ mailbox = g_object_new (INTERNET_ADDRESS_TYPE_MAILBOX, NULL);
mailbox->addr = g_strdup (addr);
_internet_address_set_name ((InternetAddress *) mailbox, name);
@@ -504,7 +504,7 @@ internet_address_group_new (const char *name)
{
InternetAddress *group;
- group = g_object_newv (INTERNET_ADDRESS_TYPE_GROUP, 0, NULL);
+ group = g_object_new (INTERNET_ADDRESS_TYPE_GROUP, NULL);
_internet_address_set_name (group, name);
return group;
@@ -670,7 +670,7 @@ internet_address_list_finalize (GObject *object)
InternetAddressList *
internet_address_list_new (void)
{
- return g_object_newv (INTERNET_ADDRESS_LIST_TYPE, 0, NULL);
+ return g_object_new (INTERNET_ADDRESS_LIST_TYPE, NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]