[dovecot-cvs] dovecot/src/lib array.h, 1.17, 1.18 ioloop-epoll.c, 1.16, 1.17 ioloop-kqueue.c, 1.12, 1.13 module-dir.c, 1.22, 1.23 seq-range-array.c, 1.7, 1.8

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


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

Modified Files:
	array.h ioloop-epoll.c ioloop-kqueue.c module-dir.c 
	seq-range-array.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: array.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/array.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- array.h	10 Sep 2006 12:33:07 -0000	1.17
+++ array.h	10 Sep 2006 12:48:14 -0000	1.18
@@ -13,7 +13,7 @@
 	...
    };
 
-   ARRAY_CREATE(&foo->bars, default_pool, 10);
+   i_array_init(&foo->bars, 10);
 
    struct bar *bar = array_idx(&foo->bars, 5);
    struct baz *baz = array_idx(&foo->bars, 5); // compiler warning
@@ -32,8 +32,12 @@
 #include "array-decl.h"
 #include "buffer.h"
 
-#define ARRAY_CREATE(array, pool, init_count) \
+#define p_array_init(array, pool, init_count) \
 	array_create(array, pool, sizeof(*(array)->v), init_count);
+#define i_array_init(array, init_count) \
+	p_array_init(array, default_pool, init_count)
+#define t_array_init(array, init_count) \
+	p_array_init(array, pool_datastack_create(), init_count)
 
 #ifdef __GNUC__
 #  define ARRAY_TYPE_CAST_CONST(array) \

Index: ioloop-epoll.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ioloop-epoll.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- ioloop-epoll.c	10 Sep 2006 12:33:07 -0000	1.16
+++ ioloop-epoll.c	10 Sep 2006 12:48:14 -0000	1.17
@@ -32,8 +32,8 @@
 	ioloop->handler_context = ctx =
 		p_new(ioloop->pool, struct ioloop_handler_context, 1);
 
-	ARRAY_CREATE(&ctx->events, ioloop->pool, IOLOOP_INITIAL_FD_COUNT);
-	ARRAY_CREATE(&ctx->fd_index, ioloop->pool, IOLOOP_INITIAL_FD_COUNT);
+	p_array_init(&ctx->events, ioloop->pool, IOLOOP_INITIAL_FD_COUNT);
+	p_array_init(&ctx->fd_index, ioloop->pool, IOLOOP_INITIAL_FD_COUNT);
 
 	ctx->epfd = epoll_create(IOLOOP_INITIAL_FD_COUNT);
 	if (ctx->epfd < 0)

Index: ioloop-kqueue.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ioloop-kqueue.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- ioloop-kqueue.c	10 Sep 2006 12:33:07 -0000	1.12
+++ ioloop-kqueue.c	10 Sep 2006 12:48:14 -0000	1.13
@@ -42,7 +42,7 @@
 		i_fatal("kqueue() in io_loop_handler_init() failed: %m");
 	fd_close_on_exec(ctx->kq, TRUE);
 
-	ARRAY_CREATE(&ctx->events, ioloop->pool, IOLOOP_INITIAL_FD_COUNT);
+	p_array_init(&ctx->events, ioloop->pool, IOLOOP_INITIAL_FD_COUNT);
 }
 
 void io_loop_handler_deinit(struct ioloop *ioloop)

Index: module-dir.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/module-dir.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- module-dir.c	10 Sep 2006 12:33:07 -0000	1.22
+++ module-dir.c	10 Sep 2006 12:48:14 -0000	1.23
@@ -178,7 +178,7 @@
 	}
 
 	pool = pool_alloconly_create("module loader", 1024);
-	ARRAY_CREATE(&names, pool, 32);
+	p_array_init(&names, pool, 32);
 
 	modules = NULL;
 	while ((d = readdir(dirp)) != NULL) {

Index: seq-range-array.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/seq-range-array.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- seq-range-array.c	10 Sep 2006 12:33:07 -0000	1.7
+++ seq-range-array.c	10 Sep 2006 12:48:14 -0000	1.8
@@ -40,7 +40,7 @@
 	value.seq1 = value.seq2 = seq;
 
 	if (!array_is_created(array))
-		ARRAY_CREATE(array, default_pool, init_count);
+		i_array_init(array, init_count);
 
 	data = array_get_modifiable(array, &count);
 	if (count == 0) {



More information about the dovecot-cvs mailing list