Re: [evolution-patches] Cleanups for e-d-s/camel



On Mon, 2006-04-10 at 14:30 +0200, Kjartan Maraas wrote:
> Here's a patch that tries to deal with a bunch of warnings from
> icc/sparse/gcc.
> 
> Cheers
> Kjartan
> 

The new patch (minus the GW changes, since I don't feel qualified to
review that part of the patch) is attached. I'll be committing this in a
sec (camel-charset-map-private.h is auto-generated but I've updated
camel-charset-map.c's code that generates it to use NULL instead of 0)

As I was reviewing your patch, I found a couple of real bugs as well.

Jeff

? kmaraas.patch
Index: camel-block-file.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-block-file.c,v
retrieving revision 1.21
diff -u -r1.21 camel-block-file.c
--- camel-block-file.c	30 Nov 2005 09:54:54 -0000	1.21
+++ camel-block-file.c	12 Apr 2006 18:13:30 -0000
@@ -83,14 +83,14 @@
 static int
 block_file_validate_root(CamelBlockFile *bs)
 {
-	struct stat st;
 	CamelBlockRoot *br;
-	int s;
-
+	struct stat st;
+	int retval;
+	
 	br = bs->root;
-
-	s = fstat(bs->fd, &st);
-
+	
+	retval = fstat (bs->fd, &st);
+	
 	d(printf("Validate root: '%s'\n", bs->path));
 	d(printf("version: %.8s (%.8s)\n", bs->root->version, bs->version));
 	d(printf("block size: %d (%d)%s\n", br->block_size, bs->block_size,
@@ -106,12 +106,12 @@
 	    || br->block_size != bs->block_size
 	    || (br->free % bs->block_size) != 0
 	    || (br->last % bs->block_size) != 0
-	    || fstat(bs->fd, &st) == -1
+	    || retval == -1
 	    || st.st_size != br->last
 	    || br->free > st.st_size
 	    || (br->flags & CAMEL_BLOCK_FILE_SYNC) == 0) {
 #if 0
-		if (s != -1 && st.st_size > 0) {
+		if (retval != -1 && st.st_size > 0) {
 			g_warning("Invalid root: '%s'", bs->path);
 			g_warning("version: %.8s (%.8s)", bs->root->version, bs->version);
 			g_warning("block size: %d (%d)%s", br->block_size, bs->block_size,
@@ -218,7 +218,7 @@
 	bn = bl->next;
 	while (bn) {
 		if (bl->refcount != 0)
-			g_warning("Block '%d' still referenced", bl->id);
+			g_warning("Block '%u' still referenced", bl->id);
 		g_free(bl);
 		bl = bn;
 		bn = bn->next;
Index: camel-charset-map.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-charset-map.c,v
retrieving revision 1.45
diff -u -r1.45 camel-charset-map.c
--- camel-charset-map.c	31 Aug 2005 04:21:56 -0000	1.45
+++ camel-charset-map.c	12 Apr 2006 18:13:30 -0000
@@ -168,7 +168,7 @@
 			if (j < 256) {
 				printf("m%02x%x, ", i, k);
 			} else {
-				printf("0, ");
+				printf("NULL, ");
 			}
 		}
 		printf("}, ");
@@ -222,9 +222,10 @@
 void
 camel_charset_step (CamelCharset *cc, const char *in, int len)
 {
+	const unsigned char *inptr = (const unsigned char *) in;
+	const unsigned char *inend = inptr + len;
 	register unsigned int mask;
 	register int level;
-	const unsigned char *inptr = in, *inend = in+len;
 	register guint32 c;
 
 	mask = cc->mask;
Index: camel-exception.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-exception.c,v
retrieving revision 1.32
diff -u -r1.32 camel-exception.c
--- camel-exception.c	2 Dec 2005 08:54:44 -0000	1.32
+++ camel-exception.c	12 Apr 2006 18:13:30 -0000
@@ -156,12 +156,10 @@
  * simply returns.
  **/
 void
-camel_exception_set (CamelException *ex,
-		     ExceptionId id,
-		     const char *desc)
+camel_exception_set (CamelException *ex, ExceptionId id, const char *desc)
 {
 	if (camel_debug("exception"))
-		printf("CamelException.set(%p, %d, '%s')\n", ex, id, desc);
+		printf("CamelException.set(%p, %u, '%s')\n", ex, id, desc);
 
 	if (!ex)
 		return;
@@ -199,10 +197,7 @@
  * simply returns.
  **/
 void
-camel_exception_setv (CamelException *ex,
-		      ExceptionId id,
-		      const char *format, 
-		      ...)
+camel_exception_setv (CamelException *ex, ExceptionId id, const char *format, ...)
 {
 	va_list args;
 	char *desc;
@@ -212,7 +207,7 @@
 	va_end (args);
 
 	if (camel_debug("exception"))
-		printf("CamelException.setv(%p, %d, '%s')\n", ex, id, desc);
+		printf("CamelException.setv(%p, %u, '%s')\n", ex, id, desc);
 	
 	if (!ex) {
 		g_free(desc);
Index: camel-filter-driver.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-filter-driver.c,v
retrieving revision 1.95
diff -u -r1.95 camel-filter-driver.c
--- camel-filter-driver.c	13 Dec 2005 04:37:10 -0000	1.95
+++ camel-filter-driver.c	12 Apr 2006 18:13:30 -0000
@@ -1218,7 +1218,7 @@
 	if (mp)
 		camel_object_unref (mp);
 	
-	return -1;
+	return ret;
 }
 
 
Index: camel-folder-search.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-folder-search.c,v
retrieving revision 1.76
diff -u -r1.76 camel-folder-search.c
--- camel-folder-search.c	25 Jan 2006 08:28:32 -0000	1.76
+++ camel-folder-search.c	12 Apr 2006 18:13:30 -0000
@@ -182,7 +182,7 @@
 #define CAMEL_STRUCT_OFFSET(type, field)        ((gint) ((gchar*) &((type *) 0)->field))
 #endif
 
-struct {
+static struct {
 	char *name;
 	int offset;
 	int flags;		/* 0x02 = immediate, 0x01 = always enter */
Index: camel-folder-summary.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-folder-summary.c,v
retrieving revision 1.147
diff -u -r1.147 camel-folder-summary.c
--- camel-folder-summary.c	2 Feb 2006 05:38:25 -0000	1.147
+++ camel-folder-summary.c	12 Apr 2006 18:13:30 -0000
@@ -1858,7 +1858,7 @@
 	
 	charset = e_iconv_locale_charset ();
 	ci->id = camel_header_msgid_decode (camel_header_raw_find (&h, "content-id", NULL));
-	ci->description = camel_header_decode_string (camel_header_raw_find (&h, "content-description", NULL), NULL);
+	ci->description = camel_header_decode_string (camel_header_raw_find (&h, "content-description", NULL), charset);
 	ci->encoding = camel_content_transfer_encoding_decode (camel_header_raw_find (&h, "content-transfer-encoding", NULL));
 	ci->type = camel_content_type_decode(camel_header_raw_find(&h, "content-type", NULL));
 
@@ -1976,7 +1976,6 @@
 	char *buffer;
 	CamelMessageContentInfo *info = NULL;
 	CamelContentType *ct;
-	int body;
 	int enc_id = -1, chr_id = -1, html_id = -1, idx_id = -1;
 	struct _CamelFolderSummaryPrivate *p = _PRIVATE(s);
 	CamelMimeFilterCharset *mfc;
@@ -1986,8 +1985,7 @@
 
 	/* start of this part */
 	state = camel_mime_parser_step(mp, &buffer, &len);
-	body = camel_mime_parser_tell(mp);
-
+	
 	if (s->build_content)
 		info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_new_from_parser(s, mp);
 
@@ -2516,7 +2514,7 @@
 	*list = NULL;
 }
 
-struct flag_names_t {
+static struct flag_names_t {
 	char *name;
 	guint32 value;
 } flag_names[] = {
Index: camel-folder.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-folder.c,v
retrieving revision 1.213
diff -u -r1.213 camel-folder.c
--- camel-folder.c	13 Dec 2005 13:34:16 -0000	1.213
+++ camel-folder.c	12 Apr 2006 18:13:31 -0000
@@ -1634,9 +1634,9 @@
 };
 
 static void
-filter_filter(CamelSession *session, CamelSessionThreadMsg *msg)
+filter_filter(CamelSession *session, CamelSessionThreadMsg *tmsg)
 {
-	struct _folder_filter_msg *m = (struct _folder_filter_msg *)msg;
+	struct _folder_filter_msg *m = (struct _folder_filter_msg *) tmsg;
 	CamelMessageInfo *info;
 	int i, status = 0;
 	CamelURL *uri;
Index: camel-gpg-context.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-gpg-context.c,v
retrieving revision 1.77
diff -u -r1.77 camel-gpg-context.c
--- camel-gpg-context.c	2 Feb 2006 08:37:46 -0000	1.77
+++ camel-gpg-context.c	12 Apr 2006 18:13:31 -0000
@@ -404,7 +404,7 @@
 		g_byte_array_append (gpg->diagbuf, "", 1);
 	}
 	
-	return gpg->diagbuf->data;
+	return (const char *) gpg->diagbuf->data;
 }
 
 static void
Index: camel-http-stream.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-http-stream.c,v
retrieving revision 1.21
diff -u -r1.21 camel-http-stream.c
--- camel-http-stream.c	15 Sep 2005 12:33:22 -0000	1.21
+++ camel-http-stream.c	12 Apr 2006 18:13:31 -0000
@@ -326,7 +326,7 @@
 		
 		break;
 	default:
-		g_warning ("Invalid state encountered???: %d", camel_mime_parser_state (http->parser));
+		g_warning ("Invalid state encountered???: %u", camel_mime_parser_state (http->parser));
 	}
 	
 	err = camel_mime_parser_errno (http->parser);
@@ -532,7 +532,7 @@
 		http_disconnect(http);
 
 	return 0;
-};
+}
 
 CamelContentType *
 camel_http_stream_get_content_type (CamelHttpStream *http_stream)
Index: camel-internet-address.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-internet-address.c,v
retrieving revision 1.34
diff -u -r1.34 camel-internet-address.c
--- camel-internet-address.c	31 Aug 2005 04:21:56 -0000	1.34
+++ camel-internet-address.c	12 Apr 2006 18:13:31 -0000
@@ -459,7 +459,7 @@
 char *
 camel_internet_address_encode_address(int *inlen, const char *real, const char *addr)
 {
-	char *name = camel_header_encode_phrase(real);
+	char *name = camel_header_encode_phrase ((const unsigned char *) real);
 	char *ret = NULL;
 	int len = 0;
 	GString *out = g_string_new("");
Index: camel-list-utils.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-list-utils.c,v
retrieving revision 1.3
diff -u -r1.3 camel-list-utils.c
--- camel-list-utils.c	31 Aug 2005 04:21:56 -0000	1.3
+++ camel-list-utils.c	12 Apr 2006 18:13:31 -0000
@@ -38,7 +38,7 @@
 void camel_dlist_init(CamelDList *v)
 {
         v->head = (CamelDListNode *)&v->tail;
-        v->tail = 0;
+        v->tail = NULL;
         v->tailpred = (CamelDListNode *)&v->head;
 }
 
Index: camel-lock-helper.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-lock-helper.c,v
retrieving revision 1.7
diff -u -r1.7 camel-lock-helper.c
--- camel-lock-helper.c	31 Aug 2005 04:21:56 -0000	1.7
+++ camel-lock-helper.c	12 Apr 2006 18:13:31 -0000
@@ -188,7 +188,7 @@
 	info->id = lock_id;
 	info->depth = 1;
 	info->next = lock_info_list;
-	info->stamp = time(0);
+	info->stamp = time (NULL);
 	lock_info_list = info;
 
 	if (lockid)
@@ -306,7 +306,7 @@
 
 		/* check the minimum timeout we need to refresh the next oldest lock */
 		if (lock_info_list) {
-			time_t now = time(0);
+			time_t now = time (NULL);
 			time_t left;
 			time_t delay = CAMEL_DOT_LOCK_REFRESH;
 
@@ -332,7 +332,7 @@
 
 		/* did we get a timeout?  scan for any locks that need updating */
 		if (!FD_ISSET(STDIN_FILENO, &rset)) {
-			time_t now = time(0);
+			time_t now = time (NULL);
 			time_t left;
 
 			d(fprintf(stderr, "Got a timeout, checking locks\n"));
Index: camel-lock.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-lock.c,v
retrieving revision 1.20
diff -u -r1.20 camel-lock.c
--- camel-lock.c	13 Dec 2005 04:50:18 -0000	1.20
+++ camel-lock.c	12 Apr 2006 18:13:31 -0000
@@ -141,7 +141,7 @@
 
 		/* check for stale lock, kill it */
 		if (stat(lock, &st) == 0) {
-			time_t now = time(0);
+			time_t now = time (NULL);
 			(printf("There is an existing lock %ld seconds old\n", now-st.st_ctime));
 			if (st.st_ctime < now - CAMEL_LOCK_DOT_STALE) {
 				d(printf("Removing it now\n"));
Index: camel-mime-filter-basic.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-mime-filter-basic.c,v
retrieving revision 1.22
diff -u -r1.22 camel-mime-filter-basic.c
--- camel-mime-filter-basic.c	6 Dec 2005 04:21:54 -0000	1.22
+++ camel-mime-filter-basic.c	12 Apr 2006 18:13:31 -0000
@@ -138,7 +138,7 @@
 		}
 		break;
 	default:
-		g_warning("unknown type %d in CamelMimeFilterBasic", f->type);
+		g_warning ("unknown type %u in CamelMimeFilterBasic", f->type);
 		goto donothing;
 	}
 
@@ -236,7 +236,7 @@
 		}
 		break;
 	default:
-		g_warning("unknown type %d in CamelMimeFilterBasic", f->type);
+		g_warning ("unknown type %u in CamelMimeFilterBasic", f->type);
 		goto donothing;
 	}
 
@@ -291,7 +291,7 @@
 		new->type = type;
 		break;
 	default:
-		g_warning("Invalid type of CamelMimeFilterBasic requested: %d", type);
+		g_warning ("Invalid type of CamelMimeFilterBasic requested: %u", type);
 		new = NULL;
 		break;
 	}
Index: camel-mime-filter-gzip.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-mime-filter-gzip.c,v
retrieving revision 1.3
diff -u -r1.3 camel-mime-filter-gzip.c
--- camel-mime-filter-gzip.c	31 Aug 2005 04:21:56 -0000	1.3
+++ camel-mime-filter-gzip.c	12 Apr 2006 18:13:31 -0000
@@ -205,12 +205,12 @@
 			fprintf (stderr, "gzip: %d: %s\n", retval, priv->stream->msg);
 		
 		if (flush == Z_FULL_FLUSH) {
-			size_t outlen;
+			size_t n;
 			
-			outlen = filter->outsize - priv->stream->avail_out;
-			camel_mime_filter_set_size (filter, outlen + (priv->stream->avail_in * 2) + 12, TRUE);
-			priv->stream->avail_out = filter->outsize - outlen;
-			priv->stream->next_out = filter->outbuf + outlen;
+			n = filter->outsize - priv->stream->avail_out;
+			camel_mime_filter_set_size (filter, n + (priv->stream->avail_in * 2) + 12, TRUE);
+			priv->stream->avail_out = filter->outsize - n;
+			priv->stream->next_out = filter->outbuf + n;
 			
 			if (priv->stream->avail_in == 0) {
 				guint32 val;
@@ -358,17 +358,17 @@
 			fprintf (stderr, "gunzip: %d: %s\n", retval, priv->stream->msg);
 		
 		if (flush == Z_FULL_FLUSH) {
-			size_t outlen;
+			size_t n;
 			
 			if (priv->stream->avail_in == 0) {
 				/* FIXME: extract & compare calculated crc32 and isize values? */
 				break;
 			}
 			
-			outlen = filter->outsize - priv->stream->avail_out;
-			camel_mime_filter_set_size (filter, outlen + (priv->stream->avail_in * 2) + 12, TRUE);
-			priv->stream->avail_out = filter->outsize - outlen;
-			priv->stream->next_out = filter->outbuf + outlen;
+			n = filter->outsize - priv->stream->avail_out;
+			camel_mime_filter_set_size (filter, n + (priv->stream->avail_in * 2) + 12, TRUE);
+			priv->stream->avail_out = filter->outsize - n;
+			priv->stream->next_out = filter->outbuf + n;
 		} else {
 			priv->stream->avail_in += 8;
 			
Index: camel-mime-filter-html.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-mime-filter-html.c,v
retrieving revision 1.7
diff -u -r1.7 camel-mime-filter-html.c
--- camel-mime-filter-html.c	31 Aug 2005 04:21:56 -0000	1.7
+++ camel-mime-filter-html.c	12 Apr 2006 18:13:31 -0000
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  *  Copyright (C) 2001 Ximian Inc.
  *
@@ -111,19 +112,19 @@
 }
 
 static void
-run(CamelMimeFilter *mf, char *in, size_t len, size_t prespace, char **out, size_t *outlenptr, size_t *outprespace, int last)
+run(CamelMimeFilter *mf, char *in, size_t inlen, size_t prespace, char **out, size_t *outlenptr, size_t *outprespace, int last)
 {
+	CamelMimeFilterHTML *f = (CamelMimeFilterHTML *) mf;
 	camel_html_parser_t state;
 	char *outp;
-	CamelMimeFilterHTML *f = (CamelMimeFilterHTML *)mf;
-
-	d(printf("converting html:\n%.*s\n", (int)len, in));
+	
+	d(printf("converting html:\n%.*s\n", (int)inlen, in));
 	
 	/* We should generally shrink the data, but this'll do */
-	camel_mime_filter_set_size(mf, len*2+256, FALSE);
+	camel_mime_filter_set_size (mf, inlen * 2 + 256, FALSE);
 	outp = mf->outbuf;
-
-	camel_html_parser_set_data(f->priv->ctxt, in, len, last);
+	
+	camel_html_parser_set_data (f->priv->ctxt, in, inlen, last);
 	do {
 		const char *data;
 		int len;
Index: camel-mime-filter-linewrap.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-mime-filter-linewrap.c,v
retrieving revision 1.6
diff -u -r1.6 camel-mime-filter-linewrap.c
--- camel-mime-filter-linewrap.c	31 Aug 2005 04:21:56 -0000	1.6
+++ camel-mime-filter-linewrap.c	12 Apr 2006 18:13:31 -0000
@@ -71,7 +71,7 @@
 	char **out, size_t *outlen, size_t *outprespace)
 {
 	CamelMimeFilterLinewrap *linewrap = (CamelMimeFilterLinewrap *)f;
-	char *inend, *last, *p, *q;
+	char *inend, *p, *q;
 	int nchars = linewrap->nchars;
 	
 	/* we'll be adding chars here so we need a bigger buffer */
@@ -83,12 +83,9 @@
 	
 	while (p < inend) {
 		if (*p == '\n') {
-			last = q;
 			*q++ = *p++;
 			nchars = 0;
 		} else if (isspace (*p)) {
-			last = q;
-			
 			if (nchars >= linewrap->wrap_len) {
 				*q++ = '\n';
 				p++;
Index: camel-mime-filter-tohtml.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-mime-filter-tohtml.c,v
retrieving revision 1.21
diff -u -r1.21 camel-mime-filter-tohtml.c
--- camel-mime-filter-tohtml.c	21 Feb 2006 12:04:46 -0000	1.21
+++ camel-mime-filter-tohtml.c	12 Apr 2006 18:13:31 -0000
@@ -165,13 +165,13 @@
 {
 	CamelMimeFilterToHTML *html = (CamelMimeFilterToHTML *) filter;
 	const char *inptr = in;
-
+	
 	while (inptr < inend) {
 		guint32 u;
-
+		
 		outptr = check_size (filter, outptr, outend, 16);
-
-		u = camel_utf8_getc_limit ((const unsigned char **) &inptr, inend);
+		
+		u = camel_utf8_getc_limit ((const unsigned char **) &inptr, (const unsigned char *) inend);
 		switch (u) {
 		case 0xffff:
 			g_warning("Truncated utf8 buffer");
Index: camel-mime-filter-yenc.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-mime-filter-yenc.c,v
retrieving revision 1.4
diff -u -r1.4 camel-mime-filter-yenc.c
--- camel-mime-filter-yenc.c	31 Aug 2005 04:21:56 -0000	1.4
+++ camel-mime-filter-yenc.c	12 Apr 2006 18:13:31 -0000
@@ -416,7 +416,7 @@
 camel_ydecode_step (const unsigned char *in, size_t inlen, unsigned char *out,
 		    int *state, guint32 *pcrc, guint32 *crc)
 {
-	const register unsigned char *inptr;
+	register const unsigned char *inptr;
 	register unsigned char *outptr;
 	const unsigned char *inend;
 	unsigned char ch;
@@ -496,7 +496,7 @@
 camel_yencode_step (const unsigned char *in, size_t inlen, unsigned char *out,
 		    int *state, guint32 *pcrc, guint32 *crc)
 {
-	const register unsigned char *inptr;
+	register const unsigned char *inptr;
 	register unsigned char *outptr;
 	const unsigned char *inend;
 	register int already;
Index: camel-mime-message.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-mime-message.c,v
retrieving revision 1.137
diff -u -r1.137 camel-mime-message.c
--- camel-mime-message.c	1 Dec 2005 11:50:59 -0000	1.137
+++ camel-mime-message.c	12 Apr 2006 18:13:31 -0000
@@ -600,7 +600,7 @@
 	case CAMEL_MIME_PARSER_STATE_MESSAGE_END:
 		break;
 	default:
-		g_error ("Bad parser state: Expecing MESSAGE_END or EOF or EOM, got: %d", camel_mime_parser_state (mp));
+		g_error ("Bad parser state: Expecing MESSAGE_END or EOF or EOM, got: %u", camel_mime_parser_state (mp));
 		camel_mime_parser_unstep (mp);
 		return -1;
 	}
@@ -762,9 +762,9 @@
 	if (CAMEL_IS_MULTIPART (containee)) {
 		parts = camel_multipart_get_number (CAMEL_MULTIPART (containee));
 		for (i = 0; go && i < parts; i++) {
-			CamelMimePart *part = camel_multipart_get_part (CAMEL_MULTIPART (containee), i);
+			CamelMimePart *mpart = camel_multipart_get_part (CAMEL_MULTIPART (containee), i);
 			
-			go = message_foreach_part_rec (msg, part, callback, data);
+			go = message_foreach_part_rec (msg, mpart, callback, data);
 		}
 	} else if (CAMEL_IS_MIME_MESSAGE (containee)) {
 		go = message_foreach_part_rec (msg, (CamelMimePart *)containee, callback, data);
@@ -1176,9 +1176,9 @@
 	if (CAMEL_IS_MULTIPART(containee)) {
 		parts = camel_multipart_get_number((CamelMultipart *)containee);
 		for (i = 0; go && i < parts; i++) {
-			CamelMimePart *part = camel_multipart_get_part((CamelMultipart *)containee, i);
-
-			cmm_dump_rec(msg, part, body, depth+2);
+			CamelMimePart *mpart = camel_multipart_get_part((CamelMultipart *)containee, i);
+			
+			cmm_dump_rec(msg, mpart, body, depth+2);
 		}
 	} else if (CAMEL_IS_MIME_MESSAGE(containee)) {
 		cmm_dump_rec(msg, (CamelMimePart *)containee, body, depth+2);
Index: camel-mime-parser.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-mime-parser.c,v
retrieving revision 1.67
diff -u -r1.67 camel-mime-parser.c
--- camel-mime-parser.c	30 Nov 2005 09:54:54 -0000	1.67
+++ camel-mime-parser.c	12 Apr 2006 18:13:31 -0000
@@ -370,7 +370,7 @@
 	if (array->len == 0 || array->data[array->len-1] != '\0')
 		g_byte_array_append(array, "", 1);
 
-	return array->data;
+	return (const char *) array->data;
 }
 
 /**
@@ -1151,11 +1151,11 @@
 	if (headerlen > 0) {									\
 		if (headerlen >= (s->outend - s->outptr)) {					\
 			register char *outnew;							\
-			register int len = ((s->outend - s->outbuf)+headerlen)*2+1;		\
-			outnew = g_realloc(s->outbuf, len);					\
+			register int olen = ((s->outend - s->outbuf) + headerlen) * 2 + 1;	\
+			outnew = g_realloc(s->outbuf, olen);					\
 			s->outptr = s->outptr - s->outbuf + outnew;				\
 			s->outbuf = outnew;							\
-			s->outend = outnew + len;						\
+			s->outend = outnew + olen;						\
 		}										\
 		if (start[headerlen-1] == '\r')							\
 			headerlen--;								\
@@ -1762,7 +1762,7 @@
 		return;
 
 	default:
-		g_warning("Invalid state in camel-mime-parser: %d", s->state);
+		g_warning ("Invalid state in camel-mime-parser: %u", s->state);
 		break;
 	}
 
Index: camel-mime-part-utils.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-mime-part-utils.c,v
retrieving revision 1.103
diff -u -r1.103 camel-mime-part-utils.c
--- camel-mime-part-utils.c	6 Dec 2005 04:21:54 -0000	1.103
+++ camel-mime-part-utils.c	12 Apr 2006 18:13:31 -0000
@@ -120,7 +120,7 @@
 		d(printf("Created multi-part\n"));
 		break;
 	default:
-		g_warning("Invalid state encountered???: %d", camel_mime_parser_state (mp));
+		g_warning("Invalid state encountered???: %u", camel_mime_parser_state (mp));
 	}
 	
 	if (content) {
Index: camel-mime-part.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-mime-part.c,v
retrieving revision 1.170
diff -u -r1.170 camel-mime-part.c
--- camel-mime-part.c	15 Sep 2005 17:35:45 -0000	1.170
+++ camel-mime-part.c	12 Apr 2006 18:13:31 -0000
@@ -961,7 +961,7 @@
 		camel_mime_part_construct_content_from_parser (mime_part, mp);
 		break;
 	default:
-		g_warning("Invalid state encountered???: %d", camel_mime_parser_state(mp));
+		g_warning("Invalid state encountered???: %u", camel_mime_parser_state(mp));
 	}
 
 	d(printf("mime_part::construct_from_parser() leaving\n"));
Index: camel-mime-utils.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-mime-utils.c,v
retrieving revision 1.235.2.1
diff -u -r1.235.2.1 camel-mime-utils.c
--- camel-mime-utils.c	21 Mar 2006 10:44:53 -0000	1.235.2.1
+++ camel-mime-utils.c	12 Apr 2006 18:13:31 -0000
@@ -2258,19 +2258,18 @@
 static char *
 header_decode_domain(const char **in)
 {
-	const char *inptr = *in, *start;
+	const char *inptr = *in;
 	int go = TRUE;
 	char *ret;
 	GString *domain = g_string_new("");
 
-				/* domain ref | domain literal */
+	/* domain ref | domain literal */
 	header_decode_lwsp(&inptr);
 	while (go) {
 		if (*inptr == '[') { /* domain literal */
 			domain = g_string_append_c(domain, '[');
 			inptr++;
 			header_decode_lwsp(&inptr);
-			start = inptr;
 			while (camel_mime_is_dtext(*inptr)) {
 				domain = g_string_append_c(domain, *inptr);
 				inptr++;
@@ -3208,7 +3207,8 @@
 	const char *charset;
 	GString *out;
 	guint32 c;
-
+	char *str;
+	
 	*encoded = FALSE;
 	
 	g_return_val_if_fail (in != NULL, NULL);
@@ -3238,11 +3238,11 @@
 	}
 	g_free (outbuf);
 	
-	outbuf = out->str;
+	str = out->str;
 	g_string_free (out, FALSE);
 	*encoded = TRUE;
 	
-	return outbuf;
+	return str;
 }
 
 void
@@ -4070,23 +4070,23 @@
 			match[j].rm_eo = -1;
 		}
 		if (v != NULL && regexec (&mail_list_magic[i].regex, v, 3, match, 0) == 0 && match[1].rm_so != -1) {
-			char *list;
 			int len1, len2;
-
+			char *mlist;
+			
 			len1 = match[1].rm_eo - match[1].rm_so;
 			len2 = match[2].rm_eo - match[2].rm_so;
-
-			list = g_malloc(len1+len2+2);
-			memcpy(list, v + match[1].rm_so, len1);
+			
+			mlist = g_malloc (len1 + len2 + 2);
+			memcpy (mlist, v + match[1].rm_so, len1);
 			if (len2) {
 				list[len1] = '@';
-				memcpy(list+len1+1, v+match[2].rm_so, len2);
-				list[len1+len2+1]=0;
+				memcpy (mlist + len1 + 1, v + match[2].rm_so, len2);
+				mlist[len1 + len2 + 1] = '\0';
 			} else {
-				list[len1] = 0;
+				mlist[len1] = '\0';
 			}
-
-			return list;
+			
+			return mlist;
 		}
 	}
 
Index: camel-multipart-signed.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-multipart-signed.c,v
retrieving revision 1.31
diff -u -r1.31 camel-multipart-signed.c
--- camel-multipart-signed.c	6 Dec 2005 04:21:54 -0000	1.31
+++ camel-multipart-signed.c	12 Apr 2006 18:13:31 -0000
@@ -207,7 +207,7 @@
 		case CAMEL_MIME_PARSER_STATE_MESSAGE_END:
 			break;
 		default:
-			g_error ("Bad parser state: Expecing MESSAGE_END or EOF or EOM, got: %d", camel_mime_parser_state (cmp));
+			g_error ("Bad parser state: Expecting MESSAGE_END or EOF or EOM, got: %u", camel_mime_parser_state (cmp));
 			camel_mime_parser_unstep(cmp);
 			return -1;
 		}
@@ -218,7 +218,7 @@
 			skip_content(cmp);
 		break;
 	default:
-		g_warning("Invalid state encountered???: %d", camel_mime_parser_state(cmp));
+		g_warning("Invalid state encountered???: %u", camel_mime_parser_state (cmp));
 	}
 
 	return 0;
@@ -233,7 +233,6 @@
 	const char *boundary;
 	char *buf;
 	size_t len;
-	off_t head = -1, tail = -1;
 	int state;
 
 	boundary = camel_multipart_get_boundary(mp);
@@ -264,7 +263,6 @@
 
 	while ((state = camel_mime_parser_step(cmp, &buf, &len)) != CAMEL_MIME_PARSER_STATE_MULTIPART_END) {
 		if (mps->start1 == -1) {
-			head = camel_mime_parser_tell_start_boundary(cmp);
 			mps->start1 = camel_mime_parser_tell_start_headers(cmp);
 		} else if (mps->start2 == -1) {
 			mps->start2 = camel_mime_parser_tell_start_headers(cmp);
@@ -284,8 +282,7 @@
 
 	if (state == CAMEL_MIME_PARSER_STATE_MULTIPART_END) {
 		mps->end2 = camel_mime_parser_tell_start_boundary(cmp);
-		tail = camel_mime_parser_tell(cmp);
-
+		
 		camel_multipart_set_preface(mp, camel_mime_parser_preface(cmp));
 		camel_multipart_set_postface(mp, camel_mime_parser_postface(cmp));
 	}
Index: camel-object.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-object.c,v
retrieving revision 1.59
diff -u -r1.59 camel-object.c
--- camel-object.c	2 Feb 2006 05:38:25 -0000	1.59
+++ camel-object.c	12 Apr 2006 18:13:31 -0000
@@ -1353,7 +1353,7 @@
 	g_return_if_fail (id != 0);
 
 	if (obj->hooks == NULL) {
-		g_warning("camel_object_unhook_event: trying to unhook `%d` from an instance of `%s' with no hooks",
+		g_warning("camel_object_unhook_event: trying to unhook `%u` from an instance of `%s' with no hooks",
 			  id, obj->klass->name);
 		return;
 	}
@@ -1383,7 +1383,7 @@
 	}
 	camel_object_unget_hooks(obj);
 
-	g_warning("camel_object_unhook_event: cannot find hook id %d in instance of `%s'",
+	g_warning("camel_object_unhook_event: cannot find hook id %u in instance of `%s'",
 		  id, obj->klass->name);
 }
 
@@ -1458,8 +1458,7 @@
 	pair = co_find_pair_ptr(obj->klass, interface_name);
 	if (pair) {
 		GPtrArray *interfaces = pair->data;
-		int i;
-
+		
 		for (i=0;i<interfaces->len;i++) {
 			hook = co_find_pair(interfaces->pdata[i], name);
 			if (hook)
Index: camel-partition-table.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-partition-table.c,v
retrieving revision 1.10
diff -u -r1.10 camel-partition-table.c
--- camel-partition-table.c	31 Aug 2005 04:21:56 -0000	1.10
+++ camel-partition-table.c	12 Apr 2006 18:13:31 -0000
@@ -249,13 +249,10 @@
 camel_partition_table_sync(CamelPartitionTable *cpi)
 {
 	CamelBlock *bl, *bn;
-	struct _CamelPartitionTablePrivate *p;
 	int ret = 0;
-
+	
 	CAMEL_PARTITION_TABLE_LOCK(cpi, lock);
-
-	p = cpi->priv;
-
+	
 	if (cpi->blocks) {
 		bl = (CamelBlock *)cpi->partition.head;
 		bn = bl->next;
@@ -279,7 +276,6 @@
 	CamelPartitionMapBlock *ptb;
 	CamelBlock *block, *ptblock;
 	camel_hash_t hashid;
-	camel_key_t keyid = 0;
 	int index, i;
 
 	hashid = hash_key(key);
@@ -305,7 +301,6 @@
 		if (pkb->keys[i].hashid == hashid) {
 			/* !! need to: lookup and compare string value */
 			/* get_key() if key == key ... */
-			keyid = pkb->keys[i].keyid;
 			break;
 		}
 	}
Index: camel-provider.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-provider.h,v
retrieving revision 1.48
diff -u -r1.48 camel-provider.h
--- camel-provider.h	31 Aug 2005 04:21:56 -0000	1.48
+++ camel-provider.h	12 Apr 2006 18:13:31 -0000
@@ -219,7 +219,7 @@
 struct _CamelProviderModule {
 	char *path;
 	GSList *types;
-	int loaded:1;
+	guint loaded:1;
 };
 
 void camel_provider_init(void);
Index: camel-sasl-digest-md5.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-sasl-digest-md5.c,v
retrieving revision 1.28
diff -u -r1.28 camel-sasl-digest-md5.c
--- camel-sasl-digest-md5.c	6 Dec 2005 04:21:54 -0000	1.28
+++ camel-sasl-digest-md5.c	12 Apr 2006 18:13:31 -0000
@@ -764,7 +764,7 @@
 	
 	if (resp->maxbuf > 0) {
 		g_byte_array_append (buffer, ",maxbuf=", 8);
-		buf = g_strdup_printf ("%d", resp->maxbuf);
+		buf = g_strdup_printf ("%u", resp->maxbuf);
 		g_byte_array_append (buffer, buf, strlen (buf));
 		g_free (buf);
 	}
Index: camel-sasl-ntlm.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-sasl-ntlm.c,v
retrieving revision 1.5
diff -u -r1.5 camel-sasl-ntlm.c
--- camel-sasl-ntlm.c	6 Dec 2005 04:21:54 -0000	1.5
+++ camel-sasl-ntlm.c	12 Apr 2006 18:13:31 -0000
@@ -524,13 +524,12 @@
 	l ^= Spbox[3][(work >> 16) & 0x3f];\
 	l ^= Spbox[1][(work >> 24) & 0x3f];\
 }
+
 /* Encrypt or decrypt a block of data in ECB mode */
 static void
-des(ks,block)
-guint32 ks[16][2];	/* Key schedule */
-unsigned char block[8];		/* Data block */
+des (guint32 ks[16][2], unsigned char block[8])
 {
-	guint32 left,right,work;
+	guint32 left, right, work;
 	
 	/* Read input block and place in left/right in big-endian order */
 	left = ((guint32)block[0] << 24)
@@ -663,10 +662,7 @@
  * depending on the value of "decrypt"
  */
 static void
-deskey(k,key,decrypt)
-DES_KS k;			/* Key schedule array */
-unsigned char *key;		/* 64 bits (will use only 56) */
-int decrypt;			/* 0 = encrypt, 1 = decrypt */
+deskey (DES_KS k, unsigned char *key, int decrypt)
 {
 	unsigned char pc1m[56];		/* place to modify pc1 into */
 	unsigned char pcr[56];		/* place to rotate pc1 into */
Index: camel-search-private.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-search-private.c,v
retrieving revision 1.36.2.1
diff -u -r1.36.2.1 camel-search-private.c
--- camel-search-private.c	5 Apr 2006 03:20:56 -0000	1.36.2.1
+++ camel-search-private.c	12 Apr 2006 18:13:31 -0000
@@ -281,7 +281,7 @@
 			}
 			
 			if (nuni + npos == puni)
-				return p;
+				return (const char *) p;
 		}
 	}
 	
Index: camel-session.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-session.h,v
retrieving revision 1.53
diff -u -r1.53 camel-session.h
--- camel-session.h	22 Dec 2005 01:48:30 -0000	1.53
+++ camel-session.h	12 Apr 2006 18:13:31 -0000
@@ -66,9 +66,9 @@
 	char *storage_path;
 	CamelJunkPlugin *junk_plugin;
 
-	gboolean online:1;
-	gboolean check_junk:1;
-	gboolean network_state:1;
+	guint online:1;
+	guint check_junk:1;
+	guint network_state:1;
 };
 
 typedef struct _CamelSessionThreadOps CamelSessionThreadOps;
Index: camel-smime-context.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-smime-context.c,v
retrieving revision 1.42
diff -u -r1.42 camel-smime-context.c
--- camel-smime-context.c	6 Dec 2005 04:21:55 -0000	1.42
+++ camel-smime-context.c	12 Apr 2006 18:13:31 -0000
@@ -665,7 +665,7 @@
 	NSSCMSDecoderContext *dec;
 	NSSCMSMessage *cmsg;
 	CamelStreamMem *mem;
-	CamelStream *constream;
+	CamelStream *constream = NULL;
 	CamelCipherValidity *valid = NULL;
 	CamelContentType *ct;
 	const char *tmp;
Index: camel-store.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-store.c,v
retrieving revision 1.172
diff -u -r1.172 camel-store.c
--- camel-store.c	6 Dec 2005 04:21:55 -0000	1.172
+++ camel-store.c	12 Apr 2006 18:13:31 -0000
@@ -289,7 +289,7 @@
 	if (camel_debug_start(":store")) {
 		char *u = camel_url_to_string(((CamelService *)store)->url, CAMEL_URL_HIDE_PASSWORD);
 
-		printf("CamelStore('%s'):get_folder('%s', %d) = %p\n", u, folder_name, flags, folder);
+		printf("CamelStore('%s'):get_folder('%s', %u) = %p\n", u, folder_name, flags, folder);
 		if (ex && ex->id)
 			printf("  failed: '%s'\n", ex->desc);
 		g_free(u);
Index: camel-stream-filter.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-stream-filter.c,v
retrieving revision 1.33
diff -u -r1.33 camel-stream-filter.c
--- camel-stream-filter.c	6 Dec 2005 04:21:55 -0000	1.33
+++ camel-stream-filter.c	12 Apr 2006 18:13:31 -0000
@@ -51,8 +51,8 @@
 	char *filtered;		/* the filtered data */
 	size_t filteredlen;
 
-	int last_was_read:1;	/* was the last op read or write? */
-	int flushed:1;          /* were the filters flushed? */
+	guint last_was_read:1;	/* was the last op read or write? */
+	guint flushed:1;        /* were the filters flushed? */
 };
 
 #define READ_PAD (128)		/* bytes padded before buffer */
Index: camel-tcp-stream-ssl.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-tcp-stream-ssl.c,v
retrieving revision 1.70
diff -u -r1.70 camel-tcp-stream-ssl.c
--- camel-tcp-stream-ssl.c	13 Dec 2005 13:54:59 -0000	1.70
+++ camel-tcp-stream-ssl.c	12 Apr 2006 18:13:31 -0000
@@ -51,9 +51,7 @@
 
 #include <glib/gstdio.h>
 
-/* this is commented because otherwise we get an error about the
-   redefinition of MD5Context...yay */
-/*#include <libedataserver/md5-utils.h>*/
+#include <libedataserver/md5-utils.h>
 
 #include "camel-certdb.h"
 #include "camel-file-utils.h"
@@ -64,10 +62,6 @@
 #include "camel-stream-fs.h"
 #include "camel-tcp-stream-ssl.h"
 
-
-/* from md5-utils.h */
-void md5_get_digest (const char *buffer, int buffer_size, unsigned char digest[16]);
-
 #define IO_TIMEOUT (PR_TicksPerSecond() * 4 * 60)
 #define CONNECT_TIMEOUT (PR_TicksPerSecond () * 4 * 60)
 
@@ -733,7 +727,7 @@
 		close (fd);
 		
 		if (nread != st.st_size) {
-			g_warning ("cert size read truncated %s: %d != %ld", path, nread, st.st_size);
+			g_warning ("cert size read truncated %s: %u != %ld", path, nread, st.st_size);
 			g_byte_array_free(ccert->rawcert, TRUE);
 			ccert->rawcert = NULL;
 			g_free(fingerprint);
Index: camel-text-index.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-text-index.c,v
retrieving revision 1.24
diff -u -r1.24 camel-text-index.c
--- camel-text-index.c	30 Nov 2005 09:54:54 -0000	1.24
+++ camel-text-index.c	12 Apr 2006 18:13:31 -0000
@@ -981,12 +981,12 @@
 	int frag;
 
 	printf("Path: '%s'\n", idx->parent.path);
-	printf("Version: %d\n", idx->parent.version);
+	printf("Version: %u\n", idx->parent.version);
 	printf("Flags: %08x\n", idx->parent.flags);
-	printf("Total words: %d\n", rb->words);
-	printf("Total names: %d\n", rb->names);
-	printf("Total deleted: %d\n", rb->deleted);
-	printf("Total key blocks: %d\n", rb->keys);
+	printf("Total words: %u\n", rb->words);
+	printf("Total names: %u\n", rb->names);
+	printf("Total deleted: %u\n", rb->deleted);
+	printf("Total key blocks: %u\n", rb->keys);
 
 	if (rb->words > 0) {
 		frag = ((rb->keys - rb->words) * 100)/ rb->words;
@@ -1335,7 +1335,7 @@
 		while (data) {
 			printf(" data %x ", data);
 			if (camel_key_file_read(p->links, &data, &count, &records) == -1) {
-				printf("Warning, read failed for word '%s', at data '%d'\n", word, data);
+				printf("Warning, read failed for word '%s', at data '%u'\n", word, data);
 				data = 0;
 			} else {
 				printf("(%d)\n", (int)count);
Index: camel-vee-folder.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-vee-folder.c,v
retrieving revision 1.78
diff -u -r1.78 camel-vee-folder.c
--- camel-vee-folder.c	8 Dec 2005 06:46:02 -0000	1.78
+++ camel-vee-folder.c	12 Apr 2006 18:13:31 -0000
@@ -1271,7 +1271,7 @@
 		CAMEL_VEE_FOLDER_LOCK(folder_unmatched, summary_lock);
 
 	dd(printf("Vfolder '%s' subfolder changed '%s'\n", folder->full_name, sub->full_name));
-	dd(printf(" changed %d added %d removed %d\n", changes->uid_changed->len, changes->uid_added->len, changes->uid_removed->len));
+	dd(printf(" changed %u added %u removed %u\n", changes->uid_changed->len, changes->uid_added->len, changes->uid_removed->len));
 
 	/* Always remove removed uid's, in any case */
 	for (i=0;i<changes->uid_removed->len;i++) {
Index: providers/hula/camel-hula-provider.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/hula/camel-hula-provider.c,v
retrieving revision 1.1
diff -u -r1.1 camel-hula-provider.c
--- providers/hula/camel-hula-provider.c	14 Nov 2005 17:39:32 -0000	1.1
+++ providers/hula/camel-hula-provider.c	12 Apr 2006 18:13:31 -0000
@@ -40,7 +40,7 @@
 static gint hula_url_equal (gconstpointer a, gconstpointer b);
 
 
-CamelProviderConfEntry hula_conf_entries[] = {
+static CamelProviderConfEntry hula_conf_entries[] = {
 	/* override the labels/defaults of the standard settings */
 	{ CAMEL_PROVIDER_CONF_SECTION_START, "mailcheck", NULL,
 	  N_("Checking for New Mail") },
@@ -88,7 +88,7 @@
 	/* ... */
 };
 
-CamelServiceAuthType camel_hula_password_authtype = {
+static CamelServiceAuthType camel_hula_password_authtype = {
 	N_("Password"),
 	
 	N_("This option will connect to the Hula server using a "
Index: providers/imap/camel-imap-command.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/imap/camel-imap-command.c,v
retrieving revision 1.76
diff -u -r1.76 camel-imap-command.c
--- providers/imap/camel-imap-command.c	16 Jan 2006 20:25:58 -0000	1.76
+++ providers/imap/camel-imap-command.c	12 Apr 2006 18:13:31 -0000
@@ -50,8 +50,8 @@
 
 static gboolean imap_command_start (CamelImapStore *store, CamelFolder *folder,
 				    const char *cmd, CamelException *ex);
-CamelImapResponse *imap_read_response (CamelImapStore *store,
-				       CamelException *ex);
+static CamelImapResponse *imap_read_response (CamelImapStore *store,
+					      CamelException *ex);
 static char *imap_read_untagged (CamelImapStore *store, char *line,
 				 CamelException *ex);
 static char *imap_command_strdup_vprintf (CamelImapStore *store,
@@ -211,10 +211,10 @@
 		else
 			mask = cmd;
 		
-		fprintf (stderr, "sending : %c%.5d %s\r\n", store->tag_prefix, store->command, mask);
+		fprintf (stderr, "sending : %c%.5u %s\r\n", store->tag_prefix, store->command, mask);
 	}
 	
-	nwritten = camel_stream_printf (store->ostream, "%c%.5d %s\r\n",
+	nwritten = camel_stream_printf (store->ostream, "%c%.5u %s\r\n",
 					store->tag_prefix, store->command++, cmd);
 	
 	if (nwritten == -1) {
@@ -530,7 +530,7 @@
 		 * don't want it to be shorter either, because then the
 		 * GString's length would be off...
 		 */
-		sprintf (p, "{%0*d}", ldigits, length);
+		sprintf (p, "{%0*u}", ldigits, length);
 		
 		fulllen += str->len;
 		g_ptr_array_add (data, str);
Index: providers/imap/camel-imap-store-summary.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/imap/camel-imap-store-summary.c,v
retrieving revision 1.17
diff -u -r1.17 camel-imap-store-summary.c
--- providers/imap/camel-imap-store-summary.c	14 Dec 2005 21:31:52 -0000	1.17
+++ providers/imap/camel-imap-store-summary.c	12 Apr 2006 18:13:31 -0000
@@ -211,7 +211,7 @@
 char *
 camel_imap_store_summary_path_to_full(CamelImapStoreSummary *s, const char *path, char dir_sep)
 {
-	unsigned char *full, *f;
+	char *full, *f;
 	guint32 c, v = 0;
 	const char *p;
 	int state=0;
@@ -248,7 +248,7 @@
 	else
 		p = path;
 
-	while ( (c = camel_utf8_getc((const unsigned char **)&p)) ) {
+	while ((c = camel_utf8_getc((const unsigned char **)&p))) {
 		switch(state) {
 		case 0:
 			if (c == '%')
Index: providers/imap/camel-imap-store.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/imap/camel-imap-store.c,v
retrieving revision 1.340
diff -u -r1.340 camel-imap-store.c
--- providers/imap/camel-imap-store.c	16 Jan 2006 20:25:58 -0000	1.340
+++ providers/imap/camel-imap-store.c	12 Apr 2006 18:13:31 -0000
@@ -564,7 +564,7 @@
 	CamelStream *tcp_stream;
 	CamelSockOptData sockopt;
 	gboolean force_imap4 = FALSE;
-	int clean_quit = TRUE, ret;
+	gboolean clean_quit = TRUE;
 	char *buf;
 	
 	if (ssl_mode != MODE_CLEAR) {
@@ -585,7 +585,7 @@
 		tcp_stream = camel_tcp_stream_raw_new ();
 	}
 	
-	if ((ret = camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai)) == -1) {
+	if (camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai) == -1) {
 		if (errno == EINTR)
 			camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
 					     _("Connection cancelled"));
@@ -1181,6 +1181,7 @@
 	return TRUE;
 }
 
+#if 0
 /* This is a little 'hack' to avoid the deadlock conditions that would otherwise
    ensue when calling camel_folder_refresh_info from inside a lock */
 /* NB: on second thougts this is probably not entirely safe, but it'll do for now */
@@ -1227,7 +1228,8 @@
 	}
 	
 	g_ptr_array_free (folders, TRUE);
-}	
+}
+#endif
 
 static gboolean
 try_auth (CamelImapStore *store, const char *mech, CamelException *ex)
Index: providers/imap4/camel-imap4-command.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/imap4/camel-imap4-command.c,v
retrieving revision 1.9
diff -u -r1.9 camel-imap4-command.c
--- providers/imap4/camel-imap4-command.c	31 Aug 2005 04:26:05 -0000	1.9
+++ providers/imap4/camel-imap4-command.c	12 Apr 2006 18:13:31 -0000
@@ -507,7 +507,6 @@
 	CamelIMAP4Literal *literal;
 	camel_imap4_token_t token;
 	unsigned char *linebuf;
-	ssize_t nwritten;
 	size_t len;
 	
 	g_assert (ic->part != NULL);
@@ -545,7 +544,7 @@
 	linebuf = ic->part->buffer;
 	len = ic->part->buflen;
 	
-	if ((nwritten = camel_stream_write (engine->ostream, linebuf, len)) == -1) {
+	if (camel_stream_write (engine->ostream, linebuf, len) == -1) {
 		camel_exception_setv (&ic->ex, CAMEL_EXCEPTION_SYSTEM,
 				      _("Failed sending command to IMAP server %s: %s"),
 				      engine->url->host, g_strerror (errno));
Index: providers/imap4/camel-imap4-folder.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/imap4/camel-imap4-folder.c,v
retrieving revision 1.47
diff -u -r1.47 camel-imap4-folder.c
--- providers/imap4/camel-imap4-folder.c	10 Jan 2006 07:56:47 -0000	1.47
+++ providers/imap4/camel-imap4-folder.c	12 Apr 2006 18:13:31 -0000
@@ -1013,6 +1013,7 @@
 				char *parent_name, *p;
 				
 				parent_name = g_alloca (strlen (folder->full_name) + 1);
+				strcpy (parent_name, folder->full_name);
 				if (!(p = strrchr (parent_name, '/')))
 					*parent_name = '\0';
 				else
Index: providers/imap4/camel-imap4-provider.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/imap4/camel-imap4-provider.c,v
retrieving revision 1.11
diff -u -r1.11 camel-imap4-provider.c
--- providers/imap4/camel-imap4-provider.c	31 Aug 2005 04:26:05 -0000	1.11
+++ providers/imap4/camel-imap4-provider.c	12 Apr 2006 18:13:31 -0000
@@ -31,7 +31,7 @@
 #include "camel-imap4-store.h"
 
 
-CamelProviderConfEntry imap4_conf_entries[] = {
+static CamelProviderConfEntry imap4_conf_entries[] = {
 	{ CAMEL_PROVIDER_CONF_SECTION_START, "mailcheck", NULL,
 	  N_("Checking for new mail") },
 	{ CAMEL_PROVIDER_CONF_CHECKBOX, "check_all", NULL,
@@ -84,7 +84,7 @@
 	/* ... */
 };
 
-CamelServiceAuthType camel_imap4_password_authtype = {
+static CamelServiceAuthType camel_imap4_password_authtype = {
 	N_("Password"),
 	
 	N_("This option will connect to the IMAPv4rev1 server using a "
Index: providers/imap4/camel-imap4-store-summary.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/imap4/camel-imap4-store-summary.c,v
retrieving revision 1.7
diff -u -r1.7 camel-imap4-store-summary.c
--- providers/imap4/camel-imap4-store-summary.c	31 Aug 2005 04:26:05 -0000	1.7
+++ providers/imap4/camel-imap4-store-summary.c	12 Apr 2006 18:13:31 -0000
@@ -113,7 +113,7 @@
 static CamelIMAP4NamespaceList *
 load_namespaces (FILE *in)
 {
-	CamelIMAP4Namespace *ns, *tail;
+	CamelIMAP4Namespace *ns, *tail = NULL;
 	CamelIMAP4NamespaceList *nsl;
 	guint32 i, j, n;
 	
@@ -200,7 +200,7 @@
 static int
 save_namespaces (FILE *out, CamelIMAP4NamespaceList *nsl)
 {
-	CamelIMAP4Namespace *cur, *ns;
+	CamelIMAP4Namespace *ns, *cur = NULL;
 	guint32 i, n;
 	
 	for (i = 0; i < 3; i++) {
Index: providers/imap4/camel-imap4-store.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/imap4/camel-imap4-store.c,v
retrieving revision 1.56
diff -u -r1.56 camel-imap4-store.c
--- providers/imap4/camel-imap4-store.c	5 Jan 2006 18:29:01 -0000	1.56
+++ providers/imap4/camel-imap4-store.c	12 Apr 2006 18:13:32 -0000
@@ -315,7 +315,6 @@
 	CamelIMAP4Command *ic;
 	int id;
 #endif
-	int ret;
 	
 	if (ssl_mode != MODE_CLEAR) {
 #ifdef HAVE_SSL
@@ -335,7 +334,7 @@
 		tcp_stream = camel_tcp_stream_raw_new ();
 	}
 	
-	if ((ret = camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai)) == -1) {
+	if (camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai) == -1) {
 		if (errno == EINTR)
 			camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
 					     _("Connection cancelled"));
@@ -587,7 +586,6 @@
 imap4_reconnect (CamelIMAP4Engine *engine, CamelException *ex)
 {
 	CamelService *service = engine->service;
-	CamelServiceAuthType *mech;
 	gboolean reprompt = FALSE;
 	char *errmsg = NULL;
 	CamelException lex;
@@ -595,7 +593,7 @@
 	if (!connect_to_server_wrapper (engine, ex))
 		return FALSE;
 	
-#define CANT_USE_AUTHMECH (!(mech = g_hash_table_lookup (engine->authtypes, service->url->authmech)))
+#define CANT_USE_AUTHMECH (!g_hash_table_lookup (engine->authtypes, service->url->authmech))
 	if (service->url->authmech && CANT_USE_AUTHMECH) {
 		/* Oops. We can't AUTH using the requested mechanism */
 		camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
@@ -1475,7 +1473,9 @@
 	}
 #endif
 	
+#ifdef USE_FOLDER_INFO_CACHE_LOGIC_FOR_SPEED
  check_online:
+#endif
 	
 	if (flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED)
 		cmd = "LSUB";
Index: providers/imap4/camel-imap4-summary.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/imap4/camel-imap4-summary.c,v
retrieving revision 1.43
diff -u -r1.43 camel-imap4-summary.c
--- providers/imap4/camel-imap4-summary.c	8 Dec 2005 11:09:12 -0000	1.43
+++ providers/imap4/camel-imap4-summary.c	12 Apr 2006 18:13:32 -0000
@@ -764,6 +764,7 @@
 		
 		if ((info = camel_folder_summary_uid (fetch->summary, camel_message_info_uid (envelope->info)))) {
 			camel_message_info_free (envelope->info);
+			camel_message_info_free (info);
 			g_free (envelope);
 			continue;
 		}
Index: providers/imap4/camel-imap4-utils.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/imap4/camel-imap4-utils.c,v
retrieving revision 1.16
diff -u -r1.16 camel-imap4-utils.c
--- providers/imap4/camel-imap4-utils.c	31 Aug 2005 04:26:05 -0000	1.16
+++ providers/imap4/camel-imap4-utils.c	12 Apr 2006 18:13:32 -0000
@@ -485,7 +485,7 @@
 }
 
 
-struct {
+static struct {
 	const char *name;
 	guint32 flag;
 } list_flags[] = {
Index: providers/local/camel-mbox-summary.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/local/camel-mbox-summary.c,v
retrieving revision 1.56
diff -u -r1.56 camel-mbox-summary.c
--- providers/local/camel-mbox-summary.c	8 Dec 2005 11:28:47 -0000	1.56
+++ providers/local/camel-mbox-summary.c	12 Apr 2006 18:13:32 -0000
@@ -1102,32 +1102,32 @@
 static void
 encode_status(guint32 flags, char status[8])
 {
+	size_t i;
 	char *p;
-	int i;
-
+	
 	p = status;
-	for (i=0;i<sizeof(status_flags)/sizeof(status_flags[0]);i++)
+	for (i = 0; i < G_N_ELEMENTS (status_flags); i++)
 		if (status_flags[i].flag & flags)
 			*p++ = status_flags[i].tag;
 	*p++ = 'O';
-	*p=0;
+	*p = '\0';
 }
 
 static guint32
 decode_status(const char *status)
 {
 	const char *p;
-	char c;
 	guint32 flags = 0;
-	int i;
-
+	size_t i;
+	char c;
+	
 	p = status;
 	while ((c = *p++)) {
-		for (i=0;i<sizeof(status_flags)/sizeof(status_flags[0]);i++)
-			if (status_flags[i].tag == *p)
+		for (i = 0; i < G_N_ELEMENTS (status_flags); i++)
+			if (status_flags[i].tag == c)
 				flags |= status_flags[i].flag;
 	}
-
+	
 	return flags;
 }
 
Index: providers/nntp/camel-nntp-provider.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/nntp/camel-nntp-provider.c,v
retrieving revision 1.27
diff -u -r1.27 camel-nntp-provider.c
--- providers/nntp/camel-nntp-provider.c	31 Aug 2005 04:26:02 -0000	1.27
+++ providers/nntp/camel-nntp-provider.c	12 Apr 2006 18:13:32 -0000
@@ -37,7 +37,7 @@
 static gint check_equal (char *s1, char *s2);
 static gint nntp_url_equal (gconstpointer a, gconstpointer b);
 
-CamelProviderConfEntry nntp_conf_entries[] = {
+static CamelProviderConfEntry nntp_conf_entries[] = {
 	{ CAMEL_PROVIDER_CONF_SECTION_START, "folders", NULL,
 	  N_("Folders") },
 	{ CAMEL_PROVIDER_CONF_CHECKBOX, "show_short_notation", NULL,
@@ -68,7 +68,7 @@
 	/* ... */
 };
 
-CamelServiceAuthType camel_nntp_password_authtype = {
+static CamelServiceAuthType camel_nntp_password_authtype = {
 	N_("Password"),
 
 	N_("This option will authenticate with the NNTP server using a "
Index: providers/nntp/camel-nntp-store-summary.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/nntp/camel-nntp-store-summary.c,v
retrieving revision 1.4
diff -u -r1.4 camel-nntp-store-summary.c
--- providers/nntp/camel-nntp-store-summary.c	31 Aug 2005 04:26:03 -0000	1.4
+++ providers/nntp/camel-nntp-store-summary.c	12 Apr 2006 18:13:32 -0000
@@ -209,7 +209,7 @@
 char *
 camel_nntp_store_summary_path_to_full (CamelNNTPStoreSummary *s, const char *path, char dir_sep)
 {
-	unsigned char *full, *f;
+	char *full, *f;
 	guint32 c, v = 0;
 	const char *p;
 	int state=0;
Index: providers/nntp/camel-nntp-store.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/nntp/camel-nntp-store.c,v
retrieving revision 1.83
diff -u -r1.83 camel-nntp-store.c
--- providers/nntp/camel-nntp-store.c	30 Nov 2005 16:04:02 -0000	1.83
+++ providers/nntp/camel-nntp-store.c	12 Apr 2006 18:13:32 -0000
@@ -168,7 +168,6 @@
 	gboolean retval = FALSE;
 	unsigned char *buf;
 	unsigned int len;
-	int ret;
 	char *path;
 	
 	CAMEL_SERVICE_LOCK(store, connect_lock);
@@ -191,7 +190,7 @@
 		tcp_stream = camel_tcp_stream_raw_new ();
 	}
 	
-	if ((ret = camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai)) == -1) {
+	if (camel_tcp_stream_connect ((CamelTcpStream *) tcp_stream, ai) == -1) {
 		if (errno == EINTR)
 			camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
 					     _("Connection cancelled"));
@@ -561,7 +560,7 @@
 		}
 	}
 
-	printf("store info update '%s' first '%d' last '%d'\n", line, first, last);
+	printf("store info update '%s' first '%u' last '%u'\n", line, first, last);
 
 	if (si->last) {
 		if (last > si->last)
Index: providers/nntp/camel-nntp-summary.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/nntp/camel-nntp-summary.c,v
retrieving revision 1.21
diff -u -r1.21 camel-nntp-summary.c
--- providers/nntp/camel-nntp-summary.c	31 Aug 2005 04:26:03 -0000	1.21
+++ providers/nntp/camel-nntp-summary.c	12 Apr 2006 18:13:32 -0000
@@ -303,9 +303,9 @@
 add_range_head(CamelNNTPSummary *cns, CamelNNTPStore *store, unsigned int high, unsigned int low, CamelFolderChangeInfo *changes, CamelException *ex)
 {
 	CamelFolderSummary *s;
-	int i, ret = -1;
+	int ret = -1;
 	char *line, *msgid;
-	unsigned int n, count, total;
+	unsigned int i, n, count, total;
 	CamelMessageInfo *mi;
 	CamelMimeParser *mp;
 
@@ -333,7 +333,7 @@
 		line += 3;
 		n = strtoul(line, &line, 10);
 		if (n != i)
-			g_warning("retrieved message '%d' when i expected '%d'?\n", n, i);
+			g_warning("retrieved message '%u' when i expected '%u'?\n", n, i);
 		
 		/* FIXME: use camel-mime-utils.c function for parsing msgid? */
 		if ((msgid = strchr(line, '<')) && (line = strchr(msgid+1, '>'))){
Index: providers/pop3/camel-pop3-engine.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/pop3/camel-pop3-engine.c,v
retrieving revision 1.11
diff -u -r1.11 camel-pop3-engine.c
--- providers/pop3/camel-pop3-engine.c	31 Aug 2005 04:26:04 -0000	1.11
+++ providers/pop3/camel-pop3-engine.c	12 Apr 2006 18:13:32 -0000
@@ -170,7 +170,7 @@
 
 /* TODO: read implementation too?
    etc? */
-struct {
+static struct {
 	char *cap;
 	guint32 flag;
 } capa[] = {
Index: providers/pop3/camel-pop3-folder.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/pop3/camel-pop3-folder.c,v
retrieving revision 1.71
diff -u -r1.71 camel-pop3-folder.c
--- providers/pop3/camel-pop3-folder.c	15 Sep 2005 22:28:37 -0000	1.71
+++ providers/pop3/camel-pop3-folder.c	12 Apr 2006 18:13:32 -0000
@@ -396,7 +396,7 @@
 	CamelPOP3Command *pcr;
 	CamelPOP3FolderInfo *fi;
 	char buffer[1];
-	int ok, i, last;
+	int i, last;
 	CamelStream *stream = NULL;
 
 	fi = g_hash_table_lookup(pop3_folder->uids_uid, uid);
@@ -422,7 +422,7 @@
 			fi->err = errno;
 
 		/* getting error code? */
-		ok = fi->cmd->state == CAMEL_POP3_COMMAND_DATA;
+		/*g_assert (fi->cmd->state == CAMEL_POP3_COMMAND_DATA);*/
 		camel_pop3_engine_command_free(pop3_store->engine, fi->cmd);
 		fi->cmd = NULL;
 
@@ -482,7 +482,7 @@
 			fi->err = errno;
 
 		/* getting error code? */
-		ok = pcr->state == CAMEL_POP3_COMMAND_DATA;
+		/*g_assert (pcr->state == CAMEL_POP3_COMMAND_DATA);*/
 		camel_pop3_engine_command_free(pop3_store->engine, pcr);
 		camel_stream_reset(stream);
 
Index: providers/pop3/camel-pop3-provider.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/pop3/camel-pop3-provider.c,v
retrieving revision 1.34
diff -u -r1.34 camel-pop3-provider.c
--- providers/pop3/camel-pop3-provider.c	31 Aug 2005 04:26:04 -0000	1.34
+++ providers/pop3/camel-pop3-provider.c	12 Apr 2006 18:13:32 -0000
@@ -34,7 +34,8 @@
 #include "camel-sasl.h"
 #include "camel-i18n.h"
 
-CamelProviderConfEntry pop3_conf_entries[] = {
+
+static CamelProviderConfEntry pop3_conf_entries[] = {
 	{ CAMEL_PROVIDER_CONF_SECTION_START, "storage", NULL,
 	  N_("Message storage") },
 	{ CAMEL_PROVIDER_CONF_CHECKBOX, "keep_on_server", NULL,
@@ -68,7 +69,7 @@
 	/* ... */
 };
 
-CamelServiceAuthType camel_pop3_password_authtype = {
+static CamelServiceAuthType camel_pop3_password_authtype = {
 	N_("Password"),
 
 	N_("This option will connect to the POP server using a plaintext "


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]