[dovecot-cvs] dovecot-lda/src/libsieve Makefile.am, 1.4, 1.5 addr-lex.l, 1.1.1.1, 1.2 bc_dump.c, 1.1.1.1, 1.2 bc_emit.c, 1.1.1.1, 1.2 bc_eval.c, 1.2, 1.3 hmac-md5.h, 1.1.1.1, NONE md5.c, 1.1.1.1, NONE md5.h, 1.1.1.1, NONE md5global.h, 1.1.1.1, NONE message.c, 1.1.1.1, 1.2 message.h, 1.1.1.1, 1.2 script.c, 1.2, 1.3 tree.c, 1.1.1.1, 1.2

cras at dovecot.org cras at dovecot.org
Fri Oct 14 23:21:50 EEST 2005


Update of /var/lib/cvs/dovecot-lda/src/libsieve
In directory talvi:/tmp/cvs-serv1278

Modified Files:
	Makefile.am addr-lex.l bc_dump.c bc_emit.c bc_eval.c message.c 
	message.h script.c tree.c 
Removed Files:
	hmac-md5.h md5.c md5.h md5global.h 
Log Message:
Warning fixes, use our own MD5 implementation



Index: Makefile.am
===================================================================
RCS file: /var/lib/cvs/dovecot-lda/src/libsieve/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Makefile.am	14 Oct 2005 20:11:42 -0000	1.4
+++ Makefile.am	14 Oct 2005 20:21:47 -0000	1.5
@@ -20,7 +20,6 @@
 	bc_generate.c \
 	comparator.c \
 	interp.c \
-	md5.c \
 	message.c \
 	parseaddr.c \
 	script.c \
@@ -33,10 +32,7 @@
 	addr.h \
 	bytecode.h \
 	comparator.h \
-	hmac-md5.h \
 	interp.h \
-	md5.h \
-	md5global.h \
 	message.h \
 	parseaddr.h \
 	script.h \

Index: addr-lex.l
===================================================================
RCS file: /var/lib/cvs/dovecot-lda/src/libsieve/addr-lex.l,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- addr-lex.l	29 Mar 2005 18:37:59 -0000	1.1.1.1
+++ addr-lex.l	14 Oct 2005 20:21:47 -0000	1.2
@@ -82,7 +82,7 @@
     extern char *addrptr;	/* current position in address string */
     size_t n;			/* number of characters to read from string */
 
-    n = strlen(addrptr) < max_size ? strlen(addrptr) : max_size;
+    n = (int)strlen(addrptr) < max_size ? (int)strlen(addrptr) : max_size;
     if (n > 0) {
 	memcpy(buf, addrptr, n);
 	addrptr += n;

Index: bc_dump.c
===================================================================
RCS file: /var/lib/cvs/dovecot-lda/src/libsieve/bc_dump.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- bc_dump.c	29 Mar 2005 18:37:59 -0000	1.1.1.1
+++ bc_dump.c	14 Oct 2005 20:21:47 -0000	1.2
@@ -40,9 +40,11 @@
     size_t reallen; /* allocated length of 'data' */
 };
 
+#if DUMPCODE
+
 /*this would work a lot better if we actually could tell how many levels deep in if statements we were.  currently it doesn't know*/
 
-void print_spaces(int n)
+static void print_spaces(int n)
 {
     int temp_n=0;
     while(temp_n++ < (n))
@@ -50,8 +52,6 @@
 }
 
 
