[evolution-patches] More compilation fixes for Camel



More fun

-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be
gnome: pvanhoof at gnome dot org
work: vanhoof at x-tend dot be
blog: http://pvanhoof.be/blog
--- /home/pvanhoof/repos/gnome/cvs/evolution-data-server/camel/camel-multipart.c	2005-12-06 05:21:54.000000000 +0100
+++ camel-multipart.c	2006-10-17 17:13:59.000000000 +0200
@@ -363,12 +363,12 @@
 		bgen = g_strdup_printf ("%p:%lu:%lu", multipart,
 					(unsigned long) getpid(),
 					(unsigned long) time(0));
-		md5_get_digest (bgen, strlen (bgen), digest);
+		md5_get_digest (bgen, strlen ((char*)bgen), (guchar*) digest);
 		g_free (bgen);
 		strcpy (bbuf, "=-");
 		p = bbuf + 2;
 		state = save = 0;
-		p += camel_base64_encode_step (digest, 16, FALSE, p, &state, &save);
+		p += camel_base64_encode_step ((unsigned char *)digest, 16, FALSE, (unsigned char *)p, &state, &save);
 		*p = '\0';
 
 		boundary = bbuf;
--- /home/pvanhoof/repos/gnome/cvs/evolution-data-server/camel/camel-sasl-anonymous.c	2005-12-06 05:21:54.000000000 +0100
+++ camel-sasl-anonymous.c	2006-10-17 17:10:02.000000000 +0200
@@ -135,7 +135,7 @@
 		}
 		camel_object_unref (cia);
 		ret = g_byte_array_new ();
-		g_byte_array_append (ret, sasl_anon->trace_info, strlen (sasl_anon->trace_info));
+		g_byte_array_append (ret, (const guchar*)sasl_anon->trace_info, strlen (sasl_anon->trace_info));
 		break;
 	case CAMEL_SASL_ANON_TRACE_OPAQUE:
 		if (strchr (sasl_anon->trace_info, '@')) {
@@ -145,7 +145,7 @@
 			return NULL;
 		}
 		ret = g_byte_array_new ();
-		g_byte_array_append (ret, sasl_anon->trace_info, strlen (sasl_anon->trace_info));
+		g_byte_array_append (ret, (const guchar*)sasl_anon->trace_info, strlen (sasl_anon->trace_info));
 		break;
 	case CAMEL_SASL_ANON_TRACE_EMPTY:
 		ret = g_byte_array_new ();
--- /home/pvanhoof/repos/gnome/cvs/evolution-data-server/camel/camel-sasl-cram-md5.c	2005-12-06 05:21:54.000000000 +0100
+++ camel-sasl-cram-md5.c	2006-10-17 17:09:49.000000000 +0200
@@ -132,11 +132,11 @@
 	
 	/* lowercase hexify that bad-boy... */
 	for (s = digest, p = md5asc; p < md5asc + 32; s++, p += 2)
-		sprintf (p, "%.2x", *s);
+		sprintf ((char*)p, "%.2x", *s);
 	
 	ret = g_byte_array_new ();
-	g_byte_array_append (ret, sasl->service->url->user, strlen (sasl->service->url->user));
-	g_byte_array_append (ret, " ", 1);
+	g_byte_array_append (ret, (const guchar*)sasl->service->url->user, strlen (sasl->service->url->user));
+	g_byte_array_append (ret, (const guchar*)" ", 1);
 	g_byte_array_append (ret, md5asc, 32);
 	
 	sasl->authenticated = TRUE;
--- /home/pvanhoof/repos/gnome/cvs/evolution-data-server/camel/camel-stream-buffer.c	2005-12-06 05:21:55.000000000 +0100
+++ camel-stream-buffer.c	2006-10-17 17:19:57.000000000 +0200
@@ -126,7 +126,7 @@
 		g_free(sbf->buf);
 	}
 	if (buf) {
-		sbf->buf = buf;
+		sbf->buf = (unsigned char*)buf;
 		sbf->flags |= BUF_USER;
 	} else {
 		sbf->buf = g_malloc(size);
@@ -253,7 +253,7 @@
 					bptr += bytes_read;
 				}
 			} else {
-				bytes_read = camel_stream_read(sbf->stream, sbf->buf, sbf->size);
+				bytes_read = camel_stream_read(sbf->stream, (char *)sbf->buf, sbf->size);
 				if (bytes_read>0) {
 					size_t bytes_used = bytes_read > n ? n : bytes_read;
 					sbf->ptr = sbf->buf;
@@ -312,7 +312,7 @@
 
 	/* if we've filled the buffer, write it out, reset buffer */
 	if (left == todo) {
-		if (stream_write_all(sbf->stream, sbf->buf, sbf->size) == -1)
+		if (stream_write_all(sbf->stream, (const char *)sbf->buf, sbf->size) == -1)
 			return -1;
 
 		sbf->ptr = sbf->buf;
@@ -340,7 +340,7 @@
 	if ((sbf->mode & CAMEL_STREAM_BUFFER_MODE) == CAMEL_STREAM_BUFFER_WRITE) {
 		size_t len = sbf->ptr - sbf->buf;
 		
-		if (camel_stream_write (sbf->stream, sbf->buf, len) == -1)
+		if (camel_stream_write (sbf->stream, (const char *)sbf->buf, len) == -1)
 			return -1;
 		
 		sbf->ptr = sbf->buf;
@@ -391,8 +391,8 @@
 	int bytes_read;
 
 	outptr = buf;
-	inptr = sbf->ptr;
-	inend = sbf->end;
+	inptr = (char*)sbf->ptr;
+	inend = (char*)sbf->end;
 	outend = buf+max-1;	/* room for NUL */
 
 	do {
@@ -401,25 +401,27 @@
 			*outptr++ = c;
 			if (c == '\n') {
 				*outptr = 0;
-				sbf->ptr = inptr;
+				sbf->ptr = (unsigned char*) inptr;
 				return outptr-buf;
 			}
 		}
 		if (outptr == outend)
 			break;
 
-		bytes_read = camel_stream_read (sbf->stream, sbf->buf, sbf->size);
+		bytes_read = camel_stream_read (sbf->stream, (char*)sbf->buf, sbf->size);
 		if (bytes_read == -1) {
 			if (buf == outptr)
 				return -1;
 			else
 				bytes_read = 0;
 		}
-		inptr = sbf->ptr = sbf->buf;
-		inend = sbf->end = sbf->buf + bytes_read;
+		sbf->ptr = sbf->buf;
+		sbf->end = sbf->buf + bytes_read;
+		inptr = (char*)sbf->ptr;
+		inend = (char*)sbf->end;
 	} while (bytes_read>0);
 
-	sbf->ptr = inptr;
+	sbf->ptr = (unsigned char*)inptr;
 	*outptr = 0;
 
 	return (int)(outptr - buf);
@@ -445,7 +447,7 @@
 	p = sbf->linebuf;
 
 	while (1) {
-		nread = camel_stream_buffer_gets (sbf, p, sbf->linesize - (p - sbf->linebuf));
+		nread = camel_stream_buffer_gets (sbf, (char*)p, sbf->linesize - (p - sbf->linebuf));
 		if (nread <=0) {
 			if (p > sbf->linebuf)
 				break;
@@ -467,5 +469,5 @@
 		p--;
 	p[0] = 0;
 
-	return g_strdup(sbf->linebuf);
+	return g_strdup((gchar*)sbf->linebuf);
 }


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