[dovecot-cvs] dovecot/src/lib-storage/index index-mail-headers.c, 1.54, 1.55 index-mail.c, 1.87, 1.88 index-mailbox-check.c, 1.12, 1.13 index-search.c, 1.105, 1.106 index-storage.c, 1.79, 1.80 index-storage.h, 1.96, 1.97 index-sync.c, 1.52, 1.53

cras at dovecot.org cras at dovecot.org
Fri Jan 13 22:26:28 EET 2006


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

Modified Files:
	index-mail-headers.c index-mail.c index-mailbox-check.c 
	index-search.c index-storage.c index-storage.h index-sync.c 
Log Message:
Added "bool" type and changed all ints that were used as booleans to bool.



Index: index-mail-headers.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-mail-headers.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- index-mail-headers.c	7 Aug 2005 13:37:44 -0000	1.54
+++ index-mail-headers.c	13 Jan 2006 20:26:25 -0000	1.55
@@ -42,7 +42,7 @@
 	buffer_t *buf;
 	size_t data_size;
 	unsigned int i, j, count, match_idx, match_count;
-	int noncontiguous;
+	bool noncontiguous;
 
 	t_push();
 
@@ -444,7 +444,7 @@
 	return -1;
 }
 
-static int skip_header(const unsigned char **data, size_t len)
+static bool skip_header(const unsigned char **data, size_t len)
 {
 	const unsigned char *p = *data;
 	size_t i;
@@ -585,7 +585,7 @@
 }
 
 static void header_cache_callback(struct message_header_line *hdr,
-				  int *matched, void *context)
+				  bool *matched, void *context)
 {
 	struct index_mail *mail = context;
 

Index: index-mail.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-mail.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- index-mail.c	15 Aug 2005 10:56:48 -0000	1.87
+++ index-mail.c	13 Jan 2006 20:26:25 -0000	1.88
@@ -31,9 +31,9 @@
 	{ "mime.parts", 0, MAIL_CACHE_FIELD_VARIABLE_SIZE, 0, 0 }
 };
 
-static void index_mail_parse_body(struct index_mail *mail, int need_parts);
+static void index_mail_parse_body(struct index_mail *mail, bool need_parts);
 
-static int get_cached_parts(struct index_mail *mail)
+static bool get_cached_parts(struct index_mail *mail)
 {
 	struct mail_cache_field *cache_fields = mail->ibox->cache_fields;
 	struct message_part *part;
@@ -88,9 +88,9 @@
 	return str_c(str);
 }
 
-static int index_mail_get_fixed_field(struct index_mail *mail,
-				      enum index_cache_field field,
-				      void *data, size_t data_size)
+static bool index_mail_get_fixed_field(struct index_mail *mail,
+				       enum index_cache_field field,
+				       void *data, size_t data_size)
 {
 	buffer_t *buf;
 	int ret;
@@ -270,7 +270,7 @@
 	return data->sent_date.time;
 }
 
-static int get_cached_msgpart_sizes(struct index_mail *mail)
+static bool get_cached_msgpart_sizes(struct index_mail *mail)
 {
 	struct index_mail_data *data = &mail->data;
 
@@ -344,7 +344,7 @@
 	imap_bodystructure_parse_header(pool, part, hdr);
 }
 
