[dovecot-cvs] dovecot/src/lib-storage/index index-storage.c, 1.104, 1.105 index-storage.h, 1.114, 1.115 index-transaction.c, 1.19, 1.20

tss at dovecot.org tss at dovecot.org
Thu Mar 29 14:51:27 EEST 2007


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

Modified Files:
	index-storage.c index-storage.h index-transaction.c 
Log Message:
Better type safety to module_contexts arrays. Already fixed some bugs.



Index: index-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.c,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- index-storage.c	15 Mar 2007 14:31:18 -0000	1.104
+++ index-storage.c	29 Mar 2007 11:51:25 -0000	1.105
@@ -390,8 +390,8 @@
 	ibox->md5hdr_ext_idx =
 		mail_index_ext_register(ibox->index, "header-md5", 0, 16, 1);
 
-	array_idx_set(&ibox->index->mail_index_module_contexts,
-		      mail_storage_mail_index_module_id, &ibox);
+	MODULE_CONTEXT_SET_FULL(ibox->index, mail_storage_mail_index_module,
+				ibox, &ibox->index_module_ctx);
 
 	if ((flags & MAILBOX_OPEN_FAST) == 0)
 		index_storage_mailbox_open(ibox);
@@ -411,8 +411,7 @@
 		buffer_free(ibox->recent_flags);
 	i_free(ibox->cache_fields);
 
-	array_idx_clear(&ibox->index->mail_index_module_contexts,
-			mail_storage_mail_index_module_id);
+	MODULE_CONTEXT_UNSET(ibox->index, mail_storage_mail_index_module);
 	pool_unref(box->pool);
 }
 

Index: index-storage.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.h,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- index-storage.h	22 Feb 2007 13:37:29 -0000	1.114
+++ index-storage.h	29 Mar 2007 11:51:25 -0000	1.115
@@ -29,6 +29,8 @@
 
 struct index_mailbox {
 	struct mailbox box;
+	union mail_index_module_context index_module_ctx;
+
 	struct index_storage *storage;
 	enum mailbox_open_flags open_flags;
 

Index: index-transaction.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-transaction.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- index-transaction.c	25 Mar 2007 16:33:16 -0000	1.19
+++ index-transaction.c	29 Mar 2007 11:51:25 -0000	1.20
@@ -69,7 +69,7 @@
 		(flags & MAILBOX_TRANSACTION_FLAG_HIDE) != 0,
 		(flags & MAILBOX_TRANSACTION_FLAG_EXTERNAL) != 0);
 
-	it = MAIL_STORAGE_TRANSACTION(t);
+	it = MAIL_STORAGE_CONTEXT(t);
 	if (it == NULL) {
 		i_panic("mail storage transaction context mising for type %s",
 			box->storage->name);



More information about the dovecot-cvs mailing list