Mercurial > dovecot > original-hg > dovecot-1.2
changeset 3253:f5a1c3f7fd72 HEAD
Added ARRAY_DEFINE_PTR() which needs to be used instead of ARRAY_DEFINE()
for pointers.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 02 Apr 2005 22:31:26 +0300 |
parents | fb9eee567307 |
children | a2943c050571 |
files | src/lib-index/mail-index-sync-private.h src/lib/array.h |
diffstat | 2 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-index-sync-private.h Sat Apr 02 22:29:08 2005 +0300 +++ b/src/lib-index/mail-index-sync-private.h Sat Apr 02 22:31:26 2005 +0300 @@ -24,7 +24,7 @@ }; struct mail_index_sync_list { - const array_t *ARRAY_DEFINE(array, struct uid_range *); + const array_t *ARRAY_DEFINE_PTR(array, struct uid_range); unsigned int idx; unsigned int keyword_num; };
--- a/src/lib/array.h Sat Apr 02 22:29:08 2005 +0300 +++ b/src/lib/array.h Sat Apr 02 22:31:26 2005 +0300 @@ -41,6 +41,8 @@ #ifdef ARRAY_TYPE_CHECKS # define ARRAY_DEFINE(name, array_type) name; array_type *name ## __ ## type +# define ARRAY_DEFINE_PTR(name, array_type) \ + name; array_type **name ## __ ## type # define ARRAY_CREATE(array, pool, array_type, init_count) STMT_START { \ array_type *_array_tmp = *(array ## __ ## type); _array_tmp = NULL; \ array_create(array, pool, sizeof(array_type), init_count); \ @@ -50,6 +52,7 @@ # define ARRAY_INIT { 0, 0 }, 0 #else # define ARRAY_DEFINE(name, array_type) name +# define ARRAY_DEFINE_PTR(name, array_type) name # define ARRAY_CREATE(array, pool, array_type, init_count) \ array_create(array, pool, sizeof(array_type), init_count) /* The reason we do this for non-ARRAY_TYPE_CHECKS as well is because if we