From 444eee4d441e090a16d853127999584aa20a3c8b Mon Sep 17 00:00:00 2001 From: Anton Rieger Date: Fri, 13 Oct 2017 13:41:16 +0200 Subject: [PATCH] Bool: change functions in mx.h * maildir_parse_message() * maildir_parse_stream() * mx_tags_is_supported() * mx_update_tables() Caller affected * append_message() * append_message() * maildir_update_tables() * mx_sync_mailbox() * mx_update_tables() --- imap/imap.c | 2 +- mh.c | 6 +++--- mutt_notmuch.c | 4 ++-- mx.c | 6 +++--- mx.h | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/imap/imap.c b/imap/imap.c index b2bad0920..b63a3cf8d 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -343,7 +343,7 @@ void imap_expunge_mailbox(struct ImapData *idata) /* We may be called on to expunge at any time. We can't rely on the caller * to always know to rethread */ - mx_update_tables(idata->ctx, 0); + mx_update_tables(idata->ctx, false); Sort = old_sort; mutt_sort_headers(idata->ctx, 1); } diff --git a/mh.c b/mh.c index ee1e7f8ef..0e2fb34a4 100644 --- a/mh.c +++ b/mh.c @@ -779,7 +779,7 @@ static void maildir_update_mtime(struct Context *ctx) * out a fake header structure generated by lazy maildir parsing. */ struct Header *maildir_parse_stream(int magic, FILE *f, const char *fname, - int is_old, struct Header *_h) + bool is_old, struct Header *_h) { struct Header *h = _h; struct stat st; @@ -817,7 +817,7 @@ struct Header *maildir_parse_stream(int magic, FILE *f, const char *fname, * This may also be used to fill out a fake header structure generated by lazy * maildir parsing. */ -struct Header *maildir_parse_message(int magic, const char *fname, int is_old, +struct Header *maildir_parse_message(int magic, const char *fname, bool is_old, struct Header *h) { FILE *f = NULL; @@ -2019,7 +2019,7 @@ static void maildir_update_tables(struct Context *ctx, int *index_hint) ctx->hdrs[i]->index = j++; } - mx_update_tables(ctx, 0); + mx_update_tables(ctx, false); mutt_clear_threads(ctx); } diff --git a/mutt_notmuch.c b/mutt_notmuch.c index ba889f609..af5893d5c 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -1121,7 +1121,7 @@ static void append_message(struct Context *ctx, notmuch_query_t *q, mx_alloc_memory(ctx); } if (access(path, F_OK) == 0) - h = maildir_parse_message(MUTT_MAILDIR, path, 0, NULL); + h = maildir_parse_message(MUTT_MAILDIR, path, false, NULL); else { /* maybe moved try find it... */ @@ -1132,7 +1132,7 @@ static void append_message(struct Context *ctx, notmuch_query_t *q, FILE *f = maildir_open_find_message(folder, path, &newpath); if (f) { - h = maildir_parse_stream(MUTT_MAILDIR, f, newpath, 0, NULL); + h = maildir_parse_stream(MUTT_MAILDIR, f, newpath, false, NULL); fclose(f); mutt_debug(1, "nm: not up-to-date: %s -> %s\n", path, newpath); diff --git a/mx.c b/mx.c index 158102450..728c78741 100644 --- a/mx.c +++ b/mx.c @@ -901,7 +901,7 @@ int mx_close_mailbox(struct Context *ctx, int *index_hint) /** * mx_update_tables - Update a Context structure's internal tables */ -void mx_update_tables(struct Context *ctx, int committing) +void mx_update_tables(struct Context *ctx, bool committing) { int i, j; @@ -1104,7 +1104,7 @@ int mx_sync_mailbox(struct Context *ctx, int *index_hint) /* IMAP does this automatically after handling EXPUNGE */ if (ctx->magic != MUTT_IMAP) { - mx_update_tables(ctx, 1); + mx_update_tables(ctx, true); mutt_sort_headers(ctx, 1); /* rethread from scratch */ } } @@ -1404,7 +1404,7 @@ int mx_tags_commit(struct Context *ctx, struct Header *h, char *tags) /** * mx_tags_is_supported - return true if mailbox support tagging */ -int mx_tags_is_supported(struct Context *ctx) +bool mx_tags_is_supported(struct Context *ctx) { return ctx->mx_ops->commit_msg_tags && ctx->mx_ops->edit_msg_tags; } diff --git a/mx.h b/mx.h index 64f2320b0..f88dc8e22 100644 --- a/mx.h +++ b/mx.h @@ -94,8 +94,8 @@ int mh_check_empty(const char *path); int maildir_check_empty(const char *path); -struct Header *maildir_parse_message(int magic, const char *fname, int is_old, struct Header *h); -struct Header *maildir_parse_stream(int magic, FILE *f, const char *fname, int is_old, struct Header *_h); +struct Header *maildir_parse_message(int magic, const char *fname, bool is_old, struct Header *h); +struct Header *maildir_parse_stream(int magic, FILE *f, const char *fname, bool is_old, struct Header *_h); void maildir_parse_flags(struct Header *h, const char *path); bool maildir_update_flags(struct Context *ctx, struct Header *o, struct Header *n); void maildir_flags(char *dest, size_t destlen, struct Header *hdr); @@ -112,7 +112,7 @@ bool mx_is_notmuch(const char *p); int mx_tags_editor(struct Context *ctx, const char *tags, char *buf, size_t buflen); int mx_tags_commit(struct Context *ctx, struct Header *h, char *tags); -int mx_tags_is_supported(struct Context *ctx); +bool mx_tags_is_supported(struct Context *ctx); FILE *maildir_open_find_message(const char *folder, const char *msg, char **newname); @@ -120,7 +120,7 @@ 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, int committing); +void mx_update_tables(struct Context *ctx, bool committing); struct MxOps *mx_get_ops(int magic); extern struct MxOps mx_maildir_ops; -- 2.40.0