[dovecot-cvs] dovecot/src/lib-mail rfc822-tokenize.c,1.4,1.5 rfc822-tokenize.h,1.6,1.7

cras at procontrol.fi cras at procontrol.fi
Mon Dec 2 15:49:19 EET 2002


Update of /home/cvs/dovecot/src/lib-mail
In directory danu:/tmp/cvs-serv6765/lib-mail

Modified Files:
	rfc822-tokenize.c rfc822-tokenize.h 
Log Message:
int -> size_t



Index: rfc822-tokenize.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-mail/rfc822-tokenize.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- rfc822-tokenize.c	8 Sep 2002 14:39:05 -0000	1.4
+++ rfc822-tokenize.c	2 Dec 2002 13:49:16 -0000	1.5
@@ -8,14 +8,14 @@
 #define PARSE_ERROR() \
 	STMT_START { \
 	if (error_func != NULL && \
-	    !error_func(str, (int) (p-str), '\0', context)) \
+	    !error_func(str, (size_t) (p-str), '\0', context)) \
 		return NULL; \
 	} STMT_END
 
 #define PARSE_ERROR_MISSING(c) \
 	STMT_START { \
 	if (error_func != NULL && \
-	    !error_func(str, (int) (p-str), c, context)) \
+	    !error_func(str, (size_t) (p-str), c, context)) \
 		return NULL; \
 	} STMT_END
 
@@ -92,7 +92,7 @@
 			if (level > 0)
 				PARSE_ERROR_MISSING(')');
 
-			token->len = (int) (p - token->ptr);
+			token->len = (size_t) (p - token->ptr);
 			break;
 
 		case '[':
@@ -109,7 +109,7 @@
 					PARSE_ERROR();
 				}
 			}
-			token->len = (int) (p - token->ptr);
+			token->len = (size_t) (p - token->ptr);
 
 			if (*p == '\0')
 				PARSE_ERROR_MISSING(']');
@@ -124,7 +124,7 @@
 				if (*p == '\\' && p[1] != '\0')
 					p++;
 			}
-			token->len = (int) (p - token->ptr);
+			token->len = (size_t) (p - token->ptr);
 
 			if (*p == '\0')
 				PARSE_ERROR_MISSING('"');
@@ -173,7 +173,7 @@
 	}
 
 	if (in_bracket && error_func != NULL) {
-		if (!error_func(str, (int) (p-str), '>', context))
+		if (!error_func(str, (size_t) (p-str), '>', context))
 			return NULL;
 	}
 

Index: rfc822-tokenize.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-mail/rfc822-tokenize.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- rfc822-tokenize.h	9 Oct 2002 17:49:41 -0000	1.6
+++ rfc822-tokenize.h	2 Dec 2002 13:49:16 -0000	1.7
@@ -38,7 +38,7 @@
 
    missing_char == '\0': unexpected character at str[pos]
    missing_char != '\0': missing character */
-typedef int (*Rfc822TokenizeErrorFunc)(const char *str, int pos,
+typedef int (*Rfc822TokenizeErrorFunc)(const char *str, size_t pos,
 				       char missing_char, void *context);
 
 /* Tokenize the string. Returns NULL if string is empty. Memory for




More information about the dovecot-cvs mailing list