diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-05-27 23:13:25 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-05-29 00:13:23 +0800 |
commit | fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056 (patch) | |
tree | ae78be371695c3dc18847b87d3f014f985aa3a40 /mail/em-inline-filter.c | |
parent | 6f5464f34ceec9e5701e3e3e651a40f9e6b3a072 (diff) | |
download | gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.gz gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.bz2 gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.lz gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.xz gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.zst gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.zip |
Prefer GLib basic types over C types.
Diffstat (limited to 'mail/em-inline-filter.c')
-rw-r--r-- | mail/em-inline-filter.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/mail/em-inline-filter.c b/mail/em-inline-filter.c index ffe9f676b3..7da549cd34 100644 --- a/mail/em-inline-filter.c +++ b/mail/em-inline-filter.c @@ -39,8 +39,8 @@ static void em_inline_filter_class_init (EMInlineFilterClass *klass); static void em_inline_filter_init (CamelObject *object); static void em_inline_filter_finalize (CamelObject *object); -static void emif_filter(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace); -static void emif_complete(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace); +static void emif_filter(CamelMimeFilter *f, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace); +static void emif_complete(CamelMimeFilter *f, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace); static void emif_reset(CamelMimeFilter *f); static CamelMimeFilterClass *parent_class = NULL; @@ -106,8 +106,8 @@ enum { }; static const struct { - const char *type; - const char *subtype; + const gchar *type; + const gchar *subtype; CamelTransferEncoding encoding; guint plain:1; } emif_types[] = { @@ -120,22 +120,22 @@ static const struct { }; static void -emif_add_part(EMInlineFilter *emif, const char *data, int len) +emif_add_part(EMInlineFilter *emif, const gchar *data, gint len) { CamelTransferEncoding encoding; CamelContentType *content_type; CamelDataWrapper *dw; - const char *mimetype; + const gchar *mimetype; CamelMimePart *part; CamelStream *mem; - char *type; + gchar *type; if (emif->state == EMIF_PLAIN || emif->state == EMIF_PGPSIGNED || emif->state == EMIF_PGPENCRYPTED) encoding = emif->base_encoding; else encoding = emif_types[emif->state].encoding; - g_byte_array_append(emif->data, (unsigned char *)data, len); + g_byte_array_append(emif->data, (guchar *)data, len); /* check the part will actually have content */ if (emif->data->len <= 0) { return; @@ -191,12 +191,12 @@ emif_add_part(EMInlineFilter *emif, const char *data, int len) } static int -emif_scan(CamelMimeFilter *f, char *in, size_t len, int final) +emif_scan(CamelMimeFilter *f, gchar *in, size_t len, gint final) { EMInlineFilter *emif = (EMInlineFilter *)f; - char *inptr = in, *inend = in+len; - char *data_start = in; - char *start = in; + gchar *inptr = in, *inend = in+len; + gchar *data_start = in; + gchar *start = in; while (inptr < inend) { start = inptr; @@ -219,8 +219,8 @@ emif_scan(CamelMimeFilter *f, char *in, size_t len, int final) /* This could use some funky plugin shit, but this'll do for now */ if (strncmp(start, "begin ", 6) == 0 && start[6] >= '0' && start[6] <= '7') { - int i = 7; - char *name; + gint i = 7; + gchar *name; while (start[i] >='0' && start[i] <='7') i++; @@ -267,7 +267,7 @@ emif_scan(CamelMimeFilter *f, char *in, size_t len, int final) data_start = inptr; emif->state = EMIF_PLAIN; } else { - int linelen; + gint linelen; /* check the length byte matches the data, if not, output what we have and re-scan this line */ len = ((start[0] - ' ') & 077); @@ -327,14 +327,14 @@ emif_scan(CamelMimeFilter *f, char *in, size_t len, int final) if (final) { emif_add_part(emif, data_start, inend-data_start); } else { - g_byte_array_append(emif->data, (unsigned char *)data_start, inend-data_start); + g_byte_array_append(emif->data, (guchar *)data_start, inend-data_start); } return 0; } static void -emif_filter(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace) +emif_filter(CamelMimeFilter *f, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace) { emif_scan(f, in, len, FALSE); @@ -344,7 +344,7 @@ emif_filter(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **ou } static void -emif_complete(CamelMimeFilter *f, char *in, size_t len, size_t prespace, char **out, size_t *outlen, size_t *outprespace) +emif_complete(CamelMimeFilter *f, gchar *in, size_t len, size_t prespace, gchar **out, size_t *outlen, size_t *outprespace) { emif_scan(f, in, len, TRUE); |