[dovecot-cvs] dovecot/src/lib-index mail-cache-transaction.c, 1.52, 1.53 mail-cache.c, 1.84, 1.85 mail-index-sync-ext.c, 1.21, 1.22 mail-index-sync.c, 1.76, 1.77 mail-index-transaction.c, 1.79, 1.80 mail-index-view-sync.c, 1.55, 1.56 mail-index-view.c, 1.48, 1.49 mail-index.c, 1.240, 1.241

cras at dovecot.org cras at dovecot.org
Sun Sep 10 15:48:22 EEST 2006


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

Modified Files:
	mail-cache-transaction.c mail-cache.c mail-index-sync-ext.c 
	mail-index-sync.c mail-index-transaction.c 
	mail-index-view-sync.c mail-index-view.c mail-index.c 
Log Message:
Replaced ARRAY_CREATE() macro with [ipt]_array_init() macros. The macro
has no side effects so it might as well be lowercased.



Index: mail-cache-transaction.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache-transaction.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- mail-cache-transaction.c	10 Sep 2006 12:33:08 -0000	1.52
+++ mail-cache-transaction.c	10 Sep 2006 12:48:18 -0000	1.53
@@ -57,7 +57,7 @@
 	ctx->cache = view->cache;
 	ctx->view = view;
 	ctx->trans = t;
-	ARRAY_CREATE(&ctx->reservations, default_pool, 32);
+	i_array_init(&ctx->reservations, 32);
 
 	if (!MAIL_CACHE_IS_UNUSABLE(ctx->cache))
 		ctx->cache_file_seq = ctx->cache->hdr->file_seq;
@@ -549,7 +549,7 @@
 		ctx->cache_data =
 			buffer_create_dynamic(default_pool,
 					      MAIL_CACHE_WRITE_BUFFER);
-		ARRAY_CREATE(&ctx->cache_data_seq, default_pool, 64);
+		i_array_init(&ctx->cache_data_seq, 64);
 	}
 
 	memset(&new_rec, 0, sizeof(new_rec));
@@ -835,7 +835,7 @@
 	   able to ask cached data from messages that have already been
 	   expunged. */
 	t_push();
-	ARRAY_CREATE(&tmp_offsets, pool_datastack_create(), 8);
+	t_array_init(&tmp_offsets, 8);
 	array_append(&tmp_offsets, &offset, 1);
 	for (;;) {
 		cache->hdr_copy.deleted_space += cache_rec->size;

Index: mail-cache.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- mail-cache.c	10 Sep 2006 12:33:08 -0000	1.84
+++ mail-cache.c	10 Sep 2006 12:48:18 -0000	1.85
@@ -528,7 +528,7 @@
 	view = i_new(struct mail_cache_view, 1);
 	view->cache = cache;
 	view->view = iview;
-	ARRAY_CREATE(&view->tmp_offsets, default_pool, 32);
+	i_array_init(&view->tmp_offsets, 32);
 	view->cached_exists_buf =
 		buffer_create_dynamic(default_pool,
 				      cache->file_fields_count + 10);

Index: mail-index-sync-ext.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-sync-ext.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- mail-index-sync-ext.c	10 Sep 2006 12:33:08 -0000	1.21
+++ mail-index-sync-ext.c	10 Sep 2006 12:48:18 -0000	1.22
@@ -27,7 +27,7 @@
 	if (array_is_created(&ctx->expunge_handlers))
 		array_clear(&ctx->expunge_handlers);
 	else
-		ARRAY_CREATE(&ctx->expunge_handlers, default_pool, 64);
+		i_array_init(&ctx->expunge_handlers, 64);
 
 	rext = array_get(&ctx->view->index->extensions, &rext_count);
 	ext = array_get(&ctx->view->map->extensions, &ext_count);
@@ -87,9 +87,8 @@
 
 	if (array_is_created(&ctx->extra_contexts))
 		array_clear(&ctx->extra_contexts);
-	else {
-		ARRAY_CREATE(&ctx->extra_contexts, default_pool, count);
-	}
+	else
+		i_array_init(&ctx->extra_contexts, count);
 
 	/* fill the context array with NULLs */
 	(void)array_idx_modifiable(&ctx->extra_contexts, count - 1);

Index: mail-index-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-sync.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- mail-index-sync.c	10 Sep 2006 12:33:09 -0000	1.76
+++ mail-index-sync.c	10 Sep 2006 12:48:18 -0000	1.77
@@ -215,7 +215,7 @@
 	   arrays so we can easily go through all of the changes. */
 	keyword_count = !array_is_created(&ctx->trans->keyword_updates) ? 0 :
 		array_count(&ctx->trans->keyword_updates);
-	ARRAY_CREATE(&ctx->sync_list, default_pool, keyword_count + 2);
+	i_array_init(&ctx->sync_list, keyword_count + 2);
 
 	if (array_is_created(&ctx->trans->expunges)) {
 		synclist = array_append_space(&ctx->sync_list);

Index: mail-index-transaction.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-transaction.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- mail-index-transaction.c	10 Sep 2006 12:33:09 -0000	1.79
+++ mail-index-transaction.c	10 Sep 2006 12:48:18 -0000	1.80
@@ -391,9 +391,8 @@
 
 	t->log_updates = TRUE;
 
-	if (!array_is_created(&t->appends)) {
-		ARRAY_CREATE(&t->appends, default_pool, 32);
-	}
+	if (!array_is_created(&t->appends))
+		i_array_init(&t->appends, 32);
 
 	/* sequence number is visible only inside given view,
 	   so let it generate it */
@@ -614,7 +613,7 @@
 	}
 
 	if (!array_is_created(&t->updates)) {
-		ARRAY_CREATE(&t->updates, default_pool, 256);
+		i_array_init(&t->updates, 256);
 		array_append(&t->updates, &u, 1);
 		return;
 	}
@@ -720,7 +719,7 @@
 	t->log_updates = TRUE;
 
 	if (!array_is_created(&t->ext_resizes))
-		ARRAY_CREATE(&t->ext_resizes, default_pool, ext_id + 2);
+		i_array_init(&t->ext_resizes, ext_id + 2);
 
 	intro.hdr_size = hdr_size;
 	intro.record_size = record_size;
@@ -747,7 +746,7 @@
 	}
 
 	if (!array_is_created(&t->ext_resets))
