From 1d8542758e80a1947da510b3322b0df55e4f395c Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Fri, 14 Jul 2017 14:15:08 +0100 Subject: [PATCH] clang-format --- menu.c | 3 ++- muttlib.c | 10 +++++----- newsrc.c | 10 ++++++---- pager.c | 27 ++++++++++++++------------- pattern.c | 8 ++++---- 5 files changed, 31 insertions(+), 27 deletions(-) diff --git a/menu.c b/menu.c index e42ed3c30..6ae2b21f1 100644 --- a/menu.c +++ b/menu.c @@ -934,7 +934,8 @@ static int menu_search(struct Menu *menu, int op) mutt_str_replace(&SearchBuffers[menu->menu], buf); searchBuf = SearchBuffers[menu->menu]; } - menu->search_dir = (op == OP_SEARCH || op == OP_SEARCH_NEXT) ? MUTT_SEARCH_DOWN : MUTT_SEARCH_UP; + menu->search_dir = + (op == OP_SEARCH || op == OP_SEARCH_NEXT) ? MUTT_SEARCH_DOWN : MUTT_SEARCH_UP; } search_dir = (menu->search_dir == MUTT_SEARCH_UP) ? -1 : 1; diff --git a/muttlib.c b/muttlib.c index 8a80faab9..ad5542dfe 100644 --- a/muttlib.c +++ b/muttlib.c @@ -1294,11 +1294,11 @@ char *mutt_apply_replace(char *dbuf, size_t dlen, char *sbuf, struct ReplaceList void mutt_FormatString(char *dest, /* output buffer */ size_t destlen, /* output buffer len */ size_t col, /* starting column (nonzero when called recursively) */ - int cols, /* maximum columns */ - const char *src, /* template string */ - format_t *callback, /* callback for processing */ - unsigned long data, /* callback data */ - enum FormatFlag flags) /* callback flags */ + int cols, /* maximum columns */ + const char *src, /* template string */ + format_t *callback, /* callback for processing */ + unsigned long data, /* callback data */ + enum FormatFlag flags) /* callback flags */ { char prefix[SHORT_STRING], buf[LONG_STRING], *cp = NULL, *wptr = dest, ch; char ifstring[SHORT_STRING], elsestring[SHORT_STRING]; diff --git a/newsrc.c b/newsrc.c index 5438ae7b3..ef37d02c3 100644 --- a/newsrc.c +++ b/newsrc.c @@ -814,9 +814,10 @@ void nntp_clear_cache(struct NntpServer *nserv) * %s = news server name * %S = url schema * %u = username */ -const char *nntp_format_str(char *dest, size_t destlen, size_t col, int cols, char op, - const char *src, const char *fmt, const char *ifstring, - const char *elsestring, unsigned long data, enum FormatFlag flags) +const char *nntp_format_str(char *dest, size_t destlen, size_t col, int cols, + char op, const char *src, const char *fmt, + const char *ifstring, const char *elsestring, + unsigned long data, enum FormatFlag flags) { struct NntpServer *nserv = (struct NntpServer *) data; struct Account *acct = &nserv->conn->account; @@ -1035,7 +1036,8 @@ struct NntpServer *nntp_select_server(char *server, int leave_lock) if (last >= nntp_data->first_message && last <= nntp_data->last_message) { nntp_data->last_cached = last; - mutt_debug(2, "nntp_select_server: %s last_cached=%u\n", nntp_data->group, last); + mutt_debug(2, "nntp_select_server: %s last_cached=%u\n", + nntp_data->group, last); } } mutt_hcache_free(hc, &hdata); diff --git a/pager.c b/pager.c index d69ea55d8..328c5dc15 100644 --- a/pager.c +++ b/pager.c @@ -842,8 +842,8 @@ static void resolve_types(char *buf, char *raw, struct Line *line_info, int n, { if (q_classify && line_info[n].quote == NULL) line_info[n].quote = classify_quote(quote_list, buf + pmatch[0].rm_so, - pmatch[0].rm_eo - pmatch[0].rm_so, - force_redraw, q_level); + pmatch[0].rm_eo - pmatch[0].rm_so, + force_redraw, q_level); line_info[n].type = MT_COLOR_QUOTED; } else @@ -858,8 +858,8 @@ static void resolve_types(char *buf, char *raw, struct Line *line_info, int n, { if (q_classify && line_info[n].quote == NULL) line_info[n].quote = classify_quote(quote_list, buf + pmatch[0].rm_so, - pmatch[0].rm_eo - pmatch[0].rm_so, - force_redraw, q_level); + pmatch[0].rm_eo - pmatch[0].rm_so, + force_redraw, q_level); line_info[n].type = MT_COLOR_QUOTED; } } @@ -1373,10 +1373,10 @@ static int format_line(struct Line **line_info, int n, unsigned char *buf, int f * 0 normal exit, line was not displayed * >0 normal exit, line was displayed */ -static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info, int n, - int *last, int *max, int flags, struct QClass **quote_list, - int *q_level, int *force_redraw, regex_t *search_re, - struct MuttWindow *pager_window) +static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info, + int n, int *last, int *max, int flags, + struct QClass **quote_list, int *q_level, int *force_redraw, + regex_t *search_re, struct MuttWindow *pager_window) { unsigned char *buf = NULL, *fmt = NULL; size_t buflen = 0; @@ -1424,8 +1424,8 @@ static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info, int goto out; } - resolve_types((char *) fmt, (char *) buf, *line_info, n, *last, quote_list, - q_level, force_redraw, flags & MUTT_SHOWCOLOR); + resolve_types((char *) fmt, (char *) buf, *line_info, n, *last, + quote_list, q_level, force_redraw, flags & MUTT_SHOWCOLOR); /* avoid race condition for continuation lines when scrolling up */ for (m = n + 1; m < *last && (*line_info)[m].offset && (*line_info)[m].continuation; m++) @@ -1471,7 +1471,8 @@ static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info, int offset = 0; (*line_info)[n].search_cnt = 0; - while (regexec(search_re, (char *) fmt + offset, 1, pmatch, (offset ? REG_NOTBOL : 0)) == 0) + while (regexec(search_re, (char *) fmt + offset, 1, pmatch, + (offset ? REG_NOTBOL : 0)) == 0) { if (++((*line_info)[n].search_cnt) > 1) safe_realloc(&((*line_info)[n].search), @@ -1839,8 +1840,8 @@ static void pager_menu_redraw(struct Menu *pager_menu) } i = -1; j = -1; - while (display_line(rd->fp, &rd->last_pos, &rd->line_info, ++i, &rd->last_line, &rd->max_line, - rd->has_types | rd->search_flag | (rd->flags & MUTT_PAGER_NOWRAP), + while (display_line(rd->fp, &rd->last_pos, &rd->line_info, ++i, &rd->last_line, + &rd->max_line, rd->has_types | rd->search_flag | (rd->flags & MUTT_PAGER_NOWRAP), &rd->quote_list, &rd->q_level, &rd->force_redraw, &rd->search_re, rd->pager_window) == 0) if (!rd->line_info[i].continuation && ++j == rd->lines) diff --git a/pattern.c b/pattern.c index 3df3598cf..8e1b8a540 100644 --- a/pattern.c +++ b/pattern.c @@ -1333,8 +1333,8 @@ struct Pattern *mutt_pattern_comp(/* const */ char *s, int flags, struct Buffer return curlist; } -static bool perform_and(struct Pattern *pat, enum PatternExecFlag flags, struct Context *ctx, - struct Header *hdr, struct PatternCache *cache) +static bool perform_and(struct Pattern *pat, enum PatternExecFlag flags, + struct Context *ctx, struct Header *hdr, struct PatternCache *cache) { for (; pat; pat = pat->next) if (mutt_pattern_exec(pat, flags, ctx, hdr, cache) <= 0) @@ -1342,8 +1342,8 @@ static bool perform_and(struct Pattern *pat, enum PatternExecFlag flags, struct return true; } -static int perform_or(struct Pattern *pat, enum PatternExecFlag flags, struct Context *ctx, - struct Header *hdr, struct PatternCache *cache) +static int perform_or(struct Pattern *pat, enum PatternExecFlag flags, + struct Context *ctx, struct Header *hdr, struct PatternCache *cache) { for (; pat; pat = pat->next) if (mutt_pattern_exec(pat, flags, ctx, hdr, cache) > 0) -- 2.40.0