Mercurial > dovecot > original-hg > dovecot-1.2
diff src/plugins/trash/trash-plugin.c @ 4451:1a35d53c18fc HEAD
Array API redesigned to work using unions. It now provides type safety
without having to enable DEBUG, as long as the compiler supports typeof().
Its API changed a bit. It now allows directly accessing the array contents,
although that's not necessarily recommended. Changed existing array usage to
be type safe in a bit more places. Removed array_t completely. Also did
s/modifyable/modifiable/.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 28 Jun 2006 16:10:25 +0300 |
parents | 593523f53500 |
children | 511f1f5c76fa |
line wrap: on
line diff
--- a/src/plugins/trash/trash-plugin.c Wed Jun 28 01:51:47 2006 +0300 +++ b/src/plugins/trash/trash-plugin.c Wed Jun 28 16:10:25 2006 +0300 @@ -16,7 +16,7 @@ #define MAX_RETRY_COUNT 3 #define TRASH_CONTEXT(obj) \ - *((void **)array_idx_modifyable(&(obj)->quota_module_contexts, \ + *((void **)array_idx_modifiable(&(obj)->quota_module_contexts, \ trash_quota_module_id)) struct trash_quota_root { @@ -46,7 +46,7 @@ static pool_t config_pool; /* trash_boxes ordered by priority, highest first */ -static array_t ARRAY_DEFINE(trash_boxes, struct trash_mailbox); +static ARRAY_DEFINE(trash_boxes, struct trash_mailbox); static int trash_clean_mailbox_open(struct trash_mailbox *trash) { @@ -96,7 +96,7 @@ uint64_t size; int ret = 0; - trashes = array_get_modifyable(&trash_boxes, &count); + trashes = array_get_modifiable(&trash_boxes, &count); for (i = 0; i < count; ) { /* expunge oldest mails first in all trash boxes with same priority */ @@ -251,7 +251,7 @@ i_stream_destroy(&input); (void)close(fd); - qsort(array_get_modifyable(&trash_boxes, NULL), + qsort(array_get_modifiable(&trash_boxes, NULL), array_count(&trash_boxes), sizeof(struct trash_mailbox), trash_mailbox_priority_cmp); return 0;