[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync-parse.c, 1.25, 1.26 mbox-sync-rewrite.c, 1.29, 1.30

cras at dovecot.org cras at dovecot.org
Mon Sep 20 23:46:00 EEST 2004


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv6374/lib-storage/index/mbox

Modified Files:
	mbox-sync-parse.c mbox-sync-rewrite.c 
Log Message:
signed vs. unsigned comparision fixes



Index: mbox-sync-parse.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync-parse.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- mbox-sync-parse.c	13 Sep 2004 10:47:16 -0000	1.25
+++ mbox-sync-parse.c	20 Sep 2004 20:45:58 -0000	1.26
@@ -57,7 +57,7 @@
 		space++;
 	}
 
-	if (space > ctx->mail.space) {
+	if ((ssize_t)space > ctx->mail.space) {
 		ctx->mail.offset = hdr->full_value_offset + i;
 		ctx->mail.space = space;
 	}

Index: mbox-sync-rewrite.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync-rewrite.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- mbox-sync-rewrite.c	16 Sep 2004 14:55:13 -0000	1.29
+++ mbox-sync-rewrite.c	20 Sep 2004 20:45:58 -0000	1.30
@@ -178,7 +178,7 @@
 
 	*size = 0;
 
-	if (ctx->mail.space < data_size - last_line_pos) {
+	if (ctx->mail.space < (off_t)(data_size - last_line_pos)) {
 		ctx->mail.space = data_size - last_line_pos;
 		ctx->mail.offset = ctx->hdr_offset + last_line_pos;
 	}
@@ -236,12 +236,12 @@
 			/* good, we removed enough. */
 			i_assert(new_hdr_size == old_hdr_size);
 		} else if (move_diff < 0 &&
-			   new_hdr_size - old_hdr_size <= -move_diff) {
+			   new_hdr_size - old_hdr_size <= (uoff_t)-move_diff) {
 			/* moving backwards - we can use the extra space from
 			   it, just update expunged_space accordingly */
 			i_assert(ctx->mail.space == 0);
 			i_assert(ctx->sync_ctx->expunged_space >=
-				 new_hdr_size - old_hdr_size);
+				 (off_t)(new_hdr_size - old_hdr_size));
 			ctx->sync_ctx->expunged_space -=
 				new_hdr_size - old_hdr_size;
 		} else {
@@ -351,7 +351,7 @@
 	old_hdr_size = mail_ctx.body_offset - mail_ctx.hdr_offset;
 	need_space = str_len(mail_ctx.header) - mail_ctx.mail.space -
 		old_hdr_size;
-	i_assert(need_space == -mails[idx].space);
+	i_assert(need_space == (uoff_t)-mails[idx].space);
 	i_assert(space_diff >= need_space);
 
 	if (space_diff - need_space < (uoff_t)mail_ctx.mail.space) {



More information about the dovecot-cvs mailing list