From 404e4697e8fccc9507dceb7b8b7225e0896ae942 Mon Sep 17 00:00:00 2001 From: Federico Kircheis Date: Sat, 29 Jun 2019 21:14:11 +0200 Subject: [PATCH] Replace `delete` variable with `delete_original` `delete` is a reserved keyword in c++ --- commands.c | 38 ++++++++++++++++++++------------------ commands.h | 4 ++-- imap/imap.h | 2 +- imap/message.c | 6 +++--- 4 files changed, 26 insertions(+), 24 deletions(-) diff --git a/commands.c b/commands.c index 737b37f55..0cb1c0929 100644 --- a/commands.c +++ b/commands.c @@ -932,15 +932,15 @@ static void set_copy_flags(struct Email *e, bool decode, bool decrypt, /** * mutt_save_message_ctx - Save a message to a given mailbox - * @param e Email - * @param delete If true, delete the original - * @param decode If true, decode the message - * @param decrypt If true, decrypt the message - * @param m Mailbox to save to + * @param e Email + * @param delete_original If true, delete the original + * @param decode If true, decode the message + * @param decrypt If true, decrypt the message + * @param m Mailbox to save to * @retval 0 Success * @retval -1 Error */ -int mutt_save_message_ctx(struct Email *e, bool delete, bool decode, +int mutt_save_message_ctx(struct Email *e, bool delete_original, bool decode, bool decrypt, struct Mailbox *m) { CopyMessageFlags cmflags = MUTT_CM_NO_FLAGS; @@ -956,7 +956,7 @@ int mutt_save_message_ctx(struct Email *e, bool delete, bool decode, if (rc != 0) return rc; - if (delete) + if (delete_original) { mutt_set_flag(Context->mailbox, e, MUTT_DELETE, true); mutt_set_flag(Context->mailbox, e, MUTT_PURGE, true); @@ -969,16 +969,16 @@ int mutt_save_message_ctx(struct Email *e, bool delete, bool decode, /** * mutt_save_message - Save an email - * @param m Mailbox - * @param el List of Emails to save - * @param delete If true, delete the original (save) - * @param decode If true, decode the message - * @param decrypt If true, decrypt the message + * @param m Mailbox + * @param el List of Emails to save + * @param delete_original If true, delete the original (save) + * @param decode If true, decode the message + * @param decrypt If true, decrypt the message * @retval 0 Copy/save was successful * @retval -1 Error/abort */ -int mutt_save_message(struct Mailbox *m, struct EmailList *el, bool delete, - bool decode, bool decrypt) +int mutt_save_message(struct Mailbox *m, struct EmailList *el, + bool delete_original, bool decode, bool decrypt) { if (!el || STAILQ_EMPTY(el)) return -1; @@ -991,7 +991,7 @@ int mutt_save_message(struct Mailbox *m, struct EmailList *el, bool delete, struct EmailNode *en = STAILQ_FIRST(el); bool single = !STAILQ_NEXT(en, entries); - if (delete) + if (delete_original) { if (decode) prompt = single ? _("Decode-save to mailbox") : _("Decode-save tagged to mailbox"); @@ -1055,7 +1055,7 @@ int mutt_save_message(struct Mailbox *m, struct EmailList *el, bool delete, if ((m->magic == MUTT_IMAP) && !(decode || decrypt) && (imap_path_probe(buf, NULL) == MUTT_IMAP)) { - switch (imap_copy_messages(m, el, buf, delete)) + switch (imap_copy_messages(m, el, buf, delete_original)) { /* success */ case 0: @@ -1095,7 +1095,8 @@ int mutt_save_message(struct Mailbox *m, struct EmailList *el, bool delete, #endif if (single) { - if (mutt_save_message_ctx(en->email, delete, decode, decrypt, ctx_save->mailbox) != 0) + if (mutt_save_message_ctx(en->email, delete_original, decode, decrypt, + ctx_save->mailbox) != 0) { m_save->append = old_append; mx_mbox_close(&ctx_save); @@ -1127,7 +1128,8 @@ int mutt_save_message(struct Mailbox *m, struct EmailList *el, bool delete, STAILQ_FOREACH(en, el, entries) { mutt_message_hook(m, en->email, MUTT_MESSAGE_HOOK); - rc = mutt_save_message_ctx(en->email, delete, decode, decrypt, ctx_save->mailbox); + rc = mutt_save_message_ctx(en->email, delete_original, decode, decrypt, + ctx_save->mailbox); if (rc != 0) break; #ifdef USE_COMPRESSED diff --git a/commands.h b/commands.h index 8d80d1a32..97afe6e0d 100644 --- a/commands.h +++ b/commands.h @@ -52,8 +52,8 @@ bool mutt_edit_content_type(struct Email *e, struct Body *b, FILE *fp); void mutt_enter_command(void); void mutt_pipe_message(struct Mailbox *m, struct EmailList *el); void mutt_print_message(struct Mailbox *m, struct EmailList *el); -int mutt_save_message_ctx(struct Email *e, bool delete, bool decode, bool decrypt, struct Mailbox *m); -int mutt_save_message(struct Mailbox *m, struct EmailList *el, bool delete, bool decode, bool decrypt); +int mutt_save_message_ctx(struct Email *e, bool delete_original, bool decode, bool decrypt, struct Mailbox *m); +int mutt_save_message(struct Mailbox *m, struct EmailList *el, bool delete_original, bool decode, bool decrypt); int mutt_select_sort(bool reverse); void mutt_shell_escape(void); diff --git a/imap/imap.h b/imap/imap.h index 9b8eb93b5..e5bcae418 100644 --- a/imap/imap.h +++ b/imap/imap.h @@ -101,7 +101,7 @@ int imap_mailbox_create(const char *folder); int imap_mailbox_rename(const char *path); /* message.c */ -int imap_copy_messages(struct Mailbox *m, struct EmailList *el, char *dest, bool delete); +int imap_copy_messages(struct Mailbox *m, struct EmailList *el, char *dest, bool delete_original); /* socket.c */ void imap_logout_all(void); diff --git a/imap/message.c b/imap/message.c index 3c33fe313..d840bf4a4 100644 --- a/imap/message.c +++ b/imap/message.c @@ -1555,12 +1555,12 @@ fail: * @param m Mailbox * @param el List of Emails to copy * @param dest Destination folder - * @param delete Delete the original? + * @param delete_original Delete the original? * @retval -1 Error * @retval 0 Success * @retval 1 Non-fatal error - try fetch/append */ -int imap_copy_messages(struct Mailbox *m, struct EmailList *el, char *dest, bool delete) +int imap_copy_messages(struct Mailbox *m, struct EmailList *el, char *dest, bool delete_original) { if (!m || !el || !dest) return -1; @@ -1706,7 +1706,7 @@ int imap_copy_messages(struct Mailbox *m, struct EmailList *el, char *dest, bool } /* cleanup */ - if (delete) + if (delete_original) { STAILQ_FOREACH(en, el, entries) { -- 2.40.0