diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-08-11 10:57:11 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-08-11 10:57:11 +0800 |
commit | 40eea3692e4afa02a9092f64c00e9348f562f68b (patch) | |
tree | a5de1982e43949eefeea75ab5a939a89690b32d4 | |
parent | e8ee5b65d43775708361a1094d56ae7d20fbb5e7 (diff) | |
download | gsoc2013-evolution-40eea3692e4afa02a9092f64c00e9348f562f68b.tar gsoc2013-evolution-40eea3692e4afa02a9092f64c00e9348f562f68b.tar.gz gsoc2013-evolution-40eea3692e4afa02a9092f64c00e9348f562f68b.tar.bz2 gsoc2013-evolution-40eea3692e4afa02a9092f64c00e9348f562f68b.tar.lz gsoc2013-evolution-40eea3692e4afa02a9092f64c00e9348f562f68b.tar.xz gsoc2013-evolution-40eea3692e4afa02a9092f64c00e9348f562f68b.tar.zst gsoc2013-evolution-40eea3692e4afa02a9092f64c00e9348f562f68b.zip |
Fixed some warnings.
2000-08-10 Christopher James Lahey <clahey@helixcode.com>
* camel-folder-search.c, camel-folder-summary.c, camel-medium.c,
camel-mime-filter-charset.c, camel-mime-filter.c,
camel-mime-filter.h, camel-mime-message.c, camel-mime-parser.c,
camel-mime-part-utils.c, camel-mime-part.c, camel-mime-utils.c,
camel-movemail.c, camel-multipart.c, camel-object.c,
camel-stream-mem.c, providers/mbox/camel-mbox-folder.c,
providers/mbox/camel-mbox-summary.c,
providers/mh/camel-mh-folder.c,
providers/smtp/camel-smtp-transport.c: Fixed some warnings.
svn path=/trunk/; revision=4719
-rw-r--r-- | camel/ChangeLog | 12 | ||||
-rw-r--r-- | camel/camel-folder-search.c | 6 | ||||
-rw-r--r-- | camel/camel-folder-summary.c | 2 | ||||
-rw-r--r-- | camel/camel-medium.c | 2 | ||||
-rw-r--r-- | camel/camel-mime-filter-charset.c | 6 | ||||
-rw-r--r-- | camel/camel-mime-filter.c | 2 | ||||
-rw-r--r-- | camel/camel-mime-filter.h | 2 | ||||
-rw-r--r-- | camel/camel-mime-message.c | 2 | ||||
-rw-r--r-- | camel/camel-mime-parser.c | 3 | ||||
-rw-r--r-- | camel/camel-mime-part-utils.c | 15 | ||||
-rw-r--r-- | camel/camel-mime-part.c | 4 | ||||
-rw-r--r-- | camel/camel-mime-utils.c | 8 | ||||
-rw-r--r-- | camel/camel-movemail.c | 7 | ||||
-rw-r--r-- | camel/camel-multipart.c | 2 | ||||
-rw-r--r-- | camel/camel-object.c | 2 | ||||
-rw-r--r-- | camel/camel-stream-mem.c | 2 | ||||
-rw-r--r-- | camel/providers/mbox/camel-mbox-folder.c | 4 | ||||
-rw-r--r-- | camel/providers/mbox/camel-mbox-summary.c | 4 | ||||
-rw-r--r-- | camel/providers/mh/camel-mh-folder.c | 4 | ||||
-rw-r--r-- | camel/providers/smtp/camel-smtp-transport.c | 3 |
20 files changed, 70 insertions, 22 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 4a9cdc3719..36abd51dbd 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,15 @@ +2000-08-10 Christopher James Lahey <clahey@helixcode.com> + + * camel-folder-search.c, camel-folder-summary.c, camel-medium.c, + camel-mime-filter-charset.c, camel-mime-filter.c, + camel-mime-filter.h, camel-mime-message.c, camel-mime-parser.c, + camel-mime-part-utils.c, camel-mime-part.c, camel-mime-utils.c, + camel-movemail.c, camel-multipart.c, camel-object.c, + camel-stream-mem.c, providers/mbox/camel-mbox-folder.c, + providers/mbox/camel-mbox-summary.c, + providers/mh/camel-mh-folder.c, + providers/smtp/camel-smtp-transport.c: Fixed some warnings. + 2000-08-11 Not Zed <NotZed@HelixCode.com> * providers/vee/camel-vee-folder.c (vee_folder_build_folder): Free diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c index c15b6d7d40..47bdc0b5ef 100644 --- a/camel/camel-folder-search.c +++ b/camel/camel-folder-search.c @@ -60,7 +60,8 @@ camel_folder_search_class_init (CamelFolderSearchClass *klass) klass->match_all = search_match_all; klass->body_contains = search_body_contains; klass->header_contains = search_header_contains; - klass->user_flag = search_user_tag; + klass->user_tag = search_user_tag; + klass->user_flag = search_user_flag; } static void @@ -125,7 +126,8 @@ struct { { "match-all", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, match_all), 3 }, { "body-contains", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, body_contains), 1 }, { "header-contains", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, header_contains), 1 }, - { "user-tag", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, user_flag), 1 }, + { "user-tag", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, user_tag), 1 }, + { "user-flag", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, user_flag), 1 }, }; void diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index 6bae5cecec..71456dbf4d 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -646,7 +646,7 @@ camel_folder_summary_encode_token(FILE *out, char *str) lower[i] = tolower(str[i]); lower[i] = 0; #ifdef USE_BSEARCH - match = bsearch(lower, tokens, tokens_len, sizeof(char *), (int (*)(void *, void *))token_search_cmp); + match = bsearch(lower, tokens, tokens_len, sizeof(char *), (int (*)(const void *, const void *))token_search_cmp); if (match) token = match-tokens; #else diff --git a/camel/camel-medium.c b/camel/camel-medium.c index 4507c93595..3c5954e40f 100644 --- a/camel/camel-medium.c +++ b/camel/camel-medium.c @@ -207,7 +207,9 @@ camel_medium_get_header (CamelMedium *medium, const gchar *header_name) g_return_val_if_fail (CAMEL_IS_MEDIUM (medium), NULL); g_return_val_if_fail (header_name != NULL, NULL); +#ifndef NO_WARNINGS #warning No way to get multi-valued headers? +#endif return CM_CLASS (medium)->get_header (medium, header_name); } diff --git a/camel/camel-mime-filter-charset.c b/camel/camel-mime-filter-charset.c index 18c0c64c3a..788c7022ab 100644 --- a/camel/camel-mime-filter-charset.c +++ b/camel/camel-mime-filter-charset.c @@ -84,7 +84,8 @@ complete(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, { CamelMimeFilterCharset *f = (CamelMimeFilterCharset *)mf; int converted; - char *inbuf, *outbuf; + const char *inbuf; + char *outbuf; int inlen, outlen; if (f->ic == (unicode_iconv_t) -1) { @@ -136,7 +137,8 @@ filter(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, s { CamelMimeFilterCharset *f = (CamelMimeFilterCharset *)mf; int converted; - char *inbuf, *outbuf; + const char *inbuf; + char *outbuf; int inlen, outlen; if (f->ic == (unicode_iconv_t) -1) { diff --git a/camel/camel-mime-filter.c b/camel/camel-mime-filter.c index 19c4e095fe..678d450af2 100644 --- a/camel/camel-mime-filter.c +++ b/camel/camel-mime-filter.c @@ -177,7 +177,7 @@ void camel_mime_filter_reset(CamelMimeFilter *f) } /* sets number of bytes backed up on the input, new calls replace previous ones */ -void camel_mime_filter_backup(CamelMimeFilter *f, char *data, size_t length) +void camel_mime_filter_backup(CamelMimeFilter *f, const char *data, size_t length) { if (f->backsize < length) { /* g_realloc copies data, unnecessary overhead */ diff --git a/camel/camel-mime-filter.h b/camel/camel-mime-filter.h index 6e729b13c2..65d8590fa5 100644 --- a/camel/camel-mime-filter.h +++ b/camel/camel-mime-filter.h @@ -76,7 +76,7 @@ void camel_mime_filter_complete(CamelMimeFilter *f, void camel_mime_filter_reset(CamelMimeFilter *f); /* sets/returns number of bytes backed up on the input */ -void camel_mime_filter_backup(CamelMimeFilter *f, char *data, size_t length); +void camel_mime_filter_backup(CamelMimeFilter *f, const char *data, size_t length); /* ensure this much size available for filter output */ void camel_mime_filter_set_size(CamelMimeFilter *f, size_t size, int keep); diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c index c3bd02cd05..d8f61facc4 100644 --- a/camel/camel-mime-message.c +++ b/camel/camel-mime-message.c @@ -411,7 +411,9 @@ construct_from_parser(CamelMimePart *dw, CamelMimeParser *mp) } d(printf("mime_message::construct_from_parser() leaving\n")); +#ifndef NO_WARNINGS #warning "return a real error code" +#endif return 0; } diff --git a/camel/camel-mime-parser.c b/camel/camel-mime-parser.c index 4b7b23ae37..9599e5bde2 100644 --- a/camel/camel-mime-parser.c +++ b/camel/camel-mime-parser.c @@ -282,6 +282,7 @@ static void header_append_mempool(struct _header_scan_state *s, struct _header_s static void camel_mime_parser_class_init (CamelMimeParserClass *klass); static void camel_mime_parser_init (CamelMimeParser *obj); +#if d(!)0 static char *states[] = { "HSCAN_INITIAL", "HSCAN_FROM", /* got 'From' line */ @@ -300,6 +301,8 @@ static char *states[] = { "HSCAN_MULTIPART_END", "HSCAN_MESSAGE_END", }; +#endif + static CamelObjectClass *camel_mime_parser_parent; diff --git a/camel/camel-mime-part-utils.c b/camel/camel-mime-part-utils.c index 68b1f1da75..646b0131b1 100644 --- a/camel/camel-mime-part-utils.c +++ b/camel/camel-mime-part-utils.c @@ -44,12 +44,12 @@ simple_data_wrapper_construct_from_parser(CamelDataWrapper *dw, CamelMimeParser GByteArray *buffer; char *buf; int len; - off_t start, end; /* ignore the start may be used unitialised warning */ + off_t start = 0, end; CamelMimeFilter *fdec = NULL, *fcrlf = NULL, *fch = NULL; struct _header_content_type *ct; - int decid=-1, crlfid=-1, chrid=-1, cache=TRUE; + int decid=-1, crlfid=-1, chrid=-1; CamelStream *source; - CamelSeekableStream *seekable_source; /* and ignore the warning about this one too. */ + CamelSeekableStream *seekable_source = NULL; char *encoding; d(printf("constructing data-wrapper\n")); @@ -64,7 +64,6 @@ simple_data_wrapper_construct_from_parser(CamelDataWrapper *dw, CamelMimeParser camel_object_ref((CamelObject *)source); if (CAMEL_IS_SEEKABLE_STREAM (source)) { seekable_source = CAMEL_SEEKABLE_STREAM (source); - cache = FALSE; } } @@ -111,12 +110,12 @@ simple_data_wrapper_construct_from_parser(CamelDataWrapper *dw, CamelMimeParser buffer = g_byte_array_new(); - if (!cache) { + if (seekable_source /* !cache */) { start = camel_mime_parser_tell(mp) + seekable_source->bound_start; } while ( camel_mime_parser_step(mp, &buf, &len) != HSCAN_BODY_END ) { if (buffer) { - if (buffer->len > 20480 && !cache) { + if (buffer->len > 20480 && seekable_source) { /* is this a 'big' message? Yes? We dont want to convert it all then.*/ camel_mime_parser_filter_remove(mp, decid); camel_mime_parser_filter_remove(mp, chrid); @@ -203,7 +202,9 @@ camel_mime_part_construct_content_from_parser(CamelMimePart *dw, CamelMimeParser case HSCAN_MULTIPART: { CamelDataWrapper *bodypart; +#ifndef NO_WARNINGS #warning This should use a camel-mime-multipart +#endif d(printf("Creating multi-part\n")); content = (CamelDataWrapper *)camel_multipart_new(); @@ -223,7 +224,9 @@ camel_mime_part_construct_content_from_parser(CamelMimePart *dw, CamelMimeParser g_warning("Invalid state encountered???: %d", camel_mime_parser_state(mp)); } if (content) { +#ifndef NO_WARNINGS #warning there just has got to be a better way ... to transfer the mime-type to the datawrapper +#endif /* would you believe you have to set this BEFORE you set the content object??? oh my god !!!! */ camel_data_wrapper_set_mime_type_field (content, camel_mime_part_get_content_type ((CamelMimePart *)dw)); diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c index 4112857667..f9519df5e4 100644 --- a/camel/camel-mime-part.c +++ b/camel/camel-mime-part.c @@ -477,7 +477,9 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream) /* FIXME: something needs to be done about this ... */ /* FIXME: need to count these bytes too */ +#ifndef NO_WARNINGS #warning content-languages should be stored as a header +#endif if (mp->headers) { struct _header_raw *h = mp->headers; @@ -570,7 +572,9 @@ construct_from_parser(CamelMimePart *dw, CamelMimeParser *mp) } d(printf("mime_part::construct_from_parser() leaving\n")); +#ifndef NO_WARNINGS #warning "Need to work out how to detect a (fatally) bad parse in the parser" +#endif return 0; } diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c index edfda90ed8..3e85f4127f 100644 --- a/camel/camel-mime-utils.c +++ b/camel/camel-mime-utils.c @@ -541,7 +541,7 @@ int quoted_encode_step(unsigned char *in, int len, unsigned char *out, int *statep, int *save) { register unsigned char *inptr, *outptr, *inend; - unsigned char c=0x100; + unsigned char c; register int sofar = *save, /* keeps track of how many chars on a line */ last=*statep; /* keeps track if last char to end was a space cr etc */ @@ -794,7 +794,7 @@ header_decode_lwsp(const char **in) d2(printf("is ws: '%s'\n", *in)); - while (is_lwsp(*inptr) || *inptr =='(' && *inptr != '\0') { + while (is_lwsp(*inptr) || (*inptr =='(' && *inptr != '\0')) { while (is_lwsp(*inptr) && inptr != '\0') { d2(printf("(%c)", *inptr)); inptr++; @@ -1804,7 +1804,9 @@ header_address_decode(const char *in) d(printf("decoding To: '%s'\n", in)); +#ifndef NO_WARNINGS #warning header_to_decode needs to return some structure +#endif if (in == NULL) return NULL; @@ -2562,7 +2564,9 @@ header_address_list_format_append(GString *out, struct _header_address *a) while (a) { switch (a->type) { case HEADER_ADDRESS_NAME: +#ifndef NO_WARNINGS #warning needs to rfc2047 encode address phrase +#endif /* FIXME: 2047 encoding?? */ if (a->name && *a->name) g_string_sprintfa(out, "\"%s\" <%s>", a->name, a->v.addr); diff --git a/camel/camel-movemail.c b/camel/camel-movemail.c index f587914a31..b44c9edb1b 100644 --- a/camel/camel-movemail.c +++ b/camel/camel-movemail.c @@ -53,8 +53,10 @@ static void movemail_external (const char *source, const char *dest, #endif /* these could probably be exposed as a utility? (but only mbox needs it) */ +#if 0 static int camel_movemail_copy_filter(int fromfd, int tofd, off_t start, size_t bytes, CamelMimeFilter *filter); static int camel_movemail_copy(int fromfd, int tofd, off_t start, size_t bytes); +#endif /** * camel_movemail: Copy an mbox file from a shared spool directory to a @@ -352,6 +354,7 @@ movemail_external (const char *source, const char *dest, CamelException *ex) #endif +#if 0 static int camel_movemail_copy(int fromfd, int tofd, off_t start, size_t bytes) { @@ -399,9 +402,11 @@ camel_movemail_copy(int fromfd, int tofd, off_t start, size_t bytes) return written; } +#endif #define PRE_SIZE (32) +#if 0 static int camel_movemail_copy_filter(int fromfd, int tofd, off_t start, size_t bytes, CamelMimeFilter *filter) { @@ -582,4 +587,4 @@ fail: return -1; } - +#endif diff --git a/camel/camel-multipart.c b/camel/camel-multipart.c index ebbad07047..1d0446842c 100644 --- a/camel/camel-multipart.c +++ b/camel/camel-multipart.c @@ -1,7 +1,9 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* camel-multipart.c : Abstract class for a multipart */ +#ifndef NO_WARNINGS #warning This should be a mostly abstract class, but it is not! +#endif /* * diff --git a/camel/camel-object.c b/camel/camel-object.c index 849d47612e..69582570f0 100644 --- a/camel/camel-object.c +++ b/camel/camel-object.c @@ -742,7 +742,7 @@ camel_object_unhook_event (CamelObject * obj, const gchar * name, g_free (hooklist->data); head = g_slist_remove_link (head, hooklist); g_slist_free_1 (hooklist); - g_hash_table_insert (obj->event_to_hooklist, name, + g_hash_table_insert (obj->event_to_hooklist, (char *) name, head); return; } diff --git a/camel/camel-stream-mem.c b/camel/camel-stream-mem.c index f5dab54a41..77941894b7 100644 --- a/camel/camel-stream-mem.c +++ b/camel/camel-stream-mem.c @@ -182,7 +182,9 @@ stream_write (CamelStream *stream, const char *buffer, size_t n) if (seekable->bound_end != CAMEL_STREAM_UNBOUND) nwrite = MIN(seekable->bound_end - seekable->position, n); +#ifndef NO_WARNINGS #warning "g_byte_arrays use g_malloc and so are totally unsuitable for this object" +#endif if (seekable->position == stream_mem->buffer->len) { stream_mem->buffer = g_byte_array_append (stream_mem->buffer, (const guint8 *)buffer, nwrite); diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c index 4ac9c5fcf1..00921637eb 100644 --- a/camel/providers/mbox/camel-mbox-folder.c +++ b/camel/providers/mbox/camel-mbox-folder.c @@ -563,7 +563,7 @@ mbox_set_message_flags(CamelFolder *folder, const char *uid, guint32 flags, guin info->flags = (info->flags & ~flags) | (set & flags) | CAMEL_MESSAGE_FOLDER_FLAGGED; camel_folder_summary_touch(CAMEL_FOLDER_SUMMARY(mf->summary)); - camel_object_trigger_event(CAMEL_OBJECT(folder), "message_changed", uid); + camel_object_trigger_event(CAMEL_OBJECT(folder), "message_changed", (char *) uid); } static gboolean @@ -590,5 +590,5 @@ mbox_set_message_user_flag(CamelFolder *folder, const char *uid, const char *nam camel_flag_set(&info->user_flags, name, value); info->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED; camel_folder_summary_touch(CAMEL_FOLDER_SUMMARY(mf->summary)); - camel_object_trigger_event(CAMEL_OBJECT(folder), "message_changed", uid); + camel_object_trigger_event(CAMEL_OBJECT(folder), "message_changed", (char *) uid); } diff --git a/camel/providers/mbox/camel-mbox-summary.c b/camel/providers/mbox/camel-mbox-summary.c index b656205b1a..2a297594d7 100644 --- a/camel/providers/mbox/camel-mbox-summary.c +++ b/camel/providers/mbox/camel-mbox-summary.c @@ -243,9 +243,11 @@ message_info_load (CamelFolderSummary *s, FILE *in) mi = ((CamelFolderSummaryClass *)camel_mbox_summary_parent)->message_info_load (s, in); if (mi) { + guint32 position; CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *)mi; - camel_folder_summary_decode_uint32 (in, &mbi->frompos); + camel_folder_summary_decode_uint32 (in, &position); + mbi->frompos = position; } return mi; diff --git a/camel/providers/mh/camel-mh-folder.c b/camel/providers/mh/camel-mh-folder.c index e20b3fabb5..6b78df9b14 100644 --- a/camel/providers/mh/camel-mh-folder.c +++ b/camel/providers/mh/camel-mh-folder.c @@ -470,7 +470,7 @@ static void mh_set_message_flags(CamelFolder * folder, const char *uid, guint32 info->flags = (info->flags & ~flags) | (set & flags) | CAMEL_MESSAGE_FOLDER_FLAGGED; camel_folder_summary_touch(CAMEL_FOLDER_SUMMARY(mf->summary)); - camel_object_trigger_event (CAMEL_OBJECT(folder), "message_changed", uid); + camel_object_trigger_event (CAMEL_OBJECT(folder), "message_changed", (char *) uid); } static gboolean mh_get_message_user_flag(CamelFolder * folder, const char *uid, const char *name) @@ -495,5 +495,5 @@ static void mh_set_message_user_flag(CamelFolder * folder, const char *uid, cons camel_flag_set(&info->user_flags, name, value); info->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED; camel_folder_summary_touch(CAMEL_FOLDER_SUMMARY(mf->summary)); - camel_object_trigger_event (CAMEL_OBJECT(folder), "message_changed", uid); + camel_object_trigger_event (CAMEL_OBJECT(folder), "message_changed", (char *) uid); } diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index 83241b2cad..0486e4da75 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -265,6 +265,8 @@ esmtp_get_authtypes (gchar *buffer) return ret; } +/* FIXME: use these? */ +#ifdef notyet static CamelServiceAuthType no_authtype = { "No authentication required", @@ -285,6 +287,7 @@ static CamelServiceAuthType cram_md5_authtype = { "CRAM-MD5", TRUE }; +#endif static GList * query_auth_types (CamelService *service, CamelException *ex) |