From 5ef69ddc0068e7d06f9b8d1c1c0bec5cc15a3872 Mon Sep 17 00:00:00 2001 From: Stephan Bosch <stephan@rename-it.nl> Date: Sun, 21 Aug 2016 11:16:27 +0200 Subject: [PATCH] lib-sieve: match types: Fixed match function return values to be int rather than bool. Found with clang -Wstrict-bool. --- src/lib-sieve/mcht-contains.c | 6 +++--- src/lib-sieve/mcht-is.c | 4 ++-- src/lib-sieve/mcht-matches.c | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib-sieve/mcht-contains.c b/src/lib-sieve/mcht-contains.c index d68e44097..d1e6354f1 100644 --- a/src/lib-sieve/mcht-contains.c +++ b/src/lib-sieve/mcht-contains.c @@ -50,17 +50,17 @@ static int mcht_contains_match_key const char *kp = key; if ( val_size == 0 ) - return ( key_size == 0 ); + return ( key_size == 0 ? 1 : 0 ); if ( cmp->def == NULL || cmp->def->char_match == NULL ) - return FALSE; + return 0; while ( (vp < vend) && (kp < kend) ) { if ( !cmp->def->char_match(cmp, &vp, vend, &kp, kend) ) vp++; } - return (kp == kend); + return ( kp == kend ? 1 : 0 ); } diff --git a/src/lib-sieve/mcht-is.c b/src/lib-sieve/mcht-is.c index a637790b8..ac6a19ba5 100644 --- a/src/lib-sieve/mcht-is.c +++ b/src/lib-sieve/mcht-is.c @@ -41,12 +41,12 @@ static int mcht_is_match_key const char *key, size_t key_size) { if ( val_size == 0 ) - return ( key_size == 0 ); + return ( key_size == 0 ? 1 : 0 ); if ( mctx->comparator->def != NULL && mctx->comparator->def->compare != NULL ) return (mctx->comparator->def->compare(mctx->comparator, val, val_size, key, key_size) == 0); - return FALSE; + return 0; } diff --git a/src/lib-sieve/mcht-matches.c b/src/lib-sieve/mcht-matches.c index 02ce2a833..dcc08b8e9 100644 --- a/src/lib-sieve/mcht-matches.c +++ b/src/lib-sieve/mcht-matches.c @@ -95,7 +95,7 @@ static int mcht_matches_match_key unsigned int key_offset = 0; if ( cmp->def == NULL || cmp->def->char_match == NULL ) - return FALSE; + return 0; /* Key sections */ section = t_str_new(32); /* Section (after beginning or *) */ @@ -428,11 +428,11 @@ static int mcht_matches_match_key /* Commit new match values */ sieve_match_values_commit(mctx->runenv, &mvalues); } - return TRUE; + return 1; } /* No match; drop collected match values */ sieve_match_values_abort(&mvalues); - return FALSE; + return 0; } -- GitLab