break;
}
- if (!ctx->mailbox->msg_count)
+ if (ctx->mailbox->msg_count == 0)
{
mx_mbox_close(&ctx);
mutt_error(_("No messages in that folder"));
struct Email **emails = m->emails;
- for (n = *pos; n < m->msg_count && buf->dptr - buf->data < IMAP_MAX_CMDLEN; n++)
+ for (n = *pos; (n < m->msg_count) && ((buf->dptr - buf->data) < IMAP_MAX_CMDLEN); n++)
{
bool match = false; /* whether current message matches flag condition */
/* don't include pending expunged messages */
mutt_buffer_add_printf(buf, ",%u", imap_edata_get(emails[n])->uid);
}
/* tie up if the last message also matches */
- else if (n == m->msg_count - 1)
+ else if (n == (m->msg_count - 1))
mutt_buffer_add_printf(buf, ":%u", imap_edata_get(emails[n])->uid);
}
/* End current set if message doesn't match or we've reached the end
{
/* mx_mbox_close won't sync if there are no deleted messages
* and the mailbox is unchanged, so we may have to close here */
- if (!m->msg_deleted)
+ if (m->msg_deleted == 0)
{
adata->closing = true;
imap_exec(adata, "CLOSE", IMAP_CMD_QUEUE);
mutt_error(_(No_mailbox_is_open)); \
break; \
} \
- else if (!Context->mailbox->msg_count) \
+ else if (Context->mailbox->msg_count == 0) \
{ \
mutt_flushinp(); \
mutt_error(_(There_are_no_messages)); \
*/
static int ci_first_message(void)
{
- if (!Context || !Context->mailbox->msg_count)
+ if (!Context || (Context->mailbox->msg_count == 0))
return 0;
int old = -1;
* switch statement would need to be run. */
mutt_folder_hook(buf, m ? m->desc : NULL);
- const int flags =
- (ReadOnly || (op == OP_MAIN_CHANGE_FOLDER_READONLY)
+ const int flags = (ReadOnly || (op == OP_MAIN_CHANGE_FOLDER_READONLY)
#ifdef USE_NOTMUCH
- || (op == OP_MAIN_VFOLDER_FROM_QUERY_READONLY)
+ || (op == OP_MAIN_VFOLDER_FROM_QUERY_READONLY)
#endif
- )
- ? MUTT_READONLY
- : 0;
+ ) ?
+ MUTT_READONLY :
+ 0;
bool free_m = false;
if (!m)
continue;
}
- if (!Context->mailbox->msg_tagged)
+ if (Context->mailbox->msg_tagged == 0)
{
if (op == OP_TAG_PREFIX)
mutt_error(_("No tagged messages"));
tag = true;
continue;
}
- else if (AutoTag && Context && Context->mailbox && Context->mailbox->msg_tagged)
+ else if (AutoTag && Context && Context->mailbox && (Context->mailbox->msg_tagged != 0))
tag = true;
mutt_clear_error();
}
else
menu->current = 0;
- if (Context->mailbox->msg_count && (Sort & SORT_MASK) == SORT_THREADS)
+ if ((Context->mailbox->msg_count != 0) && (Sort & SORT_MASK) == SORT_THREADS)
mutt_draw_tree(Context);
menu->redraw = REDRAW_FULL;
}
if (mutt_select_sort((op == OP_SORT_REVERSE)) == 0)
{
- if (Context && Context->mailbox->msg_count)
+ if (Context && (Context->mailbox->msg_count != 0))
{
resort_index(menu);
OptSearchInvalid = true;
case OP_MAIN_SYNC_FOLDER:
- if (Context && !Context->mailbox->msg_count)
+ if (Context && (Context->mailbox->msg_count == 0))
break;
CHECK_MSGCOUNT;
struct stat st, stc;
int opt_confappend, rc;
- if (!Trash || !m->msg_deleted || (m->magic == MUTT_MAILDIR && MaildirTrash))
+ if (!Trash || (m->msg_deleted == 0) || (m->magic == MUTT_MAILDIR && MaildirTrash))
{
return 0;
}
}
#ifdef USE_NNTP
- if (m->msg_unread && m->magic == MUTT_NNTP)
+ if ((m->msg_unread != 0) && (m->magic == MUTT_NNTP))
{
struct NntpMboxData *mdata = m->mdata;
/* There is no point in asking whether or not to purge if we are
* just marking messages as "trash".
*/
- if (m->msg_deleted && !(m->magic == MUTT_MAILDIR && MaildirTrash))
+ if ((m->msg_deleted != 0) && !(m->magic == MUTT_MAILDIR && MaildirTrash))
{
snprintf(buf, sizeof(buf),
ngettext("Purge %d deleted message?", "Purge %d deleted messages?", m->msg_deleted),
mx_mbox_close(&ctx_read);
}
}
- else if (!m->changed && m->msg_deleted == 0)
+ else if (!m->changed && (m->msg_deleted == 0))
{
if (!m->quiet)
mutt_message(_("Mailbox is unchanged"));
}
/* copy mails to the trash before expunging */
- if (purge && m->msg_deleted && (mutt_str_strcmp(m->path, Trash) != 0))
+ if (purge && (m->msg_deleted != 0) && (mutt_str_strcmp(m->path, Trash) != 0))
{
if (trash_append(ctx->mailbox) != 0)
return -1;
mutt_message(_("%d kept, %d deleted"), m->msg_count - m->msg_deleted, m->msg_deleted);
}
- if (m->msg_count == m->msg_deleted && (m->magic == MUTT_MMDF || m->magic == MUTT_MBOX) &&
+ if ((m->msg_count == m->msg_deleted) &&
+ ((m->magic == MUTT_MMDF) || (m->magic == MUTT_MBOX)) &&
!mutt_is_spool(m->path) && !SaveEmpty)
{
mutt_file_unlink_empty(m->path);
return -1;
}
- if (!m->changed && !m->msg_deleted)
+ if (!m->changed && (m->msg_deleted == 0))
{
if (!m->quiet)
mutt_message(_("Mailbox is unchanged"));
msgcount = m->msg_count;
deleted = m->msg_deleted;
- if (purge && m->msg_deleted && (mutt_str_strcmp(m->path, Trash) != 0))
+ if (purge && (m->msg_deleted != 0) && (mutt_str_strcmp(m->path, Trash) != 0))
{
if (trash_append(m) != 0)
return -1;
mutt_sleep(0);
- if (m->msg_count == m->msg_deleted && (m->magic == MUTT_MBOX || m->magic == MUTT_MMDF) &&
+ if ((m->msg_count == m->msg_deleted) &&
+ ((m->magic == MUTT_MBOX) || (m->magic == MUTT_MMDF)) &&
!mutt_is_spool(m->path) && !SaveEmpty)
{
unlink(m->path);
return -1;
}
- if (!ctx_post->mailbox->msg_count)
+ if (ctx_post->mailbox->msg_count == 0)
{
PostCount = 0;
if (ctx_post == ctx)
{
if (cur && ctx)
mutt_set_flag(ctx->mailbox, cur, MUTT_REPLIED, is_reply(cur, msg));
- else if (!(flags & SEND_POSTPONED) && ctx && ctx->mailbox && ctx->mailbox->msg_tagged)
+ else if (!(flags & SEND_POSTPONED) && ctx && ctx->mailbox &&
+ (ctx->mailbox->msg_tagged != 0))
{
STAILQ_FOREACH(en, el, entries)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, c ? Context->mailbox->msg_deleted : 0);
}
- else if ((c && Context->mailbox->msg_deleted == 0) || !c)
+ else if ((c && (Context->mailbox->msg_deleted == 0)) || !c)
optional = 0;
break;
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, c ? Context->mailbox->msg_tagged : 0);
}
- else if ((c && Context->mailbox->msg_tagged == 0) || !c)
+ else if ((c && (Context->mailbox->msg_tagged == 0)) || !c)
optional = 0;
break;
}
if (entry == HilIndex)
return false;
- } while (!Entries[entry]->mailbox->has_new && !Entries[entry]->mailbox->msg_unread);
+ } while (!Entries[entry]->mailbox->has_new && (Entries[entry]->mailbox->msg_unread == 0));
HilIndex = entry;
return true;
}
if (entry == HilIndex)
return false;
- } while (!Entries[entry]->mailbox->has_new && !Entries[entry]->mailbox->msg_unread);
+ } while (!Entries[entry]->mailbox->has_new && (Entries[entry]->mailbox->msg_unread == 0));
HilIndex = entry;
return true;
if (!ctx)
return;
- if (!ctx->mailbox->msg_count)
+ if (ctx->mailbox->msg_count == 0)
{
/* this function gets called by mutt_sync_mailbox(), which may have just
* deleted all the messages. the virtual message numbers are not updated
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, Context ? Context->mailbox->msg_deleted : 0);
}
- else if (!Context || !Context->mailbox->msg_deleted)
+ else if (!Context || (Context->mailbox->msg_deleted == 0))
optional = 0;
break;
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, Context ? Context->mailbox->msg_flagged : 0);
}
- else if (!Context || !Context->mailbox->msg_flagged)
+ else if (!Context || (Context->mailbox->msg_flagged == 0))
optional = 0;
break;
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, Context ? Context->mailbox->msg_count : 0);
}
- else if (!Context || !Context->mailbox->msg_count)
+ else if (!Context || (Context->mailbox->msg_count == 0))
optional = 0;
break;
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, Context ? Context->mailbox->msg_new : 0);
}
- else if (!Context || !Context->mailbox->msg_new)
+ else if (!Context || (Context->mailbox->msg_new == 0))
optional = 0;
break;
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt,
- Context ? Context->mailbox->msg_unread - Context->mailbox->msg_new : 0);
+ Context ? (Context->mailbox->msg_unread - Context->mailbox->msg_new) : 0);
}
- else if (!Context || !(Context->mailbox->msg_unread - Context->mailbox->msg_new))
+ else if (!Context || ((Context->mailbox->msg_unread - Context->mailbox->msg_new) == 0))
optional = 0;
break;
case 'R':
{
- int read = Context ? Context->mailbox->msg_count - Context->mailbox->msg_unread : 0;
+ int read = Context ? (Context->mailbox->msg_count - Context->mailbox->msg_unread) : 0;
if (!optional)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, Context ? Context->mailbox->msg_tagged : 0);
}
- else if (!Context || !Context->mailbox || !Context->mailbox->msg_tagged)
+ else if (!Context || !Context->mailbox || (Context->mailbox->msg_tagged == 0))
optional = 0;
break;
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, Context ? Context->mailbox->msg_unread : 0);
}
- else if (!Context || !Context->mailbox->msg_unread)
+ else if (!Context || (Context->mailbox->msg_unread == 0))
optional = 0;
break;