From 041b6d2a1774bfb9dc36ff445b61653c65045a07 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Tue, 9 Apr 2019 00:29:04 +0100 Subject: [PATCH] Replace 0 flags with their NO_FLAGS equivalent When a function has a flags parameter, pass the matching `NO_FLAGS` symbol rather than `0`. --- browser.c | 6 ++++-- commands.c | 4 ++-- compose.c | 2 +- compress.c | 2 +- config/set.c | 2 +- copy.c | 2 +- edit.c | 10 +++++----- editmsg.c | 4 ++-- email/group.c | 2 +- enter.c | 4 ++-- handler.c | 12 ++++++------ hook.c | 2 +- icommands.c | 8 ++++---- imap/auth_oauth.c | 2 +- imap/command.c | 2 +- imap/imap.c | 32 ++++++++++++++++---------------- imap/message.c | 4 ++-- index.c | 2 +- init.c | 4 ++-- maildir/maildir.c | 2 +- maildir/mh.c | 20 ++++++++++---------- maildir/shared.c | 2 +- main.c | 2 +- mutt_account.c | 2 +- mutt_attach.c | 7 ++++--- mutt_thread.c | 2 +- mx.c | 5 +++-- ncrypt/crypt.c | 10 +++++----- ncrypt/crypt_gpgme.c | 16 +++++++++------- ncrypt/pgp.c | 2 +- ncrypt/pgpinvoke.c | 8 +++++--- ncrypt/pgpkey.c | 12 +++++++----- ncrypt/smime.c | 10 ++++++---- nntp/newsrc.c | 4 ++-- nntp/nntp.c | 2 +- notmuch/mutt_notmuch.c | 2 +- pager.c | 20 ++++++++++++-------- pattern.c | 30 +++++++++++++++--------------- query.c | 8 +++++--- recvattach.c | 19 +++++++++++++------ recvcmd.c | 4 ++-- remailer.c | 6 ++++-- sendlib.c | 11 ++++++----- sidebar.c | 2 +- status.c | 6 +++--- 45 files changed, 174 insertions(+), 146 deletions(-) diff --git a/browser.c b/browser.c index 58139a444..293bd298d 100644 --- a/browser.c +++ b/browser.c @@ -580,9 +580,11 @@ static const char *folder_format_str(char *buf, size_t buflen, size_t col, int c } if (optional) - mutt_expando_format(buf, buflen, col, cols, if_str, folder_format_str, data, 0); + mutt_expando_format(buf, buflen, col, cols, if_str, folder_format_str, data, + MUTT_FORMAT_NO_FLAGS); else if (flags & MUTT_FORMAT_OPTIONAL) - mutt_expando_format(buf, buflen, col, cols, else_str, folder_format_str, data, 0); + mutt_expando_format(buf, buflen, col, cols, else_str, folder_format_str, + data, MUTT_FORMAT_NO_FLAGS); return src; } diff --git a/commands.c b/commands.c index 5e35547ea..322f50b8a 100644 --- a/commands.c +++ b/commands.c @@ -258,12 +258,12 @@ int mutt_display_message(struct Email *cur) hfi.pager_progress = ExtPagerProgress; hfi.email = cur; mutt_make_string_info(buf, sizeof(buf), MuttIndexWindow->cols, - NONULL(C_PagerFormat), &hfi, 0); + NONULL(C_PagerFormat), &hfi, MUTT_FORMAT_NO_FLAGS); fputs(buf, fp_out); fputs("\n\n", fp_out); } - chflags = (C_Weed ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_FROM | CH_DISPLAY; + chflags = (C_Weed ? (CH_WEED | CH_REORDER) : CH_NO_FLAGS) | CH_DECODE | CH_FROM | CH_DISPLAY; #ifdef USE_NOTMUCH if (Context->mailbox->magic == MUTT_NOTMUCH) chflags |= CH_VIRTUAL; diff --git a/compose.c b/compose.c index 25caa2df9..0fc43b6ce 100644 --- a/compose.c +++ b/compose.c @@ -866,7 +866,7 @@ static void compose_status_line(char *buf, size_t buflen, size_t col, int cols, struct Menu *menu, const char *src) { mutt_expando_format(buf, buflen, col, cols, src, compose_format_str, - (unsigned long) menu, 0); + (unsigned long) menu, MUTT_FORMAT_NO_FLAGS); } /** diff --git a/compress.c b/compress.c index 7cf6a4014..1b9ab9ddf 100644 --- a/compress.c +++ b/compress.c @@ -308,7 +308,7 @@ static void expand_command_str(const struct Mailbox *m, const char *cmd, char *b return; mutt_expando_format(buf, buflen, 0, buflen, cmd, compress_format_str, - (unsigned long) m, 0); + (unsigned long) m, MUTT_FORMAT_NO_FLAGS); } /** diff --git a/config/set.c b/config/set.c index d017f8c3d..78852118b 100644 --- a/config/set.c +++ b/config/set.c @@ -162,7 +162,7 @@ void cs_init(struct ConfigSet *cs, size_t size) return; /* LCOV_EXCL_LINE */ memset(cs, 0, sizeof(*cs)); - cs->hash = mutt_hash_new(size, 0); + cs->hash = mutt_hash_new(size, MUTT_HASH_NO_FLAGS); mutt_hash_set_destructor(cs->hash, destroy, (intptr_t) cs); } diff --git a/copy.c b/copy.c index 174d997fe..a039343c0 100644 --- a/copy.c +++ b/copy.c @@ -837,7 +837,7 @@ static int append_message(struct Mailbox *dest, FILE *fp_in, struct Mailbox *src if (!fgets(buf, sizeof(buf), fp_in)) return -1; - msg = mx_msg_open_new(dest, e, is_from(buf, NULL, 0, NULL) ? 0 : MUTT_ADD_FROM); + msg = mx_msg_open_new(dest, e, is_from(buf, NULL, 0, NULL) ? MUTT_MSG_NO_FLAGS : MUTT_ADD_FROM); if (!msg) return -1; if ((dest->magic == MUTT_MBOX) || (dest->magic == MUTT_MMDF)) diff --git a/edit.c b/edit.c index 4dcdb7e4f..5418f7abf 100644 --- a/edit.c +++ b/edit.c @@ -318,7 +318,7 @@ static void be_edit_header(struct Envelope *e, bool force) mutt_addr_write(tmp, sizeof(tmp), e->to, false); if (!e->to || force) { - if (mutt_enter_string(tmp, sizeof(tmp), 4, 0) == 0) + if (mutt_enter_string(tmp, sizeof(tmp), 4, MUTT_COMP_NO_FLAGS) == 0) { mutt_addr_free(&e->to); e->to = mutt_addr_parse_list2(e->to, tmp); @@ -340,7 +340,7 @@ static void be_edit_header(struct Envelope *e, bool force) { addstr("Subject: "); mutt_str_strfcpy(tmp, e->subject ? e->subject : "", sizeof(tmp)); - if (mutt_enter_string(tmp, sizeof(tmp), 9, 0) == 0) + if (mutt_enter_string(tmp, sizeof(tmp), 9, MUTT_COMP_NO_FLAGS) == 0) mutt_str_replace(&e->subject, tmp); addch('\n'); } @@ -351,7 +351,7 @@ static void be_edit_header(struct Envelope *e, bool force) tmp[0] = '\0'; mutt_addrlist_to_local(e->cc); mutt_addr_write(tmp, sizeof(tmp), e->cc, false); - if (mutt_enter_string(tmp, sizeof(tmp), 4, 0) == 0) + if (mutt_enter_string(tmp, sizeof(tmp), 4, MUTT_COMP_NO_FLAGS) == 0) { mutt_addr_free(&e->cc); e->cc = mutt_addr_parse_list2(e->cc, tmp); @@ -372,7 +372,7 @@ static void be_edit_header(struct Envelope *e, bool force) tmp[0] = '\0'; mutt_addrlist_to_local(e->bcc); mutt_addr_write(tmp, sizeof(tmp), e->bcc, false); - if (mutt_enter_string(tmp, sizeof(tmp), 5, 0) == 0) + if (mutt_enter_string(tmp, sizeof(tmp), 5, MUTT_COMP_NO_FLAGS) == 0) { mutt_addr_free(&e->bcc); e->bcc = mutt_addr_parse_list2(e->bcc, tmp); @@ -416,7 +416,7 @@ int mutt_builtin_editor(const char *path, struct Email *msg, struct Email *cur) tmp[0] = '\0'; while (!done) { - if (mutt_enter_string(tmp, sizeof(tmp), 0, 0) == -1) + if (mutt_enter_string(tmp, sizeof(tmp), 0, MUTT_COMP_NO_FLAGS) == -1) { tmp[0] = '\0'; continue; diff --git a/editmsg.c b/editmsg.c index c093c1934..063fb4f78 100644 --- a/editmsg.c +++ b/editmsg.c @@ -82,8 +82,8 @@ static int ev_message(enum EvMessage action, struct Mailbox *m, struct Email *e) } const CopyHeaderFlags chflags = - CH_NOLEN | (((m->magic == MUTT_MBOX) || (m->magic == MUTT_MMDF)) ? 0 : CH_NOSTATUS); - rc = mutt_append_message(ctx_tmp->mailbox, m, e, 0, chflags); + CH_NOLEN | (((m->magic == MUTT_MBOX) || (m->magic == MUTT_MMDF)) ? CH_NO_FLAGS : CH_NOSTATUS); + rc = mutt_append_message(ctx_tmp->mailbox, m, e, MUTT_CM_NO_FLAGS, chflags); int oerrno = errno; mx_mbox_close(&ctx_tmp); diff --git a/email/group.c b/email/group.c index c1ab2295f..380b6e852 100644 --- a/email/group.c +++ b/email/group.c @@ -42,7 +42,7 @@ static struct Hash *Groups = NULL; */ void mutt_grouplist_init(void) { - Groups = mutt_hash_new(1031, 0); + Groups = mutt_hash_new(1031, MUTT_HASH_NO_FLAGS); } /** diff --git a/enter.c b/enter.c index feae1ec8e..276d50547 100644 --- a/enter.c +++ b/enter.c @@ -646,8 +646,8 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, (memcmp(tempbuf, state->wbuf, state->lastchar * sizeof(wchar_t)) == 0))) { mutt_select_file(buf, buflen, - ((flags & MUTT_EFILE) ? MUTT_SEL_FOLDER : 0) | - (multiple ? MUTT_SEL_MULTI : 0), + ((flags & MUTT_EFILE) ? MUTT_SEL_FOLDER : MUTT_SEL_NO_FLAGS) | + (multiple ? MUTT_SEL_MULTI : MUTT_SEL_NO_FLAGS), files, numfiles); if (buf[0] != '\0') { diff --git a/handler.c b/handler.c index 719090ef9..7b0f5c210 100644 --- a/handler.c +++ b/handler.c @@ -717,9 +717,9 @@ static int message_handler(struct Body *a, struct State *s) (((s->flags & MUTT_WEED) || ((s->flags & (MUTT_DISPLAY | MUTT_PRINTING)) && C_Weed)) ? (CH_WEED | CH_REORDER) : - 0) | - (s->prefix ? CH_PREFIX : 0) | CH_DECODE | CH_FROM | - ((s->flags & MUTT_DISPLAY) ? CH_DISPLAY : 0), + CH_NO_FLAGS) | + (s->prefix ? CH_PREFIX : CH_NO_FLAGS) | CH_DECODE | CH_FROM | + ((s->flags & MUTT_DISPLAY) ? CH_DISPLAY : CH_NO_FLAGS), s->prefix); if (s->prefix) @@ -859,7 +859,7 @@ static int external_body_handler(struct Body *b, struct State *s) } mutt_copy_hdr(s->fp_in, s->fp_out, ftello(s->fp_in), b->parts->offset, - (C_Weed ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE, NULL); + (C_Weed ? (CH_WEED | CH_REORDER) : CH_NO_FLAGS) | CH_DECODE, NULL); } } else if (expiration && (expire < time(NULL))) @@ -874,7 +874,7 @@ static int external_body_handler(struct Body *b, struct State *s) state_attach_puts(strbuf, s); mutt_copy_hdr(s->fp_in, s->fp_out, ftello(s->fp_in), b->parts->offset, - (C_Weed ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_DISPLAY, NULL); + (C_Weed ? (CH_WEED | CH_REORDER) : CH_NO_FLAGS) | CH_DECODE | CH_DISPLAY, NULL); } } else @@ -891,7 +891,7 @@ static int external_body_handler(struct Body *b, struct State *s) state_attach_puts(strbuf, s); mutt_copy_hdr(s->fp_in, s->fp_out, ftello(s->fp_in), b->parts->offset, - (C_Weed ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_DISPLAY, NULL); + (C_Weed ? (CH_WEED | CH_REORDER) : CH_NO_FLAGS) | CH_DECODE | CH_DISPLAY, NULL); } } diff --git a/hook.c b/hook.c index c21a9d776..3f1d352fd 100644 --- a/hook.c +++ b/hook.c @@ -337,7 +337,7 @@ enum CommandResult mutt_parse_unhook(struct Buffer *buf, struct Buffer *s, mutt_buffer_printf(err, "%s", _("unhook: Can't do unhook * from within a hook")); return MUTT_CMD_WARNING; } - mutt_delete_hooks(0); + mutt_delete_hooks(MUTT_HOOK_NO_FLAGS); mutt_ch_lookup_remove(); } else diff --git a/icommands.c b/icommands.c index d748f7c64..02d3d416a 100644 --- a/icommands.c +++ b/icommands.c @@ -285,7 +285,7 @@ static enum CommandResult icmd_bind(struct Buffer *buf, struct Buffer *s, mutt_buffer_free(&filebuf); struct Pager info = { 0 }; - if (mutt_pager((bind) ? "bind" : "macro", tempfile, 0, &info) == -1) + if (mutt_pager((bind) ? "bind" : "macro", tempfile, MUTT_PAGER_NO_FLAGS, &info) == -1) { mutt_buffer_printf(err, _("Could not create temporary file %s"), tempfile); return MUTT_CMD_ERROR; @@ -312,7 +312,7 @@ static enum CommandResult icmd_set(struct Buffer *buf, struct Buffer *s, if (mutt_str_strcmp(s->data, "set all") == 0) { - dump_config(Config, CS_DUMP_STYLE_NEO, 0, fp_out); + dump_config(Config, CS_DUMP_STYLE_NEO, CS_DUMP_NO_FLAGS, fp_out); } else if (mutt_str_strcmp(s->data, "set") == 0) { @@ -327,7 +327,7 @@ static enum CommandResult icmd_set(struct Buffer *buf, struct Buffer *s, mutt_file_fclose(&fp_out); struct Pager info = { 0 }; - if (mutt_pager("set", tempfile, 0, &info) == -1) + if (mutt_pager("set", tempfile, MUTT_PAGER_NO_FLAGS, &info) == -1) { mutt_buffer_addstr(err, _("Could not create temporary file")); return MUTT_CMD_ERROR; @@ -356,7 +356,7 @@ static enum CommandResult icmd_version(struct Buffer *buf, struct Buffer *s, mutt_file_fclose(&fp_out); struct Pager info = { 0 }; - if (mutt_pager("version", tempfile, 0, &info) == -1) + if (mutt_pager("version", tempfile, MUTT_PAGER_NO_FLAGS, &info) == -1) { mutt_buffer_addstr(err, _("Could not create temporary file")); return MUTT_CMD_ERROR; diff --git a/imap/auth_oauth.c b/imap/auth_oauth.c index cf4900720..469d8852d 100644 --- a/imap/auth_oauth.c +++ b/imap/auth_oauth.c @@ -84,7 +84,7 @@ enum ImapAuthRes imap_auth_oauth(struct ImapAccountData *adata, const char *meth /* The error response was in SASL continuation, so continue the SASL * to cause a failure and exit SASL input. See RFC 7628 3.2.3 */ mutt_socket_send(adata->conn, "\001"); - rc = imap_exec(adata, ibuf, 0); + rc = imap_exec(adata, ibuf, IMAP_CMD_NO_FLAGS); } if (rc != IMAP_EXEC_SUCCESS) diff --git a/imap/command.c b/imap/command.c index 0d6e4ffcf..ae1ce710e 100644 --- a/imap/command.c +++ b/imap/command.c @@ -1037,7 +1037,7 @@ static int cmd_handle_untagged(struct ImapAccountData *adata) */ int imap_cmd_start(struct ImapAccountData *adata, const char *cmdstr) { - return cmd_start(adata, cmdstr, 0); + return cmd_start(adata, cmdstr, IMAP_CMD_NO_FLAGS); } /** diff --git a/imap/imap.c b/imap/imap.c index d46041708..5e196bd79 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -77,7 +77,7 @@ bool C_ImapIdle; ///< Config: (imap) Use the IMAP IDLE extension to check for ne */ static int check_capabilities(struct ImapAccountData *adata) { - if (imap_exec(adata, "CAPABILITY", 0) != IMAP_EXEC_SUCCESS) + if (imap_exec(adata, "CAPABILITY", IMAP_CMD_NO_FLAGS) != IMAP_EXEC_SUCCESS) { imap_error("check_capabilities", adata->buf); return -1; @@ -576,7 +576,7 @@ int imap_create_mailbox(struct ImapAccountData *adata, char *mailbox) imap_munge_mbox_name(adata->unicode, mbox, sizeof(mbox), mailbox); snprintf(buf, sizeof(buf), "CREATE %s", mbox); - if (imap_exec(adata, buf, 0) != IMAP_EXEC_SUCCESS) + if (imap_exec(adata, buf, IMAP_CMD_NO_FLAGS) != IMAP_EXEC_SUCCESS) { mutt_error(_("CREATE failed: %s"), imap_cmd_trailer(adata)); return -1; @@ -623,7 +623,7 @@ int imap_rename_mailbox(struct ImapAccountData *adata, char *oldname, const char struct Buffer *b = mutt_buffer_pool_get(); mutt_buffer_printf(b, "RENAME %s %s", oldmbox, newmbox); - if (imap_exec(adata, mutt_b2s(b), 0) != IMAP_EXEC_SUCCESS) + if (imap_exec(adata, mutt_b2s(b), IMAP_CMD_NO_FLAGS) != IMAP_EXEC_SUCCESS) rc = -1; mutt_buffer_pool_release(&b); @@ -648,7 +648,7 @@ int imap_delete_mailbox(struct Mailbox *m, char *path) imap_munge_mbox_name(adata->unicode, mbox, sizeof(mbox), url->path); url_free(&url); snprintf(buf, sizeof(buf), "DELETE %s", mbox); - if (imap_exec(m->account->adata, buf, 0) != IMAP_EXEC_SUCCESS) + if (imap_exec(m->account->adata, buf, IMAP_CMD_NO_FLAGS) != IMAP_EXEC_SUCCESS) return -1; return 0; @@ -883,7 +883,7 @@ int imap_open_connection(struct ImapAccountData *adata) } if (ans == MUTT_YES) { - enum ImapExecResult rc = imap_exec(adata, "STARTTLS", 0); + enum ImapExecResult rc = imap_exec(adata, "STARTTLS", IMAP_CMD_NO_FLAGS); if (rc == IMAP_EXEC_FATAL) goto bail; if (rc != IMAP_EXEC_ERROR) @@ -896,7 +896,7 @@ int imap_open_connection(struct ImapAccountData *adata) else { /* RFC2595 demands we recheck CAPABILITY after TLS completes. */ - if (imap_exec(adata, "CAPABILITY", 0)) + if (imap_exec(adata, "CAPABILITY", IMAP_CMD_NO_FLAGS)) goto bail; } } @@ -1161,7 +1161,7 @@ int imap_sync_message_for_copy(struct Mailbox *m, struct Email *e, /* after all this it's still possible to have no flags, if you * have no ACL rights */ - if (*flags && (imap_exec(adata, cmd->data, 0) != IMAP_EXEC_SUCCESS) && + if (*flags && (imap_exec(adata, cmd->data, IMAP_CMD_NO_FLAGS) != IMAP_EXEC_SUCCESS) && err_continue && (*err_continue != MUTT_YES)) { *err_continue = imap_continue("imap_sync_message: STORE failed", adata->buf); @@ -1284,7 +1284,7 @@ static int imap_status(struct ImapAccountData *adata, struct ImapMboxData *mdata snprintf(cmd, sizeof(cmd), "STATUS %s (UIDNEXT %s UNSEEN RECENT MESSAGES)", mdata->munge_name, uid_validity_flag); - int rc = imap_exec(adata, cmd, queue ? IMAP_CMD_QUEUE : 0 | IMAP_CMD_POLL); + int rc = imap_exec(adata, cmd, queue ? IMAP_CMD_QUEUE : IMAP_CMD_NO_FLAGS | IMAP_CMD_POLL); if (rc < 0) { mutt_debug(LL_DEBUG1, "Error queueing cmd\n"); @@ -1368,7 +1368,7 @@ int imap_search(struct Mailbox *m, const struct PatternHead *pat) FREE(&buf.data); return -1; } - if (imap_exec(adata, buf.data, 0) != IMAP_EXEC_SUCCESS) + if (imap_exec(adata, buf.data, IMAP_CMD_NO_FLAGS) != IMAP_EXEC_SUCCESS) { FREE(&buf.data); return -1; @@ -1418,7 +1418,7 @@ int imap_subscribe(char *path, bool subscribe) snprintf(buf, sizeof(buf), "%sSUBSCRIBE %s", subscribe ? "" : "UN", mdata->munge_name); - if (imap_exec(adata, buf, 0) != IMAP_EXEC_SUCCESS) + if (imap_exec(adata, buf, IMAP_CMD_NO_FLAGS) != IMAP_EXEC_SUCCESS) { imap_mdata_free((void *) &mdata); return -1; @@ -1581,7 +1581,7 @@ int imap_fast_trash(struct Mailbox *m, char *dest) } /* let's get it on */ - rc = imap_exec(adata, NULL, 0); + rc = imap_exec(adata, NULL, IMAP_CMD_NO_FLAGS); if (rc == IMAP_EXEC_ERROR) { if (triedcreate) @@ -1754,7 +1754,7 @@ int imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close) /* Flush the queued flags if any were changed in sync_helper. */ if (rc > 0) - if (imap_exec(adata, NULL, 0) != IMAP_EXEC_SUCCESS) + if (imap_exec(adata, NULL, IMAP_CMD_NO_FLAGS) != IMAP_EXEC_SUCCESS) rc = -1; if (rc < 0) @@ -1793,7 +1793,7 @@ int imap_sync_mailbox(struct Mailbox *m, bool expunge, bool close) mutt_message(_("Expunging messages from server...")); /* Set expunge bit so we don't get spurious reopened messages */ mdata->reopen |= IMAP_EXPUNGE_EXPECTED; - if (imap_exec(adata, "EXPUNGE", 0) != IMAP_EXEC_SUCCESS) + if (imap_exec(adata, "EXPUNGE", IMAP_CMD_NO_FLAGS) != IMAP_EXEC_SUCCESS) { mdata->reopen &= ~IMAP_EXPUNGE_EXPECTED; imap_error(_("imap_sync_mailbox: EXPUNGE failed"), adata->buf); @@ -1943,7 +1943,7 @@ int imap_login(struct ImapAccountData *adata) imap_exec(adata, "LIST \"\" \"\"", IMAP_CMD_QUEUE); /* we may need the root delimiter before we open a mailbox */ - imap_exec(adata, NULL, 0); + imap_exec(adata, NULL, IMAP_CMD_NO_FLAGS); } if (adata->state < IMAP_AUTHENTICATED) @@ -2400,7 +2400,7 @@ static int imap_tags_commit(struct Mailbox *m, struct Email *e, char *buf) /* Should we return here, or we are fine and we could * continue to add new flags */ - if (imap_exec(adata, cmd->data, 0) != IMAP_EXEC_SUCCESS) + if (imap_exec(adata, cmd->data, IMAP_CMD_NO_FLAGS) != IMAP_EXEC_SUCCESS) { mutt_buffer_free(&cmd); return -1; @@ -2425,7 +2425,7 @@ static int imap_tags_commit(struct Mailbox *m, struct Email *e, char *buf) mutt_buffer_addstr(cmd, buf); mutt_buffer_addstr(cmd, ")"); - if (imap_exec(adata, cmd->data, 0) != IMAP_EXEC_SUCCESS) + if (imap_exec(adata, cmd->data, IMAP_CMD_NO_FLAGS) != IMAP_EXEC_SUCCESS) { mutt_debug(LL_DEBUG1, "fail to add new flags\n"); mutt_buffer_free(&cmd); diff --git a/imap/message.c b/imap/message.c index 28acc0c3f..51ec083e8 100644 --- a/imap/message.c +++ b/imap/message.c @@ -577,7 +577,7 @@ static void imap_alloc_uid_hash(struct ImapAccountData *adata, unsigned int msn_ { struct ImapMboxData *mdata = adata->mailbox->mdata; if (!mdata->uid_hash) - mdata->uid_hash = mutt_hash_int_new(MAX(6 * msn_count / 5, 30), 0); + mdata->uid_hash = mutt_hash_int_new(MAX(6 * msn_count / 5, 30), MUTT_HASH_NO_FLAGS); } /** @@ -1646,7 +1646,7 @@ int imap_copy_messages(struct Mailbox *m, struct EmailList *el, char *dest, bool } /* let's get it on */ - rc = imap_exec(adata, NULL, 0); + rc = imap_exec(adata, NULL, IMAP_CMD_NO_FLAGS); if (rc == IMAP_EXEC_ERROR) { if (triedcreate) diff --git a/index.c b/index.c index eb79c4cd2..ab1bbf622 100644 --- a/index.c +++ b/index.c @@ -3203,7 +3203,7 @@ int mutt_index_menu(void) case OP_MAIL: if (!prereq(Context, menu, CHECK_ATTACH)) break; - ci_send_message(0, NULL, NULL, Context, NULL); + ci_send_message(SEND_NO_FLAGS, NULL, NULL, Context, NULL); menu->redraw = REDRAW_FULL; break; diff --git a/init.c b/init.c index 2a0f4c341..357f587b0 100644 --- a/init.c +++ b/init.c @@ -2965,7 +2965,7 @@ void mutt_free_opts(void) mutt_replacelist_free(&SpamList); mutt_replacelist_free(&SubjectRegexList); - mutt_delete_hooks(0); + mutt_delete_hooks(MUTT_HOOK_NO_FLAGS); mutt_hist_free(); mutt_free_keys(); @@ -3348,7 +3348,7 @@ int mutt_query_variables(struct ListHead *queries) mutt_buffer_strcpy(value, tmp->data); } - dump_config_neo(Config, he, value, NULL, 0, stdout); + dump_config_neo(Config, he, value, NULL, CS_DUMP_NO_FLAGS, stdout); } mutt_buffer_free(&value); diff --git a/maildir/maildir.c b/maildir/maildir.c index c61adf4e9..7928963b2 100644 --- a/maildir/maildir.c +++ b/maildir/maildir.c @@ -430,7 +430,7 @@ int maildir_mbox_check(struct Mailbox *m, int *index_hint) /* we create a hash table keyed off the canonical (sans flags) filename * of each message we scanned. This is used in the loop over the * existing messages below to do some correlation. */ - fnames = mutt_hash_new(count, 0); + fnames = mutt_hash_new(count, MUTT_HASH_NO_FLAGS); for (p = md; p; p = p->next) { diff --git a/maildir/mh.c b/maildir/mh.c index 69e4ce145..d767878e3 100644 --- a/maildir/mh.c +++ b/maildir/mh.c @@ -306,7 +306,7 @@ int mh_read_sequences(struct MhSequences *mhs, const char *path) char *buf = NULL; size_t sz = 0; - MhSeqFlags f; + MhSeqFlags flags; int first, last, rc = 0; char pathname[PATH_MAX]; @@ -323,11 +323,11 @@ int mh_read_sequences(struct MhSequences *mhs, const char *path) continue; if (mutt_str_strcmp(t, C_MhSeqUnseen) == 0) - f = MH_SEQ_UNSEEN; + flags = MH_SEQ_UNSEEN; else if (mutt_str_strcmp(t, C_MhSeqFlagged) == 0) - f = MH_SEQ_FLAGGED; + flags = MH_SEQ_FLAGGED; else if (mutt_str_strcmp(t, C_MhSeqReplied) == 0) - f = MH_SEQ_REPLIED; + flags = MH_SEQ_REPLIED; else /* unknown sequence */ continue; @@ -340,7 +340,7 @@ int mh_read_sequences(struct MhSequences *mhs, const char *path) goto out; } for (; first <= last; first++) - mhs_set(mhs, first, f); + mhs_set(mhs, first, flags); } } @@ -503,11 +503,11 @@ void mh_update_maildir(struct Maildir *md, struct MhSequences *mhs) if (mutt_str_atoi(p, &i) < 0) continue; - MhSeqFlags f = mhs_check(mhs, i); + MhSeqFlags flags = mhs_check(mhs, i); - md->email->read = (f & MH_SEQ_UNSEEN) ? false : true; - md->email->flagged = (f & MH_SEQ_FLAGGED) ? true : false; - md->email->replied = (f & MH_SEQ_REPLIED) ? true : false; + md->email->read = (flags & MH_SEQ_UNSEEN) ? false : true; + md->email->flagged = (flags & MH_SEQ_FLAGGED) ? true : false; + md->email->replied = (flags & MH_SEQ_REPLIED) ? true : false; } } @@ -669,7 +669,7 @@ int mh_mbox_check(struct Mailbox *m, int *index_hint) mhs_free_sequences(&mhs); /* check for modifications and adjust flags */ - fnames = mutt_hash_new(count, 0); + fnames = mutt_hash_new(count, MUTT_HASH_NO_FLAGS); for (p = md; p; p = p->next) { diff --git a/maildir/shared.c b/maildir/shared.c index 5189c9170..851e907bb 100644 --- a/maildir/shared.c +++ b/maildir/shared.c @@ -1096,7 +1096,7 @@ int mh_rewrite_message(struct Mailbox *m, int msgno) long old_body_length = e->content->length; long old_hdr_lines = e->lines; - struct Message *dest = mx_msg_open_new(m, e, 0); + struct Message *dest = mx_msg_open_new(m, e, MUTT_MSG_NO_FLAGS); if (!dest) return -1; diff --git a/main.c b/main.c index a4f7a3e47..273ecf2ac 100644 --- a/main.c +++ b/main.c @@ -1206,7 +1206,7 @@ int main(int argc, char *argv[], char *envp[]) repeat_error = true; struct Mailbox *m = mx_path_resolve(folder); - Context = mx_mbox_open(m, ((flags & MUTT_CLI_RO) || C_ReadOnly) ? MUTT_READONLY : 0); + Context = mx_mbox_open(m, ((flags & MUTT_CLI_RO) || C_ReadOnly) ? MUTT_READONLY : MUTT_OPEN_NO_FLAGS); if (!Context) { mailbox_free(&m); diff --git a/mutt_account.c b/mutt_account.c index 5e0ed18fd..991269693 100644 --- a/mutt_account.c +++ b/mutt_account.c @@ -231,7 +231,7 @@ int mutt_account_getuser(struct ConnAccount *account) /* L10N: Example: Username at myhost.com */ snprintf(prompt, sizeof(prompt), _("Username at %s: "), account->host); mutt_str_strfcpy(account->user, Username, sizeof(account->user)); - if (mutt_get_field_unbuffered(prompt, account->user, sizeof(account->user), 0)) + if (mutt_get_field_unbuffered(prompt, account->user, sizeof(account->user), MUTT_COMP_NO_FLAGS)) return -1; } diff --git a/mutt_attach.c b/mutt_attach.c index c4c961363..980dd9a22 100644 --- a/mutt_attach.c +++ b/mutt_attach.c @@ -624,7 +624,7 @@ int mutt_view_attachment(FILE *fp, struct Body *a, enum ViewAttachMode mode, info.email = e; rc = mutt_do_pager(desc, pagerfile, - MUTT_PAGER_ATTACHMENT | (is_message ? MUTT_PAGER_MESSAGE : 0), + MUTT_PAGER_ATTACHMENT | (is_message ? MUTT_PAGER_MESSAGE : MUTT_PAGER_NO_FLAGS), &info); *pagerfile = '\0'; } @@ -816,7 +816,8 @@ int mutt_save_attachment(FILE *fp, struct Body *m, char *path, mailbox_free(&m_att); return -1; } - msg = mx_msg_open_new(ctx->mailbox, en, is_from(buf, NULL, 0, NULL) ? 0 : MUTT_ADD_FROM); + msg = mx_msg_open_new(ctx->mailbox, en, + is_from(buf, NULL, 0, NULL) ? MUTT_MSG_NO_FLAGS : MUTT_ADD_FROM); if (!msg) { mx_mbox_close(&ctx); @@ -825,7 +826,7 @@ int mutt_save_attachment(FILE *fp, struct Body *m, char *path, if ((ctx->mailbox->magic == MUTT_MBOX) || (ctx->mailbox->magic == MUTT_MMDF)) chflags = CH_FROM | CH_UPDATE_LEN; chflags |= ((ctx->mailbox->magic == MUTT_MAILDIR) ? CH_NOSTATUS : CH_UPDATE); - if ((mutt_copy_message_fp(msg->fp, fp, en, 0, chflags) == 0) && + if ((mutt_copy_message_fp(msg->fp, fp, en, MUTT_CM_NO_FLAGS, chflags) == 0) && (mx_msg_commit(ctx->mailbox, msg) == 0)) { rc = 0; diff --git a/mutt_thread.c b/mutt_thread.c index 4b75f6dba..b42c695a8 100644 --- a/mutt_thread.c +++ b/mutt_thread.c @@ -1432,7 +1432,7 @@ int mutt_messages_in_thread(struct Mailbox *m, struct Email *e, int flag) */ struct Hash *mutt_make_id_hash(struct Mailbox *m) { - struct Hash *hash = mutt_hash_new(m->msg_count * 2, 0); + struct Hash *hash = mutt_hash_new(m->msg_count * 2, MUTT_HASH_NO_FLAGS); for (int i = 0; i < m->msg_count; i++) { diff --git a/mx.c b/mx.c index e343fa52b..fac8b4649 100644 --- a/mx.c +++ b/mx.c @@ -499,7 +499,8 @@ static int trash_append(struct Mailbox *m) { if (m->emails[i]->deleted && (!m->emails[i]->purge)) { - if (mutt_append_message(ctx_trash->mailbox, m, m->emails[i], 0, 0) == -1) + if (mutt_append_message(ctx_trash->mailbox, m, m->emails[i], + MUTT_CM_NO_FLAGS, CH_NO_FLAGS) == -1) { mx_mbox_close(&ctx_trash); return -1; @@ -683,7 +684,7 @@ int mx_mbox_close(struct Context **ptr) !(m->emails[i]->flagged && C_KeepFlagged)) { if (mutt_append_message(ctx_read->mailbox, ctx->mailbox, m->emails[i], - 0, CH_UPDATE_LEN) == 0) + MUTT_CM_NO_FLAGS, CH_UPDATE_LEN) == 0) { mutt_set_flag(m, m->emails[i], MUTT_DELETE, true); mutt_set_flag(m, m->emails[i], MUTT_PURGE, true); diff --git a/ncrypt/crypt.c b/ncrypt/crypt.c index b3cc8a27c..a2fe777f6 100644 --- a/ncrypt/crypt.c +++ b/ncrypt/crypt.c @@ -696,8 +696,8 @@ SecurityFlags crypt_query(struct Body *m) if ((m->type == TYPE_MULTIPART) || (m->type == TYPE_MESSAGE)) { - SecurityFlags u = m->parts ? SEC_ALL_FLAGS : 0; /* Bits set in all parts */ - SecurityFlags w = SEC_NO_FLAGS; /* Bits set in any part */ + SecurityFlags u = m->parts ? SEC_ALL_FLAGS : SEC_NO_FLAGS; /* Bits set in all parts */ + SecurityFlags w = SEC_NO_FLAGS; /* Bits set in any part */ for (struct Body *b = m->parts; b; b = b->next) { @@ -848,7 +848,7 @@ void crypt_extract_keys_from_messages(struct EmailList *el) if (((WithCrypto & APPLICATION_PGP) != 0) && (e->security & APPLICATION_PGP)) { mutt_copy_message_ctx(fp_out, Context->mailbox, e, - MUTT_CM_DECODE | MUTT_CM_CHARCONV, 0); + MUTT_CM_DECODE | MUTT_CM_CHARCONV, CH_NO_FLAGS); fflush(fp_out); mutt_endwin(); @@ -862,10 +862,10 @@ void crypt_extract_keys_from_messages(struct EmailList *el) { mutt_copy_message_ctx(fp_out, Context->mailbox, e, MUTT_CM_NOHEADER | MUTT_CM_DECODE_CRYPT | MUTT_CM_DECODE_SMIME, - 0); + CH_NO_FLAGS); } else - mutt_copy_message_ctx(fp_out, Context->mailbox, e, 0, 0); + mutt_copy_message_ctx(fp_out, Context->mailbox, e, MUTT_CM_NO_FLAGS, CH_NO_FLAGS); fflush(fp_out); if (e->env->from) diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index 7291593d3..03ca9c603 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -2368,7 +2368,7 @@ int smime_gpgme_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct size_t saved_b_length; int saved_b_type; - if (mutt_is_application_smime(b) == 0) + if (mutt_is_application_smime(b) == SEC_NO_FLAGS) return -1; if (b->parts) @@ -2706,7 +2706,7 @@ int pgp_gpgme_check_traditional(FILE *fp, struct Body *b, bool just_one) else if (b->type == TYPE_TEXT) { SecurityFlags r = mutt_is_application_pgp(b); - if (r != 0) + if (r) rc = (rc || r); else rc = (pgp_check_traditional_one_body(fp, b) || rc); @@ -3525,9 +3525,11 @@ static const char *crypt_format_str(char *buf, size_t buflen, size_t col, int co } if (optional) - mutt_expando_format(buf, buflen, col, cols, if_str, attach_format_str, data, 0); + mutt_expando_format(buf, buflen, col, cols, if_str, attach_format_str, data, + MUTT_FORMAT_NO_FLAGS); else if (flags & MUTT_FORMAT_OPTIONAL) - mutt_expando_format(buf, buflen, col, cols, else_str, attach_format_str, data, 0); + mutt_expando_format(buf, buflen, col, cols, else_str, attach_format_str, + data, MUTT_FORMAT_NO_FLAGS); return src; } @@ -4390,7 +4392,7 @@ leave: mutt_file_fclose(&fp); mutt_clear_error(); snprintf(cmd, sizeof(cmd), _("Key ID: 0x%s"), crypt_keyid(key)); - mutt_do_pager(cmd, tempfile, 0, NULL); + mutt_do_pager(cmd, tempfile, MUTT_PAGER_NO_FLAGS, NULL); } /** @@ -5281,8 +5283,8 @@ struct Body *pgp_gpgme_make_key_attachment(void) OptPgpCheckTrust = false; - struct CryptKeyInfo *key = crypt_ask_for_key(_("Please enter the key ID: "), - NULL, 0, APPLICATION_PGP, NULL); + struct CryptKeyInfo *key = crypt_ask_for_key(_("Please enter the key ID: "), NULL, + KEYFLAG_NO_FLAGS, APPLICATION_PGP, NULL); if (!key) goto bail; export_keys[0] = key->kobj; diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index 6c7728d19..922107288 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -1955,7 +1955,7 @@ int pgp_class_send_menu(struct Email *msg) case 'a': /* sign (a)s */ OptPgpCheckTrust = false; - p = pgp_ask_for_key(_("Sign as: "), NULL, 0, PGP_SECRING); + p = pgp_ask_for_key(_("Sign as: "), NULL, KEYFLAG_NO_FLAGS, PGP_SECRING); if (p) { char input_signas[128]; diff --git a/ncrypt/pgpinvoke.c b/ncrypt/pgpinvoke.c index dbeabb440..5319de48c 100644 --- a/ncrypt/pgpinvoke.c +++ b/ncrypt/pgpinvoke.c @@ -164,9 +164,11 @@ static const char *fmt_pgp_command(char *buf, size_t buflen, size_t col, int col } if (optional) - mutt_expando_format(buf, buflen, col, cols, if_str, fmt_pgp_command, data, 0); + mutt_expando_format(buf, buflen, col, cols, if_str, fmt_pgp_command, data, + MUTT_FORMAT_NO_FLAGS); else if (flags & MUTT_FORMAT_OPTIONAL) - mutt_expando_format(buf, buflen, col, cols, else_str, fmt_pgp_command, data, 0); + mutt_expando_format(buf, buflen, col, cols, else_str, fmt_pgp_command, data, + MUTT_FORMAT_NO_FLAGS); return src; } @@ -182,7 +184,7 @@ static void mutt_pgp_command(char *buf, size_t buflen, struct PgpCommandContext *cctx, const char *fmt) { mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(fmt), - fmt_pgp_command, (unsigned long) cctx, 0); + fmt_pgp_command, (unsigned long) cctx, MUTT_FORMAT_NO_FLAGS); mutt_debug(LL_DEBUG2, "%s\n", buf); } diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index f5924676a..45d108ec4 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -316,9 +316,11 @@ static const char *pgp_entry_fmt(char *buf, size_t buflen, size_t col, int cols, } if (optional) - mutt_expando_format(buf, buflen, col, cols, if_str, attach_format_str, data, 0); + mutt_expando_format(buf, buflen, col, cols, if_str, attach_format_str, data, + MUTT_FORMAT_NO_FLAGS); else if (flags & MUTT_FORMAT_OPTIONAL) - mutt_expando_format(buf, buflen, col, cols, else_str, attach_format_str, data, 0); + mutt_expando_format(buf, buflen, col, cols, else_str, attach_format_str, + data, MUTT_FORMAT_NO_FLAGS); return src; } @@ -724,7 +726,7 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys, mutt_clear_error(); snprintf(cmd, sizeof(cmd), _("Key ID: 0x%s"), pgp_keyid(pgp_principal_key(key_table[menu->current]->parent))); - mutt_do_pager(cmd, tempfile, 0, NULL); + mutt_do_pager(cmd, tempfile, MUTT_PAGER_NO_FLAGS, NULL); menu->redraw = REDRAW_FULL; break; @@ -875,8 +877,8 @@ struct Body *pgp_class_make_key_attachment(void) pid_t pid; OptPgpCheckTrust = false; - struct PgpKeyInfo *key = - pgp_ask_for_key(_("Please enter the key ID: "), NULL, 0, PGP_PUBRING); + struct PgpKeyInfo *key = pgp_ask_for_key(_("Please enter the key ID: "), NULL, + KEYFLAG_NO_FLAGS, PGP_PUBRING); if (!key) return NULL; diff --git a/ncrypt/smime.c b/ncrypt/smime.c index d0f619002..555a55036 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -335,9 +335,11 @@ static const char *fmt_smime_command(char *buf, size_t buflen, size_t col, int c } if (optional) - mutt_expando_format(buf, buflen, col, cols, if_str, fmt_smime_command, data, 0); + mutt_expando_format(buf, buflen, col, cols, if_str, fmt_smime_command, data, + MUTT_FORMAT_NO_FLAGS); else if (flags & MUTT_FORMAT_OPTIONAL) - mutt_expando_format(buf, buflen, col, cols, else_str, fmt_smime_command, data, 0); + mutt_expando_format(buf, buflen, col, cols, else_str, fmt_smime_command, + data, MUTT_FORMAT_NO_FLAGS); return src; } @@ -353,7 +355,7 @@ static void smime_command(char *buf, size_t buflen, struct SmimeCommandContext *cctx, const char *fmt) { mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(fmt), - fmt_smime_command, (unsigned long) cctx, 0); + fmt_smime_command, (unsigned long) cctx, MUTT_FORMAT_NO_FLAGS); mutt_debug(LL_DEBUG2, "%s\n", buf); } @@ -1428,7 +1430,7 @@ int smime_class_verify_sender(struct Email *e) CH_MIME | CH_WEED | CH_NONEWLINE); } else - mutt_copy_message_ctx(fp_out, Context->mailbox, e, 0, 0); + mutt_copy_message_ctx(fp_out, Context->mailbox, e, MUTT_CM_NO_FLAGS, CH_NO_FLAGS); fflush(fp_out); mutt_file_fclose(&fp_out); diff --git a/nntp/newsrc.c b/nntp/newsrc.c index 1af00c22a..2ca41ebc8 100644 --- a/nntp/newsrc.c +++ b/nntp/newsrc.c @@ -1077,8 +1077,8 @@ struct NntpAccountData *nntp_select_server(struct Mailbox *m, char *server, bool /* load .newsrc */ if (rc >= 0) { - mutt_expando_format(file, sizeof(file), 0, MuttIndexWindow->cols, - NONULL(C_Newsrc), nntp_format_str, (unsigned long) adata, 0); + mutt_expando_format(file, sizeof(file), 0, MuttIndexWindow->cols, NONULL(C_Newsrc), + nntp_format_str, (unsigned long) adata, MUTT_FORMAT_NO_FLAGS); mutt_expand_path(file, sizeof(file)); adata->newsrc_file = mutt_str_strdup(file); rc = nntp_newsrc_parse(adata); diff --git a/nntp/nntp.c b/nntp/nntp.c index 3d8ee66f7..5c6a72b18 100644 --- a/nntp/nntp.c +++ b/nntp/nntp.c @@ -144,7 +144,7 @@ struct NntpAccountData *nntp_adata_new(struct Connection *conn) { struct NntpAccountData *adata = mutt_mem_calloc(1, sizeof(struct NntpAccountData)); adata->conn = conn; - adata->groups_hash = mutt_hash_new(1009, 0); + adata->groups_hash = mutt_hash_new(1009, MUTT_HASH_NO_FLAGS); mutt_hash_set_destructor(adata->groups_hash, nntp_hashelem_free, 0); adata->groups_max = 16; adata->groups_list = diff --git a/notmuch/mutt_notmuch.c b/notmuch/mutt_notmuch.c index d85fb4ec5..b76bd5cc6 100644 --- a/notmuch/mutt_notmuch.c +++ b/notmuch/mutt_notmuch.c @@ -2297,7 +2297,7 @@ static int nm_mbox_check(struct Mailbox *m, int *index_hint) if (!e) { /* new email */ - append_message(h, m, NULL, msg, 0); + append_message(h, m, NULL, msg, false); notmuch_message_destroy(msg); continue; } diff --git a/pager.c b/pager.c index cc2ac3a1e..bf37e606c 100644 --- a/pager.c +++ b/pager.c @@ -1727,7 +1727,8 @@ static int display_line(FILE *fp, LOFF_T *last_pos, struct Line **line_info, } /* now chose a good place to break the line */ - cnt = format_line(line_info, n, buf, flags, 0, b_read, &ch, &vch, &col, &special, pager_window); + cnt = format_line(line_info, n, buf, flags, NULL, b_read, &ch, &vch, &col, + &special, pager_window); buf_ptr = buf + cnt; /* move the break point only if smart_wrap is set */ @@ -2176,7 +2177,7 @@ static void pager_custom_redraw(struct Menu *pager_menu) size_t l2 = sizeof(buf); hfi.email = (IsEmail(rd->extra)) ? rd->extra->email : rd->extra->body->email; mutt_make_string_info(buf, (l1 < l2) ? l1 : l2, rd->pager_status_window->cols, - NONULL(C_PagerFormat), &hfi, 0); + NONULL(C_PagerFormat), &hfi, MUTT_FORMAT_NO_FLAGS); mutt_draw_statusline(rd->pager_status_window->cols, buf, l2); } else @@ -3156,7 +3157,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P case OP_MAIL: CHECK_MODE(IsEmail(extra) && !IsAttach(extra)); CHECK_ATTACH; - ci_send_message(0, NULL, NULL, extra->ctx, NULL); + ci_send_message(SEND_NO_FLAGS, NULL, NULL, extra->ctx, NULL); pager_menu->redraw = REDRAW_FULL; break; @@ -3236,10 +3237,13 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P CHECK_MODE(IsEmail(extra) || IsMsgAttach(extra)); CHECK_ATTACH; - SendFlags replyflags = - SEND_REPLY | ((ch == OP_GROUP_REPLY) ? SEND_GROUP_REPLY : 0) | - ((ch == OP_GROUP_CHAT_REPLY) ? SEND_GROUP_CHAT_REPLY : 0) | - ((ch == OP_LIST_REPLY) ? SEND_LIST_REPLY : 0); + SendFlags replyflags = SEND_REPLY; + if (ch == OP_GROUP_REPLY) + replyflags |= SEND_GROUP_REPLY; + else if (ch == OP_GROUP_CHAT_REPLY) + replyflags |= SEND_GROUP_CHAT_REPLY; + else if (ch == OP_LIST_REPLY) + replyflags |= SEND_LIST_REPLY; if (IsMsgAttach(extra)) mutt_attach_reply(extra->fp, extra->email, extra->actx, extra->body, replyflags); @@ -3270,7 +3274,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P CHECK_MODE(IsEmail(extra) || IsMsgAttach(extra)); CHECK_ATTACH; if (IsMsgAttach(extra)) - mutt_attach_forward(extra->fp, extra->email, extra->actx, extra->body, 0); + mutt_attach_forward(extra->fp, extra->email, extra->actx, extra->body, SEND_NO_FLAGS); else { struct EmailList el = STAILQ_HEAD_INITIALIZER(el); diff --git a/pattern.c b/pattern.c index 034598b0c..f123d1c0e 100644 --- a/pattern.c +++ b/pattern.c @@ -449,8 +449,8 @@ static const char *get_date(const char *s, struct tm *t, struct Buffer *err) static const char *parse_date_range(const char *pc, struct tm *min, struct tm *max, bool have_min, struct tm *base_min, struct Buffer *err) { - PatternFlags flag = MUTT_PDR_NO_FLAGS; - while (*pc && ((flag & MUTT_PDR_DONE) == 0)) + PatternFlags flags = MUTT_PDR_NO_FLAGS; + while (*pc && ((flags & MUTT_PDR_DONE) == 0)) { const char *pt = NULL; char ch = *pc++; @@ -463,31 +463,31 @@ static const char *parse_date_range(const char *pc, struct tm *min, struct tm *m pt = get_offset(min, pc, -1); if (pc == pt) { - if (flag == MUTT_PDR_NO_FLAGS) + if (flags == MUTT_PDR_NO_FLAGS) { /* nothing yet and no offset parsed => absolute date? */ if (!get_date(pc, max, err)) - flag |= (MUTT_PDR_ABSOLUTE | MUTT_PDR_ERRORDONE); /* done bad */ + flags |= (MUTT_PDR_ABSOLUTE | MUTT_PDR_ERRORDONE); /* done bad */ else { /* reestablish initial base minimum if not specified */ if (!have_min) memcpy(min, base_min, sizeof(struct tm)); - flag |= (MUTT_PDR_ABSOLUTE | MUTT_PDR_DONE); /* done good */ + flags |= (MUTT_PDR_ABSOLUTE | MUTT_PDR_DONE); /* done good */ } } else - flag |= MUTT_PDR_ERRORDONE; + flags |= MUTT_PDR_ERRORDONE; } else { pc = pt; - if ((flag == MUTT_PDR_NO_FLAGS) && !have_min) + if ((flags == MUTT_PDR_NO_FLAGS) && !have_min) { /* the very first "-3d" without a previous absolute date */ max->tm_year = min->tm_year; max->tm_mon = min->tm_mon; max->tm_mday = min->tm_mday; } - flag |= MUTT_PDR_MINUS; + flags |= MUTT_PDR_MINUS; } break; } @@ -495,11 +495,11 @@ static const char *parse_date_range(const char *pc, struct tm *min, struct tm *m { /* enlarge plus range */ pt = get_offset(max, pc, 1); if (pc == pt) - flag |= MUTT_PDR_ERRORDONE; + flags |= MUTT_PDR_ERRORDONE; else { pc = pt; - flag |= MUTT_PDR_PLUS; + flags |= MUTT_PDR_PLUS; } break; } @@ -507,24 +507,24 @@ static const char *parse_date_range(const char *pc, struct tm *min, struct tm *m { /* enlarge window in both directions */ pt = get_offset(min, pc, -1); if (pc == pt) - flag |= MUTT_PDR_ERRORDONE; + flags |= MUTT_PDR_ERRORDONE; else { pc = get_offset(max, pc, 1); - flag |= MUTT_PDR_WINDOW; + flags |= MUTT_PDR_WINDOW; } break; } default: - flag |= MUTT_PDR_ERRORDONE; + flags |= MUTT_PDR_ERRORDONE; } SKIPWS(pc); } - if ((flag & MUTT_PDR_ERROR) && !(flag & MUTT_PDR_ABSOLUTE)) + if ((flags & MUTT_PDR_ERROR) && !(flags & MUTT_PDR_ABSOLUTE)) { /* get_date has its own error message, don't overwrite it here */ mutt_buffer_printf(err, _("Invalid relative date: %s"), pc - 1); } - return (flag & MUTT_PDR_ERROR) ? NULL : pc; + return (flags & MUTT_PDR_ERROR) ? NULL : pc; } /** diff --git a/query.c b/query.c index b05f13143..47ecfb15b 100644 --- a/query.c +++ b/query.c @@ -285,9 +285,11 @@ static const char *query_format_str(char *buf, size_t buflen, size_t col, int co } if (optional) - mutt_expando_format(buf, buflen, col, cols, if_str, query_format_str, data, 0); + mutt_expando_format(buf, buflen, col, cols, if_str, query_format_str, data, + MUTT_FORMAT_NO_FLAGS); else if (flags & MUTT_FORMAT_OPTIONAL) - mutt_expando_format(buf, buflen, col, cols, else_str, query_format_str, data, 0); + mutt_expando_format(buf, buflen, col, cols, else_str, query_format_str, + data, MUTT_FORMAT_NO_FLAGS); return src; } @@ -497,7 +499,7 @@ static void query_menu(char *buf, size_t buflen, struct Query *results, bool ret } } } - ci_send_message(0, msg, NULL, Context, NULL); + ci_send_message(SEND_NO_FLAGS, msg, NULL, Context, NULL); menu->redraw = REDRAW_FULL; break; } diff --git a/recvattach.c b/recvattach.c index a812eafda..038f5e7b8 100644 --- a/recvattach.c +++ b/recvattach.c @@ -420,9 +420,11 @@ const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols, } if (optional) - mutt_expando_format(buf, buflen, col, cols, if_str, attach_format_str, data, 0); + mutt_expando_format(buf, buflen, col, cols, if_str, attach_format_str, data, + MUTT_FORMAT_NO_FLAGS); else if (flags & MUTT_FORMAT_OPTIONAL) - mutt_expando_format(buf, buflen, col, cols, else_str, attach_format_str, data, 0); + mutt_expando_format(buf, buflen, col, cols, else_str, attach_format_str, + data, MUTT_FORMAT_NO_FLAGS); return src; } @@ -1542,7 +1544,7 @@ void mutt_view_attachments(struct Email *e) case OP_FORWARD_MESSAGE: CHECK_ATTACH; mutt_attach_forward(CURATTACH->fp, e, actx, - menu->tagprefix ? NULL : CURATTACH->content, 0); + menu->tagprefix ? NULL : CURATTACH->content, SEND_NO_FLAGS); menu->redraw = REDRAW_FULL; break; @@ -1577,9 +1579,14 @@ void mutt_view_attachments(struct Email *e) { CHECK_ATTACH; - SendFlags flags = SEND_REPLY | ((op == OP_GROUP_REPLY) ? SEND_GROUP_REPLY : 0) | - ((op == OP_GROUP_CHAT_REPLY) ? SEND_GROUP_CHAT_REPLY : 0) | - ((op == OP_LIST_REPLY) ? SEND_LIST_REPLY : 0); + SendFlags flags = SEND_REPLY; + if (op == OP_GROUP_REPLY) + flags |= SEND_GROUP_REPLY; + else if (op == OP_GROUP_CHAT_REPLY) + flags |= SEND_GROUP_CHAT_REPLY; + else if (op == OP_LIST_REPLY) + flags |= SEND_LIST_REPLY; + mutt_attach_reply(CURATTACH->fp, e, actx, menu->tagprefix ? NULL : CURATTACH->content, flags); menu->redraw = REDRAW_FULL; diff --git a/recvcmd.c b/recvcmd.c index 49f23bb1e..362b25de7 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -595,7 +595,7 @@ static void attach_forward_bodies(FILE *fp, struct Email *e, struct AttachCtx *a /* now that we have the template, send it. */ struct EmailList el = STAILQ_HEAD_INITIALIZER(el); el_add_email(&el, e_parent); - ci_send_message(0, e_tmp, tmpbody, NULL, &el); + ci_send_message(SEND_NO_FLAGS, e_tmp, tmpbody, NULL, &el); el_free(&el); return; @@ -1081,5 +1081,5 @@ void mutt_attach_mail_sender(FILE *fp, struct Email *e, struct AttachCtx *actx, return; } } - ci_send_message(0, e_tmp, NULL, NULL, NULL); + ci_send_message(SEND_NO_FLAGS, e_tmp, NULL, NULL, NULL); } diff --git a/remailer.c b/remailer.c index e803d9bbc..6af81c105 100644 --- a/remailer.c +++ b/remailer.c @@ -478,9 +478,11 @@ static const char *mix_format_str(char *buf, size_t buflen, size_t col, int cols } if (optional) - mutt_expando_format(buf, buflen, col, cols, if_str, attach_format_str, data, 0); + mutt_expando_format(buf, buflen, col, cols, if_str, attach_format_str, data, + MUTT_FORMAT_NO_FLAGS); else if (flags & MUTT_FORMAT_OPTIONAL) - mutt_expando_format(buf, buflen, col, cols, else_str, attach_format_str, data, 0); + mutt_expando_format(buf, buflen, col, cols, else_str, attach_format_str, + data, MUTT_FORMAT_NO_FLAGS); return src; } diff --git a/sendlib.c b/sendlib.c index a7ba320fa..3a9faa460 100644 --- a/sendlib.c +++ b/sendlib.c @@ -2293,9 +2293,9 @@ int mutt_rfc822_write_header(FILE *fp, struct Envelope *env, { if (hide_protected_subject && ((mode == MUTT_WRITE_HEADER_NORMAL) || (mode == MUTT_WRITE_HEADER_POSTPONE))) - mutt_write_one_header(fp, "Subject", C_CryptProtectedHeadersSubject, NULL, 0, 0); + mutt_write_one_header(fp, "Subject", C_CryptProtectedHeadersSubject, NULL, 0, CH_NO_FLAGS); else - mutt_write_one_header(fp, "Subject", env->subject, NULL, 0, 0); + mutt_write_one_header(fp, "Subject", env->subject, NULL, 0, CH_NO_FLAGS); } else if (mode == MUTT_WRITE_HEADER_EDITHDRS) fputs("Subject:\n", fp); @@ -2371,7 +2371,7 @@ int mutt_rfc822_write_header(FILE *fp, struct Envelope *env, } } - mutt_write_one_header(fp, tmp->data, p, NULL, 0, 0); + mutt_write_one_header(fp, tmp->data, p, NULL, 0, CH_NO_FLAGS); *q = ':'; } } @@ -2717,7 +2717,7 @@ int mutt_invoke_sendmail(struct Address *from, struct Address *to, struct Addres char cmd[1024]; mutt_expando_format(cmd, sizeof(cmd), 0, MuttIndexWindow->cols, - NONULL(C_Inews), nntp_format_str, 0, 0); + NONULL(C_Inews), nntp_format_str, 0, MUTT_FORMAT_NO_FLAGS); if (!*cmd) { i = nntp_post(Context->mailbox, msg); @@ -2847,7 +2847,8 @@ int mutt_invoke_sendmail(struct Address *from, struct Address *to, struct Addres struct stat st; if ((stat(childout, &st) == 0) && (st.st_size > 0)) - mutt_do_pager(_("Output of the delivery process"), childout, 0, NULL); + mutt_do_pager(_("Output of the delivery process"), childout, + MUTT_PAGER_NO_FLAGS, NULL); } } } diff --git a/sidebar.c b/sidebar.c index 54207699e..824943b8f 100644 --- a/sidebar.c +++ b/sidebar.c @@ -267,7 +267,7 @@ static void make_sidebar_entry(char *buf, size_t buflen, int width, char *box, mutt_str_strfcpy(sbe->box, box, sizeof(sbe->box)); mutt_expando_format(buf, buflen, 0, width, NONULL(C_SidebarFormat), - sidebar_format_str, (unsigned long) sbe, 0); + sidebar_format_str, (unsigned long) sbe, MUTT_FORMAT_NO_FLAGS); /* Force string to be exactly the right width */ int w = mutt_strwidth(buf); diff --git a/status.c b/status.c index 0f76f6b0b..5be7d4440 100644 --- a/status.c +++ b/status.c @@ -372,12 +372,12 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c if (optional) { mutt_expando_format(buf, buflen, col, cols, if_str, status_format_str, - (unsigned long) menu, 0); + (unsigned long) menu, MUTT_FORMAT_NO_FLAGS); } else if (flags & MUTT_FORMAT_OPTIONAL) { mutt_expando_format(buf, buflen, col, cols, else_str, status_format_str, - (unsigned long) menu, 0); + (unsigned long) menu, MUTT_FORMAT_NO_FLAGS); } return src; @@ -394,5 +394,5 @@ void menu_status_line(char *buf, size_t buflen, struct Menu *menu, const char *p { mutt_expando_format(buf, buflen, 0, menu ? menu->statuswin->cols : MuttStatusWindow->cols, p, - status_format_str, (unsigned long) menu, 0); + status_format_str, (unsigned long) menu, MUTT_FORMAT_NO_FLAGS); } -- 2.40.0