-#if DUMPCODE
-
 /* Dump a stringlist.  Return the last address used by the list */
 static int dump_sl(bytecode_info_t *d, int ip, int level) 
 {

Index: bc_emit.c
===================================================================
RCS file: /var/lib/cvs/dovecot-lda/src/libsieve/bc_emit.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- bc_emit.c	29 Mar 2005 18:37:59 -0000	1.1.1.1
+++ bc_emit.c	14 Oct 2005 20:21:47 -0000	1.2
@@ -45,7 +45,7 @@
 void dump(bytecode_info_t *d);
 #endif
 
-inline int write_int (int fd, int x)
+static inline int write_int (int fd, int x)
 {
     int y=htonl(x);
     return (write(fd, &y, sizeof(int)));

Index: bc_eval.c
===================================================================
RCS file: /var/lib/cvs/dovecot-lda/src/libsieve/bc_eval.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- bc_eval.c	12 Oct 2005 17:17:57 -0000	1.2
+++ bc_eval.c	14 Oct 2005 20:21:47 -0000	1.3
@@ -51,7 +51,7 @@
 /* Given a bytecode_input_t at the beginning of a string (the len block),
  * return the string, the length, and the bytecode index of the NEXT
  * item */
-int unwrap_string(bytecode_input_t *bc, int pos, const char **str, int *len) 
+static int unwrap_string(bytecode_input_t *bc, int pos, const char **str, int *len)
 {
     int local_len = ntohl(bc[pos].value);
 
@@ -77,8 +77,8 @@
 /* this is used by notify to pass the options list to do_notify
  * do_notify needs null-terminated (char *)[],
  *  we have a stringlist, the beginning of which is pointed at by pos */
-const char ** bc_makeArray(bytecode_input_t *bc, int *pos) 
-{ 
+static const char ** bc_makeArray(bytecode_input_t *bc, int *pos)
+{
     int i;
     const char** array;
     int len = ntohl(bc[*pos].value);
@@ -97,8 +97,8 @@
 }
 
 /* Compile a regular expression for use during parsing */
-regex_t * bc_compile_regex(const char *s, int ctag,
-			   char *errmsg, size_t errsiz)
+static regex_t * bc_compile_regex(const char *s, int ctag,
+				  char *errmsg, size_t errsiz)
 {
     int ret;
     regex_t *reg = (regex_t *) xmalloc(sizeof(regex_t));
@@ -188,9 +188,9 @@
 }
  
 /* Determine if we should respond to a vacation message */
-int shouldRespond(void * m, sieve_interp_t *interp,
-		  int numaddresses, bytecode_input_t* bc,
-		  int i, char **from, char **to)
+static int shouldRespond(void * m, sieve_interp_t *interp,
+			 int numaddresses, bytecode_input_t* bc,
+			 int i, char **from, char **to)
 {
     const char **body;
     char buf[128];
@@ -303,8 +303,8 @@
 }
 
 /* Evaluate a bytecode test */
-int eval_bc_test(sieve_interp_t *interp, void* m,
-		 bytecode_input_t * bc, int * ip)
+static int eval_bc_test(sieve_interp_t *interp, void* m,
+			bytecode_input_t * bc, int * ip)
 {
     int res=0; 
     int i=*ip;
@@ -730,7 +730,7 @@
 		  void *m, sieve_imapflags_t * imapflags,
 		  action_list_t *actions,
 		  notify_list_t *notify_list,
-		  const char **errmsg) 
+		  const char **errmsg)
 {
     const char *data;
     int ip = 0, ip_max = (bc_len/sizeof(bytecode_input_t));
@@ -761,7 +761,7 @@
        order.  all the scripts written then would have version 0x01 written
        in host byte order.*/
 
-     if(version == ntohl(1)) {
+     if(version == (int)ntohl(1)) {
 	if(errmsg) {
 	    *errmsg =
 		"Incorrect Bytecode Version, please recompile (use sievec)";

--- hmac-md5.h DELETED ---

--- md5.c DELETED ---

--- md5.h DELETED ---

--- md5global.h DELETED ---

Index: message.c
===================================================================
RCS file: /var/lib/cvs/dovecot-lda/src/libsieve/message.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- message.c	29 Mar 2005 18:37:59 -0000	1.1.1.1
+++ message.c	14 Oct 2005 20:21:47 -0000	1.2
@@ -481,7 +481,7 @@
 	case ADDRESS_USER:
 	    if (a->mailbox) {
 		char *p = strchr(a->mailbox, '+');
-		int len = p ? p - a->mailbox : strlen(a->mailbox);
+		int len = p ? p - a->mailbox : (int)strlen(a->mailbox);
 
 		am->freeme = (char *) xmalloc(len + 1);
 		strncpy(am->freeme, a->mailbox, len);

Index: message.h
===================================================================
RCS file: /var/lib/cvs/dovecot-lda/src/libsieve/message.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- message.h	29 Mar 2005 18:37:59 -0000	1.1.1.1
+++ message.h	14 Oct 2005 20:21:47 -0000	1.2
@@ -130,5 +130,11 @@
 int do_denotify(notify_list_t *n, comparator_t *comp, const void *pat,
 		void *comprock, const char *priority);
 
+/* execute some bytecode */
+int sieve_eval_bc(sieve_interp_t *i, const void *bc_in, unsigned int bc_len,
+		  void *m, sieve_imapflags_t * imapflags,
+		  action_list_t *actions,
+		  notify_list_t *notify_list,
+		  const char **errmsg);
 
 #endif

Index: script.c
===================================================================
RCS file: /var/lib/cvs/dovecot-lda/src/libsieve/script.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- script.c	10 Apr 2005 16:05:41 -0000	1.2
+++ script.c	14 Oct 2005 20:21:47 -0000	1.3
@@ -40,7 +40,6 @@
 
 #include "xmalloc.h"
 
-#include "md5global.h"
 #include "md5.h"
 #include "sieve_interface.h"
 #include "interp.h"
@@ -153,7 +152,7 @@
     return res;
 }
 
-void free_imapflags(sieve_imapflags_t *imapflags)
+static void free_imapflags(sieve_imapflags_t *imapflags)
 {
     while (imapflags->nflags)
 	free(imapflags->flag[--imapflags->nflags]);
@@ -394,12 +393,12 @@
 static int makehash(unsigned char hash[HASHSIZE],
 		    const char *s1, const char *s2)
 {
-    MD5_CTX ctx;
+    struct md5_context ctx;
 
-    MD5Init(&ctx);
-    MD5Update(&ctx, s1, strlen(s1));
-    MD5Update(&ctx, s2, strlen(s2));
-    MD5Final(hash, &ctx);
+    md5_init(&ctx);
+    md5_update(&ctx, s1, strlen(s1));
+    md5_update(&ctx, s2, strlen(s2));
+    md5_final(&ctx, hash);
 
     return SIEVE_OK;
 }
@@ -758,13 +757,6 @@
 }
 
 
-/* execute some bytecode */
-int sieve_eval_bc(sieve_interp_t *i, const void *bc_in, unsigned int bc_len,
-		  void *m, sieve_imapflags_t * imapflags,
-		  action_list_t *actions,
-		  notify_list_t *notify_list,
-		  const char **errmsg);
-
 int sieve_execute_bytecode(sieve_bytecode_t *bc, sieve_interp_t *interp,
 			   void *script_context, void *message_context) 
 {

Index: tree.c
===================================================================
RCS file: /var/lib/cvs/dovecot-lda/src/libsieve/tree.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- tree.c	29 Mar 2005 18:37:59 -0000	1.1.1.1
+++ tree.c	14 Oct 2005 20:21:47 -0000	1.2
@@ -111,7 +111,7 @@
 
 void free_test(test_t *t);
 
-void free_tl(testlist_t *tl)
+static void free_tl(testlist_t *tl)
 {
     testlist_t *tl2;
 



More information about the dovecot-cvs mailing list