From: Richard Russon Date: Fri, 8 Jun 2018 12:30:47 +0000 (+0100) Subject: boolify function params X-Git-Tag: neomutt-20180622~21^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d43d2582a49382da73370f026c6231f6fbb41ae;p=neomutt boolify function params --- diff --git a/flags.c b/flags.c index b683528af..fd13bbfe5 100644 --- a/flags.c +++ b/flags.c @@ -51,7 +51,7 @@ * @param bf true: set the flag; false: clear the flag * @param upd_ctx true: update the Context */ -void mutt_set_flag_update(struct Context *ctx, struct Header *h, int flag, int bf, int upd_ctx) +void mutt_set_flag_update(struct Context *ctx, struct Header *h, int flag, bool bf, bool upd_ctx) { if (!ctx || !h) return; diff --git a/header.h b/header.h index 6c4f951a4..1410f45bc 100644 --- a/header.h +++ b/header.h @@ -121,6 +121,6 @@ struct Header void mutt_header_free(struct Header **h); struct Header *mutt_header_new(void); -int mbox_strict_cmp_headers(const struct Header *h1, const struct Header *h2); +bool mbox_strict_cmp_headers(const struct Header *h1, const struct Header *h2); #endif /* _MUTT_HEADER_H */ diff --git a/mbox.c b/mbox.c index 68cc7946c..e0268a511 100644 --- a/mbox.c +++ b/mbox.c @@ -586,50 +586,65 @@ static int mbox_msg_open_new(struct Context *ctx, struct Message *msg, struct He return 0; } -static int strict_cmp_bodies(const struct Body *b1, const struct Body *b2) +/** + * strict_cmp_bodies - Strictly compare two email Body's + * @param b1 First Body + * @param b2 Second Body + * @retval true Body's are strictly identical + */ +static bool strict_cmp_bodies(const struct Body *b1, const struct Body *b2) { - if (b1->type != b2->type || b1->encoding != b2->encoding || + if ((b1->type != b2->type) || (b1->encoding != b2->encoding) || (mutt_str_strcmp(b1->subtype, b2->subtype) != 0) || (mutt_str_strcmp(b1->description, b2->description) != 0) || - !mutt_param_cmp_strict(&b1->parameter, &b2->parameter) || b1->length != b2->length) + !mutt_param_cmp_strict(&b1->parameter, &b2->parameter) || (b1->length != b2->length)) { - return 0; + return false; } - return 1; + return true; } /** * mbox_strict_cmp_headers - Strictly compare message headers - * @retval 1 if headers are strictly identical + * @param h1 First Header + * @param h2 Second Header + * @retval true Headers are strictly identical */ -int mbox_strict_cmp_headers(const struct Header *h1, const struct Header *h2) +bool mbox_strict_cmp_headers(const struct Header *h1, const struct Header *h2) { if (h1 && h2) { - if (h1->received != h2->received || h1->date_sent != h2->date_sent || - h1->content->length != h2->content->length || h1->lines != h2->lines || - h1->zhours != h2->zhours || h1->zminutes != h2->zminutes || - h1->zoccident != h2->zoccident || h1->mime != h2->mime || + if ((h1->received != h2->received) || (h1->date_sent != h2->date_sent) || + (h1->content->length != h2->content->length) || (h1->lines != h2->lines) || + (h1->zhours != h2->zhours) || (h1->zminutes != h2->zminutes) || + (h1->zoccident != h2->zoccident) || (h1->mime != h2->mime) || !mutt_env_cmp_strict(h1->env, h2->env) || !strict_cmp_bodies(h1->content, h2->content)) { - return 0; + return false; } else - return 1; + return true; } else { if (!h1 && !h2) - return 1; + return true; else - return 0; + return false; } } +/** + * reopen_mailbox - Close and reopen a mailbox + * @param ctx Mailbox + * @param index_hint Current email + * @retval >0 Success, e.g. #MUTT_REOPENED, #MUTT_NEW_MAIL + * @retval -1 Error + */ static int reopen_mailbox(struct Context *ctx, int *index_hint) { - int (*cmp_headers)(const struct Header *, const struct Header *) = NULL; + bool (*cmp_headers)(const struct Header *, const struct Header *) = NULL; struct Header **old_hdrs = NULL; int old_msgcount; bool msg_mod = false; diff --git a/mh.c b/mh.c index 67276d981..7b1d45ea2 100644 --- a/mh.c +++ b/mh.c @@ -566,8 +566,8 @@ static void mh_update_sequences(struct Context *ctx) FREE(&tmpfname); } -static void mh_sequences_add_one(struct Context *ctx, int n, short unseen, - short flagged, short replied) +static void mh_sequences_add_one(struct Context *ctx, int n, bool unseen, + bool flagged, bool replied) { short unseen_done = 0; short flagged_done = 0; @@ -1680,11 +1680,16 @@ static int maildir_msg_commit(struct Context *ctx, struct Message *msg) } /** - * mh_commit_msg - XXX - * commit a message to an MH folder. + * mh_commit_msg - Commit a message to an MH folder + * @param ctx Mailbox + * @param msg Message to commit + * @param hdr Email Header + * @param updseq If true, update the sequence number + * @retval 0 Success + * @retval -1 Failure */ static int mh_commit_msg(struct Context *ctx, struct Message *msg, - struct Header *hdr, short updseq) + struct Header *hdr, bool updseq) { DIR *dirp = NULL; struct dirent *de = NULL; @@ -1767,7 +1772,7 @@ static int mh_commit_msg(struct Context *ctx, struct Message *msg, */ static int mh_msg_commit(struct Context *ctx, struct Message *msg) { - return mh_commit_msg(ctx, msg, NULL, 1); + return mh_commit_msg(ctx, msg, NULL, true); } /** @@ -1799,7 +1804,7 @@ static int mh_rewrite_message(struct Context *ctx, int msgno) if (ctx->magic == MUTT_MAILDIR) rc = md_commit_message(ctx, dest, h); else - rc = mh_commit_msg(ctx, dest, h, 0); + rc = mh_commit_msg(ctx, dest, h, false); mx_msg_close(ctx, &dest); diff --git a/mx.c b/mx.c index b453c66a4..d2b5a8606 100644 --- a/mx.c +++ b/mx.c @@ -1407,7 +1407,7 @@ void mx_update_context(struct Context *ctx, int new_messages) { h2->superseded = true; if (Score) - mutt_score_message(ctx, h2, 1); + mutt_score_message(ctx, h2, true); } } @@ -1419,7 +1419,7 @@ void mx_update_context(struct Context *ctx, int new_messages) mutt_label_hash_add(ctx, h); if (Score) - mutt_score_message(ctx, h, 0); + mutt_score_message(ctx, h, false); if (h->changed) ctx->changed = true; diff --git a/mx.h b/mx.h index 0bd293f39..4da1b2fbf 100644 --- a/mx.h +++ b/mx.h @@ -182,8 +182,6 @@ bool mx_tags_is_supported(struct Context *ctx); FILE *maildir_open_find_message(const char *folder, const char *msg, char **newname); -int mbox_strict_cmp_headers(const struct Header *h1, const struct Header *h2); - void mx_alloc_memory(struct Context *ctx); void mx_update_context(struct Context *ctx, int new_messages); void mx_update_tables(struct Context *ctx, bool committing); diff --git a/ncrypt/crypt.c b/ncrypt/crypt.c index 07fbb7b07..8efe59d93 100644 --- a/ncrypt/crypt.c +++ b/ncrypt/crypt.c @@ -858,7 +858,7 @@ void crypt_extract_keys_from_messages(struct Header *h) * If oppenc_mode is true, only keys that can be determined without * prompting will be used. */ -int crypt_get_keys(struct Header *msg, char **keylist, int oppenc_mode) +int crypt_get_keys(struct Header *msg, char **keylist, bool oppenc_mode) { struct Address *addrlist = NULL, *last = NULL; const char *fqdn = mutt_fqdn(1); diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index 341df7cdb..c882fba31 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -4636,7 +4636,7 @@ static struct CryptKeyInfo *crypt_ask_for_key(char *tag, char *whatfor, short ab * If oppenc_mode is true, only keys that can be determined without prompting * will be used. */ -static char *find_keys(struct Address *addrlist, unsigned int app, int oppenc_mode) +static char *find_keys(struct Address *addrlist, unsigned int app, bool oppenc_mode) { struct ListHead crypt_hook_list = STAILQ_HEAD_INITIALIZER(crypt_hook_list); struct ListNode *crypt_hook = NULL; @@ -4759,12 +4759,12 @@ static char *find_keys(struct Address *addrlist, unsigned int app, int oppenc_mo return keylist; } -char *pgp_gpgme_findkeys(struct Address *addrlist, int oppenc_mode) +char *pgp_gpgme_findkeys(struct Address *addrlist, bool oppenc_mode) { return find_keys(addrlist, APPLICATION_PGP, oppenc_mode); } -char *smime_gpgme_findkeys(struct Address *addrlist, int oppenc_mode) +char *smime_gpgme_findkeys(struct Address *addrlist, bool oppenc_mode) { return find_keys(addrlist, APPLICATION_SMIME, oppenc_mode); } diff --git a/ncrypt/crypt_gpgme.h b/ncrypt/crypt_gpgme.h index e79eabe6b..1715a6b1e 100644 --- a/ncrypt/crypt_gpgme.h +++ b/ncrypt/crypt_gpgme.h @@ -23,6 +23,7 @@ #ifndef _NCRYPT_CRYPT_GPGME_H #define _NCRYPT_CRYPT_GPGME_H +#include #include struct Address; @@ -33,8 +34,8 @@ struct State; void pgp_gpgme_init(void); void smime_gpgme_init(void); -char *pgp_gpgme_findkeys(struct Address *addrlist, int oppenc_mode); -char *smime_gpgme_findkeys(struct Address *addrlist, int oppenc_mode); +char *pgp_gpgme_findkeys(struct Address *addrlist, bool oppenc_mode); +char *smime_gpgme_findkeys(struct Address *addrlist, bool oppenc_mode); struct Body *pgp_gpgme_encrypt_message(struct Body *a, char *keylist, int sign); struct Body *smime_gpgme_build_smime_entity(struct Body *a, char *keylist); diff --git a/ncrypt/crypt_mod.h b/ncrypt/crypt_mod.h index 6c4c1406e..e83723bbb 100644 --- a/ncrypt/crypt_mod.h +++ b/ncrypt/crypt_mod.h @@ -47,7 +47,7 @@ typedef void (*crypt_func_pgp_invoke_getkeys_t)(struct Address *addr); typedef int (*crypt_func_pgp_check_traditional_t) (FILE *fp, struct Body *b, int just_one); typedef struct Body *(*crypt_func_pgp_traditional_encryptsign_t)(struct Body *a, int flags, char *keylist); typedef struct Body *(*crypt_func_pgp_make_key_attachment_t)(char *tempf); -typedef char *(*crypt_func_findkeys_t)(struct Address *addrlist, int oppenc_mode); +typedef char *(*crypt_func_findkeys_t)(struct Address *addrlist, bool oppenc_mode); typedef struct Body *(*crypt_func_sign_message_t)(struct Body *a); typedef struct Body *(*crypt_func_pgp_encrypt_message_t)(struct Body *a, char *keylist, int sign); typedef void (*crypt_func_pgp_invoke_import_t)(const char *fname); diff --git a/ncrypt/crypt_mod_pgp_classic.c b/ncrypt/crypt_mod_pgp_classic.c index a0ed4941f..861ff13b1 100644 --- a/ncrypt/crypt_mod_pgp_classic.c +++ b/ncrypt/crypt_mod_pgp_classic.c @@ -59,7 +59,7 @@ static int crypt_mod_pgp_application_handler(struct Body *m, struct State *s) return pgp_application_pgp_handler(m, s); } -static char *crypt_mod_pgp_findkeys(struct Address *addrlist, int oppenc_mode) +static char *crypt_mod_pgp_findkeys(struct Address *addrlist, bool oppenc_mode) { return pgp_find_keys(addrlist, oppenc_mode); } diff --git a/ncrypt/crypt_mod_pgp_gpgme.c b/ncrypt/crypt_mod_pgp_gpgme.c index c55819178..c879a697c 100644 --- a/ncrypt/crypt_mod_pgp_gpgme.c +++ b/ncrypt/crypt_mod_pgp_gpgme.c @@ -78,7 +78,7 @@ static void crypt_mod_pgp_invoke_import(const char *fname) pgp_gpgme_invoke_import(fname); } -static char *crypt_mod_pgp_findkeys(struct Address *addrlist, int oppenc_mode) +static char *crypt_mod_pgp_findkeys(struct Address *addrlist, bool oppenc_mode) { return pgp_gpgme_findkeys(addrlist, oppenc_mode); } diff --git a/ncrypt/crypt_mod_smime_classic.c b/ncrypt/crypt_mod_smime_classic.c index 9a70a19b2..af64f4113 100644 --- a/ncrypt/crypt_mod_smime_classic.c +++ b/ncrypt/crypt_mod_smime_classic.c @@ -58,7 +58,7 @@ static int crypt_mod_smime_application_handler(struct Body *m, struct State *s) return smime_application_smime_handler(m, s); } -static char *crypt_mod_smime_findkeys(struct Address *addrlist, int oppenc_mode) +static char *crypt_mod_smime_findkeys(struct Address *addrlist, bool oppenc_mode) { return smime_find_keys(addrlist, oppenc_mode); } diff --git a/ncrypt/crypt_mod_smime_gpgme.c b/ncrypt/crypt_mod_smime_gpgme.c index dc7011fbb..164daf41a 100644 --- a/ncrypt/crypt_mod_smime_gpgme.c +++ b/ncrypt/crypt_mod_smime_gpgme.c @@ -63,7 +63,7 @@ static int crypt_mod_smime_application_handler(struct Body *m, struct State *s) return smime_gpgme_application_handler(m, s); } -static char *crypt_mod_smime_findkeys(struct Address *addrlist, int oppenc_mode) +static char *crypt_mod_smime_findkeys(struct Address *addrlist, bool oppenc_mode) { return smime_gpgme_findkeys(addrlist, oppenc_mode); } diff --git a/ncrypt/cryptglue.c b/ncrypt/cryptglue.c index 9ffebcfd2..6e0c4869c 100644 --- a/ncrypt/cryptglue.c +++ b/ncrypt/cryptglue.c @@ -241,7 +241,7 @@ struct Body *crypt_pgp_make_key_attachment(char *tempf) * It returns NULL if any of the keys can not be found. If oppenc_mode is * true, only keys that can be determined without prompting will be used. */ -char *crypt_pgp_findkeys(struct Address *addrlist, int oppenc_mode) +char *crypt_pgp_findkeys(struct Address *addrlist, bool oppenc_mode) { if (CRYPT_MOD_CALL_CHECK(PGP, findkeys)) return (CRYPT_MOD_CALL(PGP, findkeys))(addrlist, oppenc_mode); @@ -386,7 +386,7 @@ int crypt_smime_verify_sender(struct Header *h) * It returns NULL if any of the keys can not be found. If oppenc_mode is * true, only keys that can be determined without prompting will be used. */ -char *crypt_smime_findkeys(struct Address *addrlist, int oppenc_mode) +char *crypt_smime_findkeys(struct Address *addrlist, bool oppenc_mode) { if (CRYPT_MOD_CALL_CHECK(SMIME, findkeys)) return (CRYPT_MOD_CALL(SMIME, findkeys))(addrlist, oppenc_mode); diff --git a/ncrypt/cryptglue.h b/ncrypt/cryptglue.h index de8c48d13..b26002f98 100644 --- a/ncrypt/cryptglue.h +++ b/ncrypt/cryptglue.h @@ -30,7 +30,7 @@ struct State; void crypt_pgp_void_passphrase(void); int crypt_pgp_valid_passphrase(void); struct Body *crypt_pgp_traditional_encryptsign(struct Body *a, int flags, char *keylist); -char *crypt_pgp_findkeys(struct Address *addrlist, int oppenc_mode); +char *crypt_pgp_findkeys(struct Address *addrlist, bool oppenc_mode); struct Body *crypt_pgp_sign_message(struct Body *a); struct Body *crypt_pgp_encrypt_message(struct Body *a, char *keylist, int sign); void crypt_pgp_invoke_import(const char *fname); @@ -39,7 +39,7 @@ void crypt_pgp_set_sender(const char *sender); void crypt_smime_void_passphrase(void); int crypt_smime_valid_passphrase(void); -char *crypt_smime_findkeys(struct Address *addrlist, int oppenc_mode); +char *crypt_smime_findkeys(struct Address *addrlist, bool oppenc_mode); struct Body *crypt_smime_sign_message(struct Body *a); struct Body *crypt_smime_build_smime_entity(struct Body *a, char *certlist); void crypt_smime_invoke_import(char *infile, char *mailbox); diff --git a/ncrypt/ncrypt.h b/ncrypt/ncrypt.h index a8ef18762..a03bb256c 100644 --- a/ncrypt/ncrypt.h +++ b/ncrypt/ncrypt.h @@ -49,6 +49,7 @@ #ifndef _NCRYPT_NCRYPT_H #define _NCRYPT_NCRYPT_H +#include #include struct Address; @@ -135,7 +136,7 @@ int mutt_parse_crypt_hdr(const char *p, int set_empty_signas, int crypt_app); /* -- crypt.c -- */ int crypt_query(struct Body *m); void crypt_extract_keys_from_messages(struct Header *h); -int crypt_get_keys(struct Header *msg, char **keylist, int oppenc_mode); +int crypt_get_keys(struct Header *msg, char **keylist, bool oppenc_mode); void crypt_opportunistic_encrypt(struct Header *msg); void crypt_forget_passphrase(void); int crypt_valid_passphrase(int flags); diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index 95c8a6149..ad429af5e 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -1235,7 +1235,7 @@ struct Body *pgp_sign_message(struct Body *a) * If oppenc_mode is true, only keys that can be determined without prompting * will be used. */ -char *pgp_find_keys(struct Address *addrlist, int oppenc_mode) +char *pgp_find_keys(struct Address *addrlist, bool oppenc_mode) { struct ListHead crypt_hook_list = STAILQ_HEAD_INITIALIZER(crypt_hook_list); struct ListNode *crypt_hook = NULL; diff --git a/ncrypt/pgp.h b/ncrypt/pgp.h index fa62d72d0..e379620ea 100644 --- a/ncrypt/pgp.h +++ b/ncrypt/pgp.h @@ -50,7 +50,7 @@ char *pgp_fpr_or_lkeyid(struct PgpKeyInfo * k); int pgp_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur); -char *pgp_find_keys(struct Address *addrlist, int oppenc_mode); +char *pgp_find_keys(struct Address *addrlist, bool oppenc_mode); int pgp_application_pgp_handler(struct Body *m, struct State *s); int pgp_encrypted_handler(struct Body *a, struct State *s); diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index 579f0f486..792a9779b 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -852,7 +852,7 @@ static struct PgpKeyInfo **pgp_get_lastp(struct PgpKeyInfo *p) } struct PgpKeyInfo *pgp_getkeybyaddr(struct Address *a, short abilities, - enum PgpRing keyring, int oppenc_mode) + enum PgpRing keyring, bool oppenc_mode) { if (!a) return NULL; diff --git a/ncrypt/pgpkey.h b/ncrypt/pgpkey.h index 6d70ca2d3..64bd56cb9 100644 --- a/ncrypt/pgpkey.h +++ b/ncrypt/pgpkey.h @@ -39,7 +39,7 @@ enum PgpRing struct Body *pgp_make_key_attachment(char *tempf); struct PgpKeyInfo * pgp_ask_for_key(char *tag, char *whatfor, short abilities, enum PgpRing keyring); -struct PgpKeyInfo * pgp_getkeybyaddr(struct Address *a, short abilities, enum PgpRing keyring, int oppenc_mode); +struct PgpKeyInfo * pgp_getkeybyaddr(struct Address *a, short abilities, enum PgpRing keyring, bool oppenc_mode); struct PgpKeyInfo * pgp_getkeybystr(char *p, short abilities, enum PgpRing keyring); #endif /* _NCRYPT_PGPKEY_H */ diff --git a/ncrypt/smime.c b/ncrypt/smime.c index 16d5c70f2..a93428f5e 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -920,7 +920,7 @@ void smime_getkeys(struct Envelope *env) * If oppenc_mode is true, only keys that can be determined without * prompting will be used. */ -char *smime_find_keys(struct Address *addrlist, int oppenc_mode) +char *smime_find_keys(struct Address *addrlist, bool oppenc_mode) { struct SmimeKey *key = NULL; char *keyID = NULL, *keylist = NULL; diff --git a/ncrypt/smime.h b/ncrypt/smime.h index e46f0c98e..c924f585d 100644 --- a/ncrypt/smime.h +++ b/ncrypt/smime.h @@ -57,7 +57,7 @@ struct Body *smime_build_smime_entity(struct Body *a, char *certlist); int smime_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile); int smime_verify_sender(struct Header *h); void smime_getkeys(struct Envelope *env); -char *smime_find_keys(struct Address *addrlist, int oppenc_mode); +char *smime_find_keys(struct Address *addrlist, bool oppenc_mode); void smime_invoke_import(char *infile, char *mailbox); int smime_send_menu(struct Header *msg); diff --git a/protos.h b/protos.h index 8784ad9fc..5e73a56ae 100644 --- a/protos.h +++ b/protos.h @@ -202,12 +202,12 @@ void mutt_query_exit(void); void mutt_query_menu(char *buf, size_t buflen); void mutt_safe_path(char *s, size_t l, struct Address *a); void mutt_save_path(char *d, size_t dsize, struct Address *a); -void mutt_score_message(struct Context *ctx, struct Header *hdr, int upd_ctx); +void mutt_score_message(struct Context *ctx, struct Header *hdr, bool upd_ctx); void mutt_select_fcc(char *path, size_t pathlen, struct Header *hdr); void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfiles); void mutt_message_hook(struct Context *ctx, struct Header *hdr, int type); -void mutt_set_flag_update(struct Context *ctx, struct Header *h, int flag, int bf, int upd_ctx); -#define mutt_set_flag(a, b, c, d) mutt_set_flag_update(a, b, c, d, 1) +void mutt_set_flag_update(struct Context *ctx, struct Header *h, int flag, bool bf, bool upd_ctx); +#define mutt_set_flag(a, b, c, d) mutt_set_flag_update(a, b, c, d, true) void mutt_set_followup_to(struct Envelope *e); void mutt_shell_escape(void); void mutt_show_error(void); diff --git a/score.c b/score.c index 3dab48167..a52f67ce3 100644 --- a/score.c +++ b/score.c @@ -67,7 +67,7 @@ void mutt_check_rescore(struct Context *ctx) for (int i = 0; ctx && i < ctx->msgcount; i++) { - mutt_score_message(ctx, ctx->hdrs[i], 1); + mutt_score_message(ctx, ctx->hdrs[i], true); ctx->hdrs[i]->pair = 0; } } @@ -151,7 +151,13 @@ int mutt_parse_score(struct Buffer *buf, struct Buffer *s, unsigned long data, return 0; } -void mutt_score_message(struct Context *ctx, struct Header *hdr, int upd_ctx) +/** + * mutt_score_message - Apply scoring to an email + * @param ctx Mailbox + * @param hdr Email header + * @param upd_ctx If true, update the Context too + */ +void mutt_score_message(struct Context *ctx, struct Header *hdr, bool upd_ctx) { struct Score *tmp = NULL; struct PatternCache cache; @@ -174,11 +180,11 @@ void mutt_score_message(struct Context *ctx, struct Header *hdr, int upd_ctx) hdr->score = 0; if (hdr->score <= ScoreThresholdDelete) - mutt_set_flag_update(ctx, hdr, MUTT_DELETE, 1, upd_ctx); + mutt_set_flag_update(ctx, hdr, MUTT_DELETE, true, upd_ctx); if (hdr->score <= ScoreThresholdRead) - mutt_set_flag_update(ctx, hdr, MUTT_READ, 1, upd_ctx); + mutt_set_flag_update(ctx, hdr, MUTT_READ, true, upd_ctx); if (hdr->score >= ScoreThresholdFlag) - mutt_set_flag_update(ctx, hdr, MUTT_FLAG, 1, upd_ctx); + mutt_set_flag_update(ctx, hdr, MUTT_FLAG, true, upd_ctx); } /** diff --git a/sort.c b/sort.c index b253afc48..1b4312cec 100644 --- a/sort.c +++ b/sort.c @@ -325,7 +325,7 @@ void mutt_sort_headers(struct Context *ctx, int init) if (OptNeedRescore && Score) { for (int i = 0; i < ctx->msgcount; i++) - mutt_score_message(ctx, ctx->hdrs[i], 1); + mutt_score_message(ctx, ctx->hdrs[i], true); } OptNeedRescore = false;