From 7a337b62cbaac29257492d332b82a359e99bc062 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Fri, 30 Aug 2019 18:29:01 +0100 Subject: [PATCH] boolify 'optional' variables Co-authored-by: Pietro Cerutti --- browser.c | 6 +++--- compose.c | 2 +- hdrline.c | 38 +++++++++++++++++++------------------- ncrypt/crypt_gpgme.c | 6 +++--- ncrypt/pgpinvoke.c | 12 ++++++------ ncrypt/pgpkey.c | 8 ++++---- ncrypt/smime.c | 18 +++++++++--------- query.c | 4 ++-- recvattach.c | 24 ++++++++++++------------ remailer.c | 6 +++--- sidebar.c | 17 ++++++++--------- status.c | 30 +++++++++++++++--------------- 12 files changed, 85 insertions(+), 86 deletions(-) diff --git a/browser.c b/browser.c index b8c8f56b2..857a0bdb6 100644 --- a/browser.c +++ b/browser.c @@ -369,7 +369,7 @@ static const char *folder_format_str(char *buf, size_t buflen, size_t col, int c { char fn[128], fmt[128]; struct Folder *folder = (struct Folder *) data; - int optional = (flags & MUTT_FORMAT_OPTIONAL); + bool optional = (flags & MUTT_FORMAT_OPTIONAL); switch (op) { @@ -529,7 +529,7 @@ static const char *folder_format_str(char *buf, size_t buflen, size_t col, int c mutt_format_s(buf, buflen, prec, ""); } else if (folder->ff->msg_count == 0) - optional = 0; + optional = false; break; case 'N': @@ -549,7 +549,7 @@ static const char *folder_format_str(char *buf, size_t buflen, size_t col, int c mutt_format_s(buf, buflen, prec, ""); } else if (folder->ff->msg_unread == 0) - optional = 0; + optional = false; break; case 's': diff --git a/compose.c b/compose.c index fb4eaae2c..079ba0bb2 100644 --- a/compose.c +++ b/compose.c @@ -975,7 +975,7 @@ static const char *compose_format_str(char *buf, size_t buflen, size_t col, int unsigned long data, MuttFormatFlags flags) { char fmt[128], tmp[128]; - int optional = (flags & MUTT_FORMAT_OPTIONAL); + bool optional = (flags & MUTT_FORMAT_OPTIONAL); struct Menu *menu = (struct Menu *) data; *buf = '\0'; diff --git a/hdrline.c b/hdrline.c index d39e3487b..711f79b4a 100644 --- a/hdrline.c +++ b/hdrline.c @@ -560,7 +560,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co struct HdrFormatInfo *hfi = (struct HdrFormatInfo *) data; char fmt[128], tmp[1024]; char *p = NULL, *tags = NULL; - int optional = (flags & MUTT_FORMAT_OPTIONAL); + bool optional = (flags & MUTT_FORMAT_OPTIONAL); int threads = ((C_Sort & SORT_MASK) == SORT_THREADS); int is_index = (flags & MUTT_FORMAT_INDEX); size_t colorlen; @@ -632,7 +632,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co if (op == 'K') { if (optional) - optional = 0; + optional = false; /* break if 'K' returns nothing */ break; } @@ -767,7 +767,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co j *= -1; if (((now > j) || (now < (-1 * j))) ^ invert) - optional = 0; + optional = false; break; } @@ -871,7 +871,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co snprintf(buf, buflen, fmt, mutt_messages_in_thread(m, e, 0)); } else if (mutt_messages_in_thread(m, e, 0) <= 1) - optional = 0; + optional = false; break; case 'f': @@ -895,7 +895,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co } else if (mutt_addr_is_user(from)) { - optional = 0; + optional = false; } break; @@ -908,7 +908,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX); } else if (!tags) - optional = 0; + optional = false; FREE(&tags); break; @@ -945,7 +945,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co { tags = driver_tags_get_transformed_for(&e->tags, tag); if (!tags) - optional = 0; + optional = false; FREE(&tags); } } @@ -955,7 +955,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co case 'H': /* (Hormel) spam score */ if (optional) - optional = e->env->spam ? 1 : 0; + optional = e->env->spam; if (e->env->spam) mutt_format_s(buf, buflen, prec, NONULL(e->env->spam->data)); @@ -1015,7 +1015,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX); } else if (e->lines <= 0) - optional = 0; + optional = false; break; case 'L': @@ -1029,7 +1029,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co else if (!check_for_mailing_list(&e->env->to, NULL, NULL, 0) && !check_for_mailing_list(&e->env->cc, NULL, NULL, 0)) { - optional = 0; + optional = false; } break; @@ -1070,7 +1070,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co else { if (!(threads && is_index && e->collapsed && (e->num_hidden > 1))) - optional = 0; + optional = false; } break; @@ -1083,7 +1083,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co else { if (e->score == 0) - optional = 0; + optional = false; } break; @@ -1098,7 +1098,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co else if (!check_for_mailing_list_addr(&e->env->to, NULL, 0) && !check_for_mailing_list_addr(&e->env->cc, NULL, 0)) { - optional = 0; + optional = false; } break; @@ -1116,7 +1116,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co tmp[0] = '\0'; mutt_addrlist_write(tmp, sizeof(tmp), &e->env->to, true); if (optional && (tmp[0] == '\0')) - optional = 0; + optional = false; mutt_format_s(buf, buflen, prec, tmp); break; @@ -1124,7 +1124,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co tmp[0] = '\0'; mutt_addrlist_write(tmp, sizeof(tmp), &e->env->cc, true); if (optional && (tmp[0] == '\0')) - optional = 0; + optional = false; mutt_format_s(buf, buflen, prec, tmp); break; @@ -1247,7 +1247,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co mutt_format_s(buf, buflen, prec, e->env->organization ? e->env->organization : ""); } else if (!e->env->organization) - optional = 0; + optional = false; break; #ifdef USE_NNTP @@ -1257,7 +1257,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co mutt_format_s(buf, buflen, prec, e->env->x_comment_to ? e->env->x_comment_to : ""); } else if (!e->env->x_comment_to) - optional = 0; + optional = false; break; #endif @@ -1267,7 +1267,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co /* The recursion allows messages without depth to return 0. */ if (optional) - optional = count != 0; + optional = (count != 0); snprintf(fmt, sizeof(fmt), "%%%sd", prec); snprintf(buf, buflen, fmt, count); @@ -1276,7 +1276,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co case 'y': if (optional) - optional = e->env->x_label ? 1 : 0; + optional = e->env->x_label; colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_LABEL); mutt_format_s(buf + colorlen, buflen - colorlen, prec, NONULL(e->env->x_label)); diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index 04323937e..ce1463285 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -3412,7 +3412,7 @@ static const char *crypt_format_str(char *buf, size_t buflen, size_t col, int co unsigned long data, MuttFormatFlags flags) { char fmt[128]; - int optional = (flags & MUTT_FORMAT_OPTIONAL); + bool optional = (flags & MUTT_FORMAT_OPTIONAL); struct CryptEntry *entry = (struct CryptEntry *) data; struct CryptKeyInfo *key = entry->key; @@ -3445,7 +3445,7 @@ static const char *crypt_format_str(char *buf, size_t buflen, size_t col, int co snprintf(buf, buflen, fmt, crypt_key_abilities(kflags)); } else if (!(kflags & KEYFLAG_ABILITIES)) - optional = 0; + optional = false; break; case 'f': @@ -3455,7 +3455,7 @@ static const char *crypt_format_str(char *buf, size_t buflen, size_t col, int co snprintf(buf, buflen, fmt, crypt_flags(kflags)); } else if (!(kflags & KEYFLAG_RESTRICTIONS)) - optional = 0; + optional = false; break; case 'k': diff --git a/ncrypt/pgpinvoke.c b/ncrypt/pgpinvoke.c index b03ca0d6e..6015ea60c 100644 --- a/ncrypt/pgpinvoke.c +++ b/ncrypt/pgpinvoke.c @@ -97,7 +97,7 @@ static const char *fmt_pgp_command(char *buf, size_t buflen, size_t col, int col { char fmt[128]; struct PgpCommandContext *cctx = (struct PgpCommandContext *) data; - int optional = (flags & MUTT_FORMAT_OPTIONAL); + bool optional = (flags & MUTT_FORMAT_OPTIONAL); switch (op) { @@ -109,7 +109,7 @@ static const char *fmt_pgp_command(char *buf, size_t buflen, size_t col, int col snprintf(buf, buflen, fmt, NONULL(cctx->signas)); } else if (!cctx->signas) - optional = 0; + optional = false; break; } case 'f': @@ -120,7 +120,7 @@ static const char *fmt_pgp_command(char *buf, size_t buflen, size_t col, int col snprintf(buf, buflen, fmt, NONULL(cctx->fname)); } else if (!cctx->fname) - optional = 0; + optional = false; break; } case 'p': @@ -131,7 +131,7 @@ static const char *fmt_pgp_command(char *buf, size_t buflen, size_t col, int col snprintf(buf, buflen, fmt, cctx->need_passphrase ? "PGPPASSFD=0" : ""); } else if (!cctx->need_passphrase || pgp_use_gpg_agent()) - optional = 0; + optional = false; break; } case 'r': @@ -142,7 +142,7 @@ static const char *fmt_pgp_command(char *buf, size_t buflen, size_t col, int col snprintf(buf, buflen, fmt, NONULL(cctx->ids)); } else if (!cctx->ids) - optional = 0; + optional = false; break; } case 's': @@ -153,7 +153,7 @@ static const char *fmt_pgp_command(char *buf, size_t buflen, size_t col, int col snprintf(buf, buflen, fmt, NONULL(cctx->sig_fname)); } else if (!cctx->sig_fname) - optional = 0; + optional = false; break; } default: diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index 516eb1e93..7cd6b74f7 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -182,7 +182,7 @@ static const char *pgp_entry_fmt(char *buf, size_t buflen, size_t col, int cols, unsigned long data, MuttFormatFlags flags) { char fmt[128]; - int optional = (flags & MUTT_FORMAT_OPTIONAL); + bool optional = (flags & MUTT_FORMAT_OPTIONAL); struct PgpEntry *entry = (struct PgpEntry *) data; struct PgpUid *uid = entry->uid; @@ -210,7 +210,7 @@ static const char *pgp_entry_fmt(char *buf, size_t buflen, size_t col, int cols, snprintf(buf, buflen, fmt, pgp_key_abilities(kflags)); } else if (!(kflags & KEYFLAG_ABILITIES)) - optional = 0; + optional = false; break; case 'f': if (!optional) @@ -219,7 +219,7 @@ static const char *pgp_entry_fmt(char *buf, size_t buflen, size_t col, int cols, snprintf(buf, buflen, fmt, pgp_flags(kflags)); } else if (!(kflags & KEYFLAG_RESTRICTIONS)) - optional = 0; + optional = false; break; case 'k': if (!optional) @@ -251,7 +251,7 @@ static const char *pgp_entry_fmt(char *buf, size_t buflen, size_t col, int cols, else if (!(uid->trust & 0x03)) { /* undefined trust */ - optional = 0; + optional = false; } break; case 'u': diff --git a/ncrypt/smime.c b/ncrypt/smime.c index cff7a0091..596dcdaab 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -217,7 +217,7 @@ static const char *fmt_smime_command(char *buf, size_t buflen, size_t col, int c { char fmt[128]; struct SmimeCommandContext *cctx = (struct SmimeCommandContext *) data; - int optional = (flags & MUTT_FORMAT_OPTIONAL); + bool optional = (flags & MUTT_FORMAT_OPTIONAL); switch (op) { @@ -247,7 +247,7 @@ static const char *fmt_smime_command(char *buf, size_t buflen, size_t col, int c mutt_buffer_pool_release(&buf2); } else if (!C_SmimeCaLocation) - optional = 0; + optional = false; break; } @@ -259,7 +259,7 @@ static const char *fmt_smime_command(char *buf, size_t buflen, size_t col, int c snprintf(buf, buflen, fmt, NONULL(cctx->certificates)); } else if (!cctx->certificates) - optional = 0; + optional = false; break; } @@ -271,7 +271,7 @@ static const char *fmt_smime_command(char *buf, size_t buflen, size_t col, int c snprintf(buf, buflen, fmt, NONULL(cctx->intermediates)); } else if (!cctx->intermediates) - optional = 0; + optional = false; break; } @@ -283,7 +283,7 @@ static const char *fmt_smime_command(char *buf, size_t buflen, size_t col, int c snprintf(buf, buflen, fmt, NONULL(cctx->sig_fname)); } else if (!cctx->sig_fname) - optional = 0; + optional = false; break; } @@ -295,7 +295,7 @@ static const char *fmt_smime_command(char *buf, size_t buflen, size_t col, int c snprintf(buf, buflen, fmt, NONULL(cctx->key)); } else if (!cctx->key) - optional = 0; + optional = false; break; } @@ -307,7 +307,7 @@ static const char *fmt_smime_command(char *buf, size_t buflen, size_t col, int c snprintf(buf, buflen, fmt, NONULL(cctx->cryptalg)); } else if (!cctx->key) - optional = 0; + optional = false; break; } @@ -319,7 +319,7 @@ static const char *fmt_smime_command(char *buf, size_t buflen, size_t col, int c snprintf(buf, buflen, fmt, NONULL(cctx->fname)); } else if (!cctx->fname) - optional = 0; + optional = false; break; } @@ -331,7 +331,7 @@ static const char *fmt_smime_command(char *buf, size_t buflen, size_t col, int c snprintf(buf, buflen, fmt, NONULL(cctx->digestalg)); } else if (!cctx->key) - optional = 0; + optional = false; break; } diff --git a/query.c b/query.c index 7de0c9536..46d5677e7 100644 --- a/query.c +++ b/query.c @@ -274,7 +274,7 @@ static const char *query_format_str(char *buf, size_t buflen, size_t col, int co struct Query *query = entry->data; char fmt[128]; char tmp[256] = { 0 }; - int optional = (flags & MUTT_FORMAT_OPTIONAL); + bool optional = (flags & MUTT_FORMAT_OPTIONAL); switch (op) { @@ -290,7 +290,7 @@ static const char *query_format_str(char *buf, size_t buflen, size_t col, int co if (!optional) mutt_format_s(buf, buflen, prec, NONULL(query->other)); else if (!query->other || !*query->other) - optional = 0; + optional = false; break; case 'n': mutt_format_s(buf, buflen, prec, NONULL(query->name)); diff --git a/recvattach.c b/recvattach.c index b5641eabb..091af8b23 100644 --- a/recvattach.c +++ b/recvattach.c @@ -215,7 +215,7 @@ const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols, char fmt[128]; char charset[128]; struct AttachPtr *aptr = (struct AttachPtr *) data; - int optional = (flags & MUTT_FORMAT_OPTIONAL); + bool optional = (flags & MUTT_FORMAT_OPTIONAL); switch (op) { @@ -233,7 +233,7 @@ const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols, else if (!mutt_is_text_part(aptr->content) || !mutt_body_get_charset(aptr->content, charset, sizeof(charset))) { - optional = 0; + optional = false; } break; case 'c': @@ -245,7 +245,7 @@ const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols, ((aptr->content->type != TYPE_TEXT) || aptr->content->noconv) ? 'n' : 'c'); } else if ((aptr->content->type != TYPE_TEXT) || aptr->content->noconv) - optional = 0; + optional = false; break; case 'd': if (!optional) @@ -292,7 +292,7 @@ const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols, } else if (!aptr->content->d_filename && !aptr->content->filename) { - optional = 0; + optional = false; break; } /* fallthrough */ @@ -311,13 +311,13 @@ const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols, mutt_format_s(buf, buflen, prec, NONULL(aptr->content->filename)); } else if (!aptr->content->filename) - optional = 0; + optional = false; break; case 'D': if (!optional) snprintf(buf, buflen, "%c", aptr->content->deleted ? 'D' : ' '); else if (!aptr->content->deleted) - optional = 0; + optional = false; break; case 'e': if (!optional) @@ -348,7 +348,7 @@ const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols, if (!optional) mutt_format_s(buf, buflen, prec, aptr->content->subtype); else if (!aptr->content->subtype) - optional = 0; + optional = false; break; case 'n': if (!optional) @@ -385,7 +385,7 @@ const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols, mutt_format_s(buf, buflen, prec, tmp); } else if (l == 0) - optional = 0; + optional = false; break; } @@ -393,23 +393,23 @@ const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols, if (!optional) snprintf(buf, buflen, "%c", aptr->content->tagged ? '*' : ' '); else if (!aptr->content->tagged) - optional = 0; + optional = false; break; case 'T': if (!optional) mutt_format_s_tree(buf, buflen, prec, NONULL(aptr->tree)); else if (!aptr->tree) - optional = 0; + optional = false; break; case 'u': if (!optional) snprintf(buf, buflen, "%c", aptr->content->unlink ? '-' : ' '); else if (!aptr->content->unlink) - optional = 0; + optional = false; break; case 'X': if (optional) - optional = (aptr->content->attach_count + aptr->content->attach_qualifies) != 0; + optional = ((aptr->content->attach_count + aptr->content->attach_qualifies) != 0); else { snprintf(fmt, sizeof(fmt), "%%%sd", prec); diff --git a/remailer.c b/remailer.c index 8a8295111..3133c0641 100644 --- a/remailer.c +++ b/remailer.c @@ -438,7 +438,7 @@ static const char *mix_format_str(char *buf, size_t buflen, size_t col, int cols { char fmt[128]; struct Remailer *remailer = (struct Remailer *) data; - int optional = (flags & MUTT_FORMAT_OPTIONAL); + bool optional = (flags & MUTT_FORMAT_OPTIONAL); switch (op) { @@ -449,7 +449,7 @@ static const char *mix_format_str(char *buf, size_t buflen, size_t col, int cols snprintf(buf, buflen, fmt, NONULL(remailer->addr)); } else if (!remailer->addr) - optional = 0; + optional = false; break; case 'c': @@ -475,7 +475,7 @@ static const char *mix_format_str(char *buf, size_t buflen, size_t col, int cols snprintf(buf, buflen, fmt, NONULL(remailer->shortname)); } else if (!remailer->shortname) - optional = 0; + optional = false; break; default: diff --git a/sidebar.c b/sidebar.c index 00c57b505..c2b8673d9 100644 --- a/sidebar.c +++ b/sidebar.c @@ -115,7 +115,6 @@ static const char *sidebar_format_str(char *buf, size_t buflen, size_t col, int unsigned long data, MuttFormatFlags flags) { struct SbEntry *sbe = (struct SbEntry *) data; - unsigned int optional; char fmt[256]; if (!sbe || !buf) @@ -130,7 +129,7 @@ static const char *sidebar_format_str(char *buf, size_t buflen, size_t col, int bool c = Context && Context->mailbox && (mutt_str_strcmp(Context->mailbox->realpath, m->realpath) == 0); - optional = flags & MUTT_FORMAT_OPTIONAL; + bool optional = (flags & MUTT_FORMAT_OPTIONAL); switch (op) { @@ -145,7 +144,7 @@ static const char *sidebar_format_str(char *buf, size_t buflen, size_t col, int snprintf(buf, buflen, fmt, c ? Context->mailbox->msg_deleted : 0); } else if ((c && (Context->mailbox->msg_deleted == 0)) || !c) - optional = 0; + optional = false; break; case 'D': @@ -162,7 +161,7 @@ static const char *sidebar_format_str(char *buf, size_t buflen, size_t col, int snprintf(buf, buflen, fmt, m->msg_flagged); } else if (m->msg_flagged == 0) - optional = 0; + optional = false; break; case 'L': @@ -172,7 +171,7 @@ static const char *sidebar_format_str(char *buf, size_t buflen, size_t col, int snprintf(buf, buflen, fmt, c ? Context->mailbox->vcount : m->msg_count); } else if ((c && (Context->mailbox->vcount == m->msg_count)) || !c) - optional = 0; + optional = false; break; case 'N': @@ -182,7 +181,7 @@ static const char *sidebar_format_str(char *buf, size_t buflen, size_t col, int snprintf(buf, buflen, fmt, m->msg_unread); } else if (m->msg_unread == 0) - optional = 0; + optional = false; break; case 'n': @@ -192,7 +191,7 @@ static const char *sidebar_format_str(char *buf, size_t buflen, size_t col, int snprintf(buf, buflen, fmt, m->has_new ? 'N' : ' '); } else if (m->has_new == false) - optional = 0; + optional = false; break; case 'S': @@ -202,7 +201,7 @@ static const char *sidebar_format_str(char *buf, size_t buflen, size_t col, int snprintf(buf, buflen, fmt, m->msg_count); } else if (m->msg_count == 0) - optional = 0; + optional = false; break; case 't': @@ -212,7 +211,7 @@ static const char *sidebar_format_str(char *buf, size_t buflen, size_t col, int snprintf(buf, buflen, fmt, c ? Context->mailbox->msg_tagged : 0); } else if ((c && (Context->mailbox->msg_tagged == 0)) || !c) - optional = 0; + optional = false; break; case '!': diff --git a/status.c b/status.c index 7e7dc3582..8006f47a2 100644 --- a/status.c +++ b/status.c @@ -95,7 +95,7 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c unsigned long data, MuttFormatFlags flags) { char fmt[128], tmp[128]; - int optional = (flags & MUTT_FORMAT_OPTIONAL); + bool optional = (flags & MUTT_FORMAT_OPTIONAL); struct Menu *menu = (struct Menu *) data; *buf = '\0'; @@ -109,7 +109,7 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c mutt_mailbox_check(Context ? Context->mailbox : NULL, 0)); } else if (mutt_mailbox_check(Context ? Context->mailbox : NULL, 0) == 0) - optional = 0; + optional = false; break; case 'd': @@ -120,7 +120,7 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c (Context && Context->mailbox) ? Context->mailbox->msg_deleted : 0); } else if (!Context || !Context->mailbox || (Context->mailbox->msg_deleted == 0)) - optional = 0; + optional = false; break; case 'D': @@ -172,7 +172,7 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c (Context && Context->mailbox) ? Context->mailbox->msg_flagged : 0); } else if (!Context || !Context->mailbox || (Context->mailbox->msg_flagged == 0)) - optional = 0; + optional = false; break; case 'h': @@ -189,7 +189,7 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c snprintf(buf, buflen, fmt, tmp); } else if (!Context || !Context->mailbox || !Context->mailbox->size) - optional = 0; + optional = false; break; case 'L': @@ -200,7 +200,7 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c snprintf(buf, buflen, fmt, tmp); } else if (!Context || !Context->pattern) - optional = 0; + optional = false; break; case 'm': @@ -211,7 +211,7 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c (Context && Context->mailbox) ? Context->mailbox->msg_count : 0); } else if (!Context || !Context->mailbox || (Context->mailbox->msg_count == 0)) - optional = 0; + optional = false; break; case 'M': @@ -222,7 +222,7 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c (Context && Context->mailbox) ? Context->mailbox->vcount : 0); } else if (!Context || !Context->pattern) - optional = 0; + optional = false; break; case 'n': @@ -233,7 +233,7 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c (Context && Context->mailbox) ? Context->mailbox->msg_new : 0); } else if (!Context || !Context->mailbox || (Context->mailbox->msg_new == 0)) - optional = 0; + optional = false; break; case 'o': @@ -247,7 +247,7 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c } else if (!Context || !Context->mailbox || ((Context->mailbox->msg_unread - Context->mailbox->msg_new) == 0)) - optional = 0; + optional = false; break; case 'p': @@ -259,7 +259,7 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c snprintf(buf, buflen, fmt, count); } else if (count == 0) - optional = 0; + optional = false; break; } @@ -325,7 +325,7 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c snprintf(buf, buflen, fmt, read); } else if (read == 0) - optional = 0; + optional = false; break; } @@ -347,7 +347,7 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c (Context && Context->mailbox) ? Context->mailbox->msg_tagged : 0); } else if (!Context || !Context->mailbox || (Context->mailbox->msg_tagged == 0)) - optional = 0; + optional = false; break; case 'u': @@ -358,7 +358,7 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c (Context && Context->mailbox) ? Context->mailbox->msg_unread : 0); } else if (!Context || !Context->mailbox || (Context->mailbox->msg_unread == 0)) - optional = 0; + optional = false; break; case 'v': @@ -372,7 +372,7 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c snprintf(buf, buflen, fmt, (Context && Context->pattern) ? Context->pattern : ""); } else if (!Context || !Context->pattern) - optional = 0; + optional = false; break; case 0: -- 2.40.0