[gmime] fixed some compile warnings about gint64->size_t



commit 742fc3b5cf9d232934f20c3290c5e90f2c2da496
Author: Jeffrey Stedfast <fejj gnome org>
Date:   Sat Apr 25 20:47:42 2009 -0400

    fixed some compile warnings about gint64->size_t
    
    2009-04-25  Jeffrey Stedfast  <fejj novell com>
    
    	* gmime/gmime-message-partial.c (g_mime_message_partial_split_message):
    	Fixed to use gint64 variables for stream length/offsets.
---
 ChangeLog                     |    5 +++++
 gmime/gmime-message-partial.c |    4 ++--
 gmime/gmime-stream-buffer.c   |    4 ++--
 gmime/gmime-stream-cat.c      |    4 ++--
 gmime/gmime-stream-file.c     |    4 ++--
 gmime/gmime-stream-fs.c       |    4 ++--
 gmime/gmime-stream-mem.c      |    4 ++--
 7 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 04ad01a..2a0f71b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-04-25  Jeffrey Stedfast  <fejj novell com>
 
+	* gmime/gmime-message-partial.c (g_mime_message_partial_split_message):
+	Fixed to use gint64 variables for stream length/offsets.
+
+2009-04-25  Jeffrey Stedfast  <fejj novell com>
+
 	* gmime/gmime-object.c (g_mime_object_set_disposition): Unref the
 	disposition after setting it on the GMimeObject, don't ref it
 	again. Oops.
diff --git a/gmime/gmime-message-partial.c b/gmime/gmime-message-partial.c
index f6f0668..c54c70e 100644
--- a/gmime/gmime-message-partial.c
+++ b/gmime/gmime-message-partial.c
@@ -423,7 +423,7 @@ g_mime_message_partial_split_message (GMimeMessage *message, size_t max_size, si
 	GMimeDataWrapper *wrapper;
 	const unsigned char *buf;
 	GPtrArray *parts;
-	size_t len, end;
+	gint64 len, end;
 	const char *id;
 	gint64 start;
 	guint i;
@@ -462,7 +462,7 @@ g_mime_message_partial_split_message (GMimeMessage *message, size_t max_size, si
 		/* Preferably, we'd split on whole-lines if we can,
 		 * but if that's not possible, split on max size */
 		if ((end = MIN (len, start + max_size)) < len) {
-			register size_t ebx; /* end boundary */
+			register gint64 ebx; /* end boundary */
 			
 			ebx = end;
 			while (ebx > (start + 1) && ebx[buf] != '\n')
diff --git a/gmime/gmime-stream-buffer.c b/gmime/gmime-stream-buffer.c
index 753661b..52144bc 100644
--- a/gmime/gmime-stream-buffer.c
+++ b/gmime/gmime-stream-buffer.c
@@ -466,8 +466,8 @@ stream_seek_block_read (GMimeStream *stream, gint64 offset, GMimeSeekWhence when
 	    || (offset > 0 && offset <= buffer->buflen)) {
 		/* the position is within our pre-buffered region */
 		stream->position += offset;
-		buffer->bufptr += offset;
-		buffer->buflen -= offset;
+		buffer->bufptr += (size_t) offset;
+		buffer->buflen -= (size_t) offset;
 		
 		return stream->position;
 	}
diff --git a/gmime/gmime-stream-cat.c b/gmime/gmime-stream-cat.c
index e626194..a95cfb6 100644
--- a/gmime/gmime-stream-cat.c
+++ b/gmime/gmime-stream-cat.c
@@ -151,7 +151,7 @@ stream_read (GMimeStream *stream, char *buf, size_t len)
 	
 	/* don't allow our caller to read past the end of the stream */
 	if (stream->bound_end != -1)
-		len = MIN (stream->bound_end - stream->position, (gint64) len);
+		len = (size_t) MIN (stream->bound_end - stream->position, (gint64) len);
 	
 	if (!(current = cat->current))
 		return -1;
@@ -196,7 +196,7 @@ stream_write (GMimeStream *stream, const char *buf, size_t len)
 	
 	/* don't allow our caller to write past the end of the stream */
 	if (stream->bound_end != -1)
-		len = MIN (stream->bound_end - stream->position, (gint64) len);
+		len = (size_t) MIN (stream->bound_end - stream->position, (gint64) len);
 	
 	if (!(current = cat->current))
 		return -1;
diff --git a/gmime/gmime-stream-file.c b/gmime/gmime-stream-file.c
index 8af083a..a4c5518 100644
--- a/gmime/gmime-stream-file.c
+++ b/gmime/gmime-stream-file.c
@@ -144,7 +144,7 @@ stream_read (GMimeStream *stream, char *buf, size_t len)
 	}
 	
 	if (stream->bound_end != -1)
-		len = MIN (stream->bound_end - stream->position, (gint64) len);
+		len = (size_t) MIN (stream->bound_end - stream->position, (gint64) len);
 	
 	/* make sure we are at the right position */
 	fseek (fstream->fp, (long) stream->position, SEEK_SET);
@@ -184,7 +184,7 @@ stream_write (GMimeStream *stream, const char *buf, size_t len)
 	}
 	
 	if (stream->bound_end != -1)
-		len = MIN (stream->bound_end - stream->position, (gint64) len);
+		len = (size_t) MIN (stream->bound_end - stream->position, (gint64) len);
 	
 	/* make sure we are at the right position */
 	fseek (fstream->fp, (long) stream->position, SEEK_SET);
diff --git a/gmime/gmime-stream-fs.c b/gmime/gmime-stream-fs.c
index 75d0d4f..41e3999 100644
--- a/gmime/gmime-stream-fs.c
+++ b/gmime/gmime-stream-fs.c
@@ -162,7 +162,7 @@ stream_read (GMimeStream *stream, char *buf, size_t len)
 	}
 	
 	if (stream->bound_end != -1)
