From a010c3905bdf8a74747491a17dc1722c6561019a Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan@rename-it.nl>
Date: Sun, 21 Aug 2016 11:57:16 +0200
Subject: [PATCH] lib-sieve: The return type of duplicate_check() is supposed
 to be bool rather than int.

Found with clang -Wstrict-bool.
---
 src/lib-sieve/sieve-actions.c            | 4 ++--
 src/lib-sieve/sieve-actions.h            | 2 +-
 src/lib-sieve/sieve-types.h              | 2 +-
 src/plugins/imapsieve/imap-sieve.c       | 2 +-
 src/plugins/lda-sieve/lda-sieve-plugin.c | 2 +-
 src/sieve-tools/sieve-test.c             | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/lib-sieve/sieve-actions.c b/src/lib-sieve/sieve-actions.c
index 30e43b14e..619088604 100644
--- a/src/lib-sieve/sieve-actions.c
+++ b/src/lib-sieve/sieve-actions.c
@@ -769,11 +769,11 @@ bool sieve_action_duplicate_check_available
 	return ( senv->duplicate_check != NULL && senv->duplicate_mark != NULL );
 }
 
-int sieve_action_duplicate_check
+bool sieve_action_duplicate_check
 (const struct sieve_script_env *senv, const void *id, size_t id_size)
 {
 	if ( senv->duplicate_check == NULL || senv->duplicate_mark == NULL)
-		return 0;
+		return FALSE;
 
 	return senv->duplicate_check(senv, id, id_size);
 }
diff --git a/src/lib-sieve/sieve-actions.h b/src/lib-sieve/sieve-actions.h
index 081210235..f2926a4f5 100644
--- a/src/lib-sieve/sieve-actions.h
+++ b/src/lib-sieve/sieve-actions.h
@@ -260,7 +260,7 @@ void sieve_act_store_get_storage_error
 
 bool sieve_action_duplicate_check_available
 	(const struct sieve_script_env *senv);
-int sieve_action_duplicate_check
+bool sieve_action_duplicate_check
 	(const struct sieve_script_env *senv, const void *id, size_t id_size);
 void sieve_action_duplicate_mark
 	(const struct sieve_script_env *senv, const void *id, size_t id_size,
diff --git a/src/lib-sieve/sieve-types.h b/src/lib-sieve/sieve-types.h
index 37aea85ed..218998d16 100644
--- a/src/lib-sieve/sieve-types.h
+++ b/src/lib-sieve/sieve-types.h
@@ -210,7 +210,7 @@ struct sieve_script_env {
 			const char **error_r);
 
 	/* Interface for marking and checking duplicates */
-	int (*duplicate_check)
+	bool (*duplicate_check)
 		(const struct sieve_script_env *senv, const void *id, size_t id_size);
 	void (*duplicate_mark)
 		(const struct sieve_script_env *senv, const void *id, size_t id_size,
diff --git a/src/plugins/imapsieve/imap-sieve.c b/src/plugins/imapsieve/imap-sieve.c
index b5d7d4514..b5572908b 100644
--- a/src/plugins/imapsieve/imap-sieve.c
+++ b/src/plugins/imapsieve/imap-sieve.c
@@ -187,7 +187,7 @@ static int imap_sieve_smtp_finish
  * Duplicate checking
  */
 
-static int imap_sieve_duplicate_check
+static bool imap_sieve_duplicate_check
 (const struct sieve_script_env *senv, const void *id,
 	size_t id_size)
 {
diff --git a/src/plugins/lda-sieve/lda-sieve-plugin.c b/src/plugins/lda-sieve/lda-sieve-plugin.c
index 2effe5852..5d1cd2dd0 100644
--- a/src/plugins/lda-sieve/lda-sieve-plugin.c
+++ b/src/plugins/lda-sieve/lda-sieve-plugin.c
@@ -120,7 +120,7 @@ static int lda_sieve_reject_mail
  * Duplicate checking
  */
 
-static int lda_sieve_duplicate_check
+static bool lda_sieve_duplicate_check
 (const struct sieve_script_env *senv, const void *id, size_t id_size)
 {
 	struct mail_deliver_context *dctx =
diff --git a/src/sieve-tools/sieve-test.c b/src/sieve-tools/sieve-test.c
index ec88d6380..ed77e4ad7 100644
--- a/src/sieve-tools/sieve-test.c
+++ b/src/sieve-tools/sieve-test.c
@@ -100,7 +100,7 @@ static int sieve_smtp_finish
  * Dummy duplicate check implementation
  */
 
-static int duplicate_check
+static bool duplicate_check
 (const struct sieve_script_env *senv, const void *id ATTR_UNUSED,
 	size_t id_size ATTR_UNUSED)
 {
-- 
GitLab