From 60a9d0bd3e0acae67f5fc0729e0684b0b4c90f8c Mon Sep 17 00:00:00 2001 From: Pietro Cerutti Date: Mon, 3 Apr 2017 12:26:36 +0000 Subject: [PATCH] Boolify remaining mx_is_* functions Issue: #492 --- mailbox.h | 6 +++--- mx.c | 36 +++++++++++++++++------------------- mx.h | 2 +- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/mailbox.h b/mailbox.h index a7d880897..af19f5e36 100644 --- a/mailbox.h +++ b/mailbox.h @@ -73,13 +73,13 @@ int mx_get_magic(const char *path); int mx_set_magic(const char *s); int mx_check_mailbox(CONTEXT *ctx, int *index_hint); #ifdef USE_IMAP -int mx_is_imap(const char *p); +bool mx_is_imap(const char *p); #endif #ifdef USE_POP -int mx_is_pop(const char *p); +bool mx_is_pop(const char *p); #endif #ifdef USE_NNTP -int mx_is_nntp(const char *p); +bool mx_is_nntp(const char *p); #endif int mx_access(const char *path, int flags); diff --git a/mx.c b/mx.c index 59d5af640..000bdc052 100644 --- a/mx.c +++ b/mx.c @@ -356,73 +356,71 @@ static void mx_unlink_empty (const char *path) #ifdef USE_IMAP -int mx_is_imap(const char *p) +bool mx_is_imap(const char *p) { url_scheme_t scheme; if (!p) - return 0; + return false; if (*p == '{') - return 1; + return true; scheme = url_check_scheme (p); if (scheme == U_IMAP || scheme == U_IMAPS) - return 1; + return true; - return 0; + return false; } #endif #ifdef USE_POP -int mx_is_pop (const char *p) +bool mx_is_pop (const char *p) { url_scheme_t scheme; if (!p) - return 0; + return false; scheme = url_check_scheme (p); if (scheme == U_POP || scheme == U_POPS) - return 1; + return true; - return 0; + return false; } #endif #ifdef USE_NNTP -int mx_is_nntp (const char *p) +bool mx_is_nntp (const char *p) { url_scheme_t scheme; if (!p) - return 0; + return false; scheme = url_check_scheme (p); if (scheme == U_NNTP || scheme == U_NNTPS) - return 1; + return true; - return 0; + return false; } #endif #ifdef USE_NOTMUCH - -int mx_is_notmuch(const char *p) +bool mx_is_notmuch(const char *p) { url_scheme_t scheme; if (!p) - return 0; + return false; scheme = url_check_scheme (p); if (scheme == U_NOTMUCH) - return 1; + return true; - return 0; + return false; } - #endif int mx_get_magic (const char *path) diff --git a/mx.h b/mx.h index 249720f7f..0bfb1c89e 100644 --- a/mx.h +++ b/mx.h @@ -67,7 +67,7 @@ int mh_sync_mailbox_message (CONTEXT * ctx, int msgno); #endif #ifdef USE_NOTMUCH -int mx_is_notmuch(const char *p); +bool mx_is_notmuch(const char *p); #endif FILE *maildir_open_find_message (const char *folder, const char *msg, -- 2.40.0