-		len = MIN (stream->bound_end - stream->position, (gint64) len);
+		len = (size_t) MIN (stream->bound_end - stream->position, (gint64) len);
 	
 	/* make sure we are at the right position */
 	lseek (fs->fd, (off_t) stream->position, SEEK_SET);
@@ -209,7 +209,7 @@ stream_write (GMimeStream *stream, const char *buf, size_t len)
 	}
 	
 	if (stream->bound_end != -1)
-		len = MIN (stream->bound_end - stream->position, (gint64) len);
+		len = (size_t) MIN (stream->bound_end - stream->position, (gint64) len);
 	
 	/* make sure we are at the right position */
 	lseek (fs->fd, (off_t) stream->position, SEEK_SET);
diff --git a/gmime/gmime-stream-mem.c b/gmime/gmime-stream-mem.c
index 33d1991..67d0c93 100644
--- a/gmime/gmime-stream-mem.c
+++ b/gmime/gmime-stream-mem.c
@@ -139,7 +139,7 @@ stream_read (GMimeStream *stream, char *buf, size_t len)
 	
 	bound_end = stream->bound_end != -1 ? stream->bound_end : (gint64) mem->buffer->len;
 	
-	n = MIN (bound_end - stream->position, (gint64) len);
+	n = (size_t) MIN (bound_end - stream->position, (gint64) len);
 	if (n > 0) {
 		memcpy (buf, mem->buffer->data + stream->position, n);
 		stream->position += n;
@@ -169,7 +169,7 @@ stream_write (GMimeStream *stream, const char *buf, size_t len)
 	} else
 		bound_end = stream->bound_end;
 	
-	n = MIN (bound_end - stream->position, (gint64) len);
+	n = (size_t) MIN (bound_end - stream->position, (gint64) len);
 	if (n > 0) {
 		memcpy (mem->buffer->data + stream->position, buf, n);
 		stream->position += n;



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