-static void index_mail_parse_body(struct index_mail *mail, int need_parts)
+static void index_mail_parse_body(struct index_mail *mail, bool need_parts)
 {
 	struct index_mail_data *data = &mail->data;
 	struct mail_cache_field *cache_fields = mail->ibox->cache_fields;
@@ -499,8 +499,8 @@
 	struct mail_cache_field *cache_fields = mail->ibox->cache_fields;
 	enum mail_cache_decision_type dec;
 	string_t *str;
-	int bodystructure_cached = FALSE;
-	int plain_bodystructure = FALSE;
+	bool bodystructure_cached = FALSE;
+	bool plain_bodystructure = FALSE;
 
 	if (!data->parsed_bodystructure) {
 		if (data->save_bodystructure_header ||
@@ -577,7 +577,7 @@
 
 static void
 index_mail_get_plain_bodystructure(struct index_mail *mail, string_t *str,
-				   int extended)
+				   bool extended)
 {
 	str_printfa(str, IMAP_BODY_PLAIN_7BIT_ASCII" %"PRIuUOFF_T" %u",
 		    mail->data.parts->body_size.virtual_size,

Index: index-mailbox-check.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-mailbox-check.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- index-mailbox-check.c	14 Aug 2005 21:54:24 -0000	1.12
+++ index-mailbox-check.c	13 Jan 2006 20:26:25 -0000	1.13
@@ -27,7 +27,7 @@
 	struct index_notify_file *file;
 	struct stat st;
 	time_t last_check;
-	int notify;
+	bool notify;
 
 	/* check changes only when we can also notify of new mail */
 	last_check = I_MAX(ibox->sync_last_check, ibox->notify_last_check);

Index: index-search.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-search.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -d -r1.105 -r1.106
--- index-search.c	31 Dec 2005 13:43:14 -0000	1.105
+++ index-search.c	13 Jan 2006 20:26:25 -0000	1.106
@@ -124,7 +124,7 @@
 static void search_index_arg(struct mail_search_arg *arg, void *context)
 {
 	struct index_search_context *ctx = context;
-	int found;
+	bool found;
 
 	if (arg->type == SEARCH_SEQSET) {
 		found = seqset_contains(arg->value.seqset, ctx->mail->seq);
@@ -285,7 +285,7 @@
 search_header_context(struct index_search_context *ctx,
 		      struct mail_search_arg *arg)
 {
-	int unknown_charset;
+	bool unknown_charset;
 
 	if (arg->context != NULL) {
                 message_header_search_reset(arg->context);
@@ -439,7 +439,8 @@
 {
 	struct search_body_context *ctx = context;
         enum message_body_search_error error;
-	int ret, retry = FALSE;
+	int ret;
+	bool retry = FALSE;
 
 	if (ctx->index_ctx->error != NULL)
 		return;
@@ -481,13 +482,13 @@
 	ARG_SET_RESULT(arg, ret > 0);
 }
 
-static int search_arg_match_text(struct mail_search_arg *args,
-				 struct index_search_context *ctx)
+static bool search_arg_match_text(struct mail_search_arg *args,
+				  struct index_search_context *ctx)
 {
 	struct istream *input;
 	struct mailbox_header_lookup_ctx *headers_ctx;
 	const char *const *headers;
-	int have_headers, have_body;
+	bool have_headers, have_body;
 
 	/* first check what we need to use */
 	headers = mail_search_args_analyze(args, &have_headers, &have_body);
@@ -791,7 +792,7 @@
 	return ret;
 }
 
-static int search_match_next(struct index_search_context *ctx)
+static bool search_match_next(struct index_search_context *ctx)
 {
         struct mail_search_arg *arg;
 	int ret;

Index: index-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- index-storage.c	7 Aug 2005 13:29:33 -0000	1.79
+++ index-storage.c	13 Jan 2006 20:26:25 -0000	1.80
@@ -149,7 +149,7 @@
 	return index;
 }
 
-static void destroy_unrefed(int all)
+static void destroy_unrefed(bool all)
 {
 	struct index_list **list, *rec;
 
@@ -225,7 +225,7 @@
 
 static void index_cache_register_defaults(struct index_mailbox *ibox)
 {
-	static int initialized = FALSE;
+	static bool initialized = FALSE;
 	struct mail_cache *cache = ibox->cache;
 	const char *cache_env, *never_env;
 
@@ -383,14 +383,14 @@
 	pool_unref(box->pool);
 }
 
-int index_storage_is_readonly(struct mailbox *box)
+bool index_storage_is_readonly(struct mailbox *box)
 {
 	struct index_mailbox *ibox = (struct index_mailbox *) box;
 
 	return ibox->readonly;
 }
 
-int index_storage_allow_new_keywords(struct mailbox *box)
+bool index_storage_allow_new_keywords(struct mailbox *box)
 {
 	struct index_mailbox *ibox = (struct index_mailbox *) box;
 
@@ -398,7 +398,7 @@
 	return !ibox->readonly;
 }
 
-int index_storage_is_inconsistent(struct mailbox *box)
+bool index_storage_is_inconsistent(struct mailbox *box)
 {
 	struct index_mailbox *ibox = (struct index_mailbox *) box;
 
@@ -416,15 +416,15 @@
 }
 
 const char *index_storage_get_last_error(struct mail_storage *storage,
-					 int *syntax_error_r,
-					 int *temporary_error_r)
+					 bool *syntax_error_r,
+					 bool *temporary_error_r)
 {
 	*syntax_error_r = storage->syntax_error;
 	*temporary_error_r = storage->temporary_error;
 	return storage->error;
 }
 
-int mail_storage_set_index_error(struct index_mailbox *ibox)
+void mail_storage_set_index_error(struct index_mailbox *ibox)
 {
 	switch (mail_index_get_last_error(ibox->index)) {
 	case MAIL_INDEX_ERROR_NONE:
@@ -439,7 +439,6 @@
 	if (ibox->view != NULL)
 		mail_index_view_unlock(ibox->view);
 	mail_index_reset_error(ibox->index);
-	return FALSE;
 }
 
 struct mail_keywords *

Index: index-storage.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.h,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- index-storage.h	6 Jan 2006 14:50:35 -0000	1.96
+++ index-storage.h	13 Jan 2006 20:26:25 -0000	1.97
@@ -44,7 +44,7 @@
 	struct mail_cache *cache;
 	struct mail_vfuncs *mail_vfuncs;
 
-	int (*is_recent)(struct index_mailbox *ibox, uint32_t uid);
+	bool (*is_recent)(struct index_mailbox *ibox, uint32_t uid);
 
 	uint32_t md5hdr_ext_idx;
 
@@ -91,7 +91,7 @@
 	unsigned int cache_trans_failed:1;
 };
 
-int mail_storage_set_index_error(struct index_mailbox *ibox);
+void mail_storage_set_index_error(struct index_mailbox *ibox);
 
 void index_storage_lock_notify(struct index_mailbox *ibox,
 			       enum mailbox_lock_notify_type notify_type,
@@ -114,9 +114,9 @@
 			       enum mailbox_open_flags flags);
 void index_storage_mailbox_free(struct mailbox *box);
 
-int index_storage_is_readonly(struct mailbox *box);
-int index_storage_allow_new_keywords(struct mailbox *box);
-int index_storage_is_inconsistent(struct mailbox *box);
+bool index_storage_is_readonly(struct mailbox *box);
+bool index_storage_allow_new_keywords(struct mailbox *box);
+bool index_storage_is_inconsistent(struct mailbox *box);
 
 struct mail_keywords *
 index_keywords_create(struct mailbox_transaction_context *t,
@@ -125,7 +125,7 @@
 			 struct mail_keywords *keywords);
 
 void index_mailbox_set_recent(struct index_mailbox *ibox, uint32_t seq);
-int index_mailbox_is_recent(struct index_mailbox *ibox, uint32_t seq);
+bool index_mailbox_is_recent(struct index_mailbox *ibox, uint32_t seq);
 
 unsigned int index_storage_get_recent_count(struct mail_index_view *view);
 
@@ -135,7 +135,7 @@
 
 struct mailbox_sync_context *
 index_mailbox_sync_init(struct mailbox *box, enum mailbox_sync_flags flags,
-			int failed);
+			bool failed);
 int index_mailbox_sync_next(struct mailbox_sync_context *ctx,
 			    struct mailbox_sync_rec *sync_rec_r);
 int index_mailbox_sync_deinit(struct mailbox_sync_context *ctx,
@@ -147,8 +147,8 @@
 				 struct mail_storage_callbacks *callbacks,
 				 void *context);
 const char *index_storage_get_last_error(struct mail_storage *storage,
-					 int *syntax_error_r,
-					 int *temporary_error_r);
+					 bool *syntax_error_r,
+					 bool *temporary_error_r);
 int index_storage_get_status(struct mailbox *box,
 			     enum mailbox_status_items items,
 			     struct mailbox_status *status);
@@ -179,6 +179,6 @@
 int index_transaction_commit(struct mailbox_transaction_context *t);
 void index_transaction_rollback(struct mailbox_transaction_context *t);
 
-int index_keyword_array_cmp(const array_t *k1, const array_t *k2);
+bool index_keyword_array_cmp(const array_t *k1, const array_t *k2);
 
 #endif

Index: index-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-sync.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- index-sync.c	7 Jan 2006 00:17:52 -0000	1.52
+++ index-sync.c	13 Jan 2006 20:26:25 -0000	1.53
@@ -41,7 +41,7 @@
 	}
 }
 
-int index_mailbox_is_recent(struct index_mailbox *ibox, uint32_t seq)
+bool index_mailbox_is_recent(struct index_mailbox *ibox, uint32_t seq)
 {
 	const unsigned char *data;
 	size_t size;
@@ -125,7 +125,7 @@
 
 struct mailbox_sync_context *
 index_mailbox_sync_init(struct mailbox *box, enum mailbox_sync_flags flags,
-			int failed)
+			bool failed)
 {
 	struct index_mailbox *ibox = (struct index_mailbox *)box;
         struct index_mailbox_sync_context *ctx;
@@ -269,7 +269,7 @@
 	return ret;
 }
 
-int index_keyword_array_cmp(const array_t *k1, const array_t *k2)
+bool index_keyword_array_cmp(const array_t *k1, const array_t *k2)
 {
 	ARRAY_SET_TYPE(k1, unsigned int);
 	ARRAY_SET_TYPE(k2, unsigned int);



More information about the dovecot-cvs mailing list