-		ARRAY_CREATE(&t->ext_resets, default_pool, ext_id + 2);
+		i_array_init(&t->ext_resets, ext_id + 2);
 	array_idx_set(&t->ext_resets, ext_id, &reset_id);
 }
 
@@ -790,7 +789,7 @@
 	}
 
 	if (!array_is_created(&t->ext_rec_updates))
-		ARRAY_CREATE(&t->ext_rec_updates, default_pool, ext_id + 2);
+		i_array_init(&t->ext_rec_updates, ext_id + 2);
 	array = array_idx_modifiable(&t->ext_rec_updates, ext_id);
 
 	/* @UNSAFE */
@@ -880,7 +879,7 @@
 	if (!array_is_created(&t->keyword_updates) && keywords->count > 0) {
 		uint32_t max_idx = keywords->idx[keywords->count-1];
 
-		ARRAY_CREATE(&t->keyword_updates, default_pool, max_idx + 1);
+		i_array_init(&t->keyword_updates, max_idx + 1);
 	}
 
 	/* Update add_seq and remove_seq arrays which describe the keyword

Index: mail-index-view-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-view-sync.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- mail-index-view-sync.c	10 Sep 2006 12:33:09 -0000	1.55
+++ mail-index-view-sync.c	10 Sep 2006 12:48:18 -0000	1.56
@@ -123,7 +123,7 @@
 	if (view_sync_set_log_view_range(view, MAIL_TRANSACTION_EXPUNGE) < 0)
 		return -1;
 
-	ARRAY_CREATE(expunges_r, default_pool, 64);
+	i_array_init(expunges_r, 64);
 	while ((ret = mail_transaction_log_view_next(view->log_view,
 						     &hdr, &data, NULL)) > 0) {
 		i_assert((hdr->type & MAIL_TRANSACTION_EXPUNGE) != 0);
@@ -596,7 +596,7 @@
 	struct mail_index_view_log_sync_pos *pos;
 
 	if (!array_is_created(sync_arr))
-		ARRAY_CREATE(sync_arr, default_pool, 32);
+		i_array_init(sync_arr, 32);
 
 	pos = array_append_space(sync_arr);
 	pos->log_file_seq = log_file_seq;

Index: mail-index-view.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-view.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- mail-index-view.c	10 Sep 2006 12:33:09 -0000	1.48
+++ mail-index-view.c	10 Sep 2006 12:48:18 -0000	1.49
@@ -145,7 +145,7 @@
 				return;
 		}
 	} else {
-		ARRAY_CREATE(&view->map_refs, default_pool, 4);
+		i_array_init(&view->map_refs, 4);
 	}
 
 	/* reference the given mapping. the reference is dropped when the view

Index: mail-index.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index.c,v
retrieving revision 1.240
retrieving revision 1.241
diff -u -d -r1.240 -r1.241
--- mail-index.c	10 Sep 2006 12:33:09 -0000	1.240
+++ mail-index.c	10 Sep 2006 12:48:18 -0000	1.241
@@ -34,8 +34,8 @@
 	index->fd = -1;
 
 	index->extension_pool = pool_alloconly_create("extension", 512);
-	ARRAY_CREATE(&index->extensions, index->extension_pool, 5);
-	ARRAY_CREATE(&index->sync_lost_handlers, default_pool, 4);
+	p_array_init(&index->extensions, index->extension_pool, 5);
+	i_array_init(&index->sync_lost_handlers, 4);
 	array_create(&index->mail_index_module_contexts, default_pool,
 		     sizeof(void *), I_MIN(5, mail_index_module_id));
 
@@ -45,7 +45,7 @@
 	index->keywords_ext_id =
 		mail_index_ext_register(index, "keywords", 128, 2, 1);
 	index->keywords_pool = pool_alloconly_create("keywords", 512);
-	ARRAY_CREATE(&index->keywords, default_pool, 16);
+	i_array_init(&index->keywords, 16);
 	index->keywords_hash =
 		hash_create(default_pool, index->keywords_pool, 0,
 			    strcase_hash, (hash_cmp_callback_t *)strcasecmp);
@@ -208,8 +208,8 @@
 		}
 	}
 
-	ARRAY_CREATE(&map->extensions, map->extension_pool, initial_count);
-	ARRAY_CREATE(&map->ext_id_map, map->extension_pool, initial_count);
+	p_array_init(&map->extensions, map->extension_pool, initial_count);
+	p_array_init(&map->ext_id_map, map->extension_pool, initial_count);
 }
 
 uint32_t mail_index_map_lookup_ext(struct mail_index_map *map, const char *name)
@@ -462,10 +462,8 @@
 	}
 
 	/* create file -> index mapping */
-	if (!array_is_created(&map->keyword_idx_map)) {
-		ARRAY_CREATE(&map->keyword_idx_map, default_pool,
-			     kw_hdr->keywords_count);
-	}
+	if (!array_is_created(&map->keyword_idx_map)) 
+		i_array_init(&map->keyword_idx_map, kw_hdr->keywords_count);
 
 #ifdef DEBUG
 	/* Check that existing headers are still the same. It's behind DEBUG



More information about the dovecot-cvs mailing list