Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
flatcap committed Feb 22, 2018
1 parent 3951af7 commit a13a83c
Show file tree
Hide file tree
Showing 65 changed files with 266 additions and 286 deletions.
24 changes: 12 additions & 12 deletions attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,18 +323,18 @@ void mutt_check_lookup_list(struct Body *b, char *type, size_t len)
if (n != TYPEOTHER)
{
snprintf(type, len, "%s/%s",
n == TYPEAUDIO ?
"audio" :
n == TYPEAPPLICATION ?
"application" :
n == TYPEIMAGE ?
"image" :
n == TYPEMESSAGE ?
"message" :
n == TYPEMODEL ? "model" :
n == TYPEMULTIPART ?
"multipart" :
n == TYPETEXT ? "text" : n == TYPEVIDEO ? "video" : "other",
n == TYPEAUDIO ? "audio" :
n == TYPEAPPLICATION ?
"application" :
n == TYPEIMAGE ?
"image" :
n == TYPEMESSAGE ?
"message" :
n == TYPEMODEL ?
"model" :
n == TYPEMULTIPART ?
"multipart" :
n == TYPETEXT ? "text" : n == TYPEVIDEO ? "video" : "other",
tmp.subtype);
mutt_debug(1, "\"%s\" -> %s\n", b->filename, type);
}
Expand Down
8 changes: 4 additions & 4 deletions body.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ int mutt_copy_body(FILE *fp, struct Body **tgt, struct Body *src)
struct Parameter *np, *new;
TAILQ_FOREACH(np, &src->parameter, entries)
{
new = mutt_param_new();
new->attribute = mutt_str_strdup(np->attribute);
new->value = mutt_str_strdup(np->value);
TAILQ_INSERT_HEAD(&b->parameter, new, entries);
new = mutt_param_new();
new->attribute = mutt_str_strdup(np->attribute);
new->value = mutt_str_strdup(np->value);
TAILQ_INSERT_HEAD(&b->parameter, new, entries);
}

mutt_stamp_attachment(b);
Expand Down
15 changes: 8 additions & 7 deletions browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,7 @@ static const char *folder_format_str(char *buf, size_t buflen, size_t col, int c
else
{
tnow = time(NULL);
t_fmt =
tnow - folder->ff->mtime < 31536000 ? "%b %d %H:%M" : "%b %d %Y";
t_fmt = tnow - folder->ff->mtime < 31536000 ? "%b %d %H:%M" : "%b %d %Y";
}

if (!do_locales)
Expand Down Expand Up @@ -730,7 +729,8 @@ static int examine_directory(struct Menu *menu, struct BrowserState *state,
continue;
if (prefix && *prefix && (strncmp(prefix, nntp_data->group, strlen(prefix)) != 0))
continue;
if (Mask && Mask->regex && !((regexec(Mask->regex, nntp_data->group, 0, NULL, 0) == 0) ^ Mask->not))
if (Mask && Mask->regex &&
!((regexec(Mask->regex, nntp_data->group, 0, NULL, 0) == 0) ^ Mask->not))
continue;
add_folder(menu, state, nntp_data->group, NULL, NULL, NULL, nntp_data);
}
Expand Down Expand Up @@ -788,7 +788,8 @@ static int examine_directory(struct Menu *menu, struct BrowserState *state,
{
continue;
}
if (Mask && Mask->regex && !((regexec(Mask->regex, de->d_name, 0, NULL, 0) == 0) ^ Mask->not))
if (Mask && Mask->regex &&
!((regexec(Mask->regex, de->d_name, 0, NULL, 0) == 0) ^ Mask->not))
continue;

mutt_file_concat_path(buffer, d, de->d_name, sizeof(buffer));
Expand Down Expand Up @@ -1411,7 +1412,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi
#ifdef USE_IMAP
|| state.entry[menu->current].inferiors
#endif
)
)
{
/* make sure this isn't a MH or maildir mailbox */
if (buffy)
Expand All @@ -1433,7 +1434,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi
#ifdef USE_IMAP
|| state.entry[menu->current].inferiors
#endif
)
)
{
/* save the old directory */
mutt_str_strfcpy(OldLastDir, LastDir, sizeof(OldLastDir));
Expand Down Expand Up @@ -1548,7 +1549,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi
#endif
else
mutt_file_concat_path(f, LastDir, state.entry[menu->current].name, flen);
/* fallthrough */
/* fallthrough */

case OP_EXIT:

Expand Down
3 changes: 1 addition & 2 deletions buffy.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ static int fseek_last_message(FILE *f)
/* 'i' is Index into `buffer' for scanning. */
for (int i = bytes_read; i >= 0; i--)
{
if (mutt_str_strncmp(buffer + i, "\n\nFrom ",
mutt_str_strlen("\n\nFrom ")) == 0)
if (mutt_str_strncmp(buffer + i, "\n\nFrom ", mutt_str_strlen("\n\nFrom ")) == 0)
{ /* found it - go to the beginning of the From */
fseeko(f, pos + i + 2, SEEK_SET);
return 0;
Expand Down
5 changes: 3 additions & 2 deletions color.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ static int parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long dat
/* We don't even have colors compiled in */
parse_uncolor
#endif
)
)
{
/* just eat the command, but don't do anything real about it */
do
Expand Down Expand Up @@ -871,7 +871,8 @@ static int parse_color(struct Buffer *buf, struct Buffer *s, struct Buffer *err,

#ifdef HAVE_COLOR
#ifdef HAVE_USE_DEFAULT_COLORS
if (!OPT_NO_CURSES && has_colors()
if (!OPT_NO_CURSES &&
has_colors()
/* delay use_default_colors() until needed, since it initializes things */
&& (fg == COLOR_DEFAULT || bg == COLOR_DEFAULT || object == MT_COLOR_TREE) &&
use_default_colors() != OK)
Expand Down
19 changes: 8 additions & 11 deletions commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,17 +519,15 @@ void mutt_print_message(struct Header *h)
return;
}

if (query_quadoption(Print,
h ? _("Print message?") : _("Print tagged messages?")) != MUTT_YES)
if (query_quadoption(Print, h ? _("Print message?") : _("Print tagged messages?")) != MUTT_YES)
{
return;
}

if (pipe_message(h, PrintCommand, PrintDecode, 1, PrintSplit, "\f") == 0)
mutt_message(h ? _("Message printed") : _("Messages printed"));
else
mutt_message(h ? _("Message could not be printed") :
_("Messages could not be printed"));
mutt_message(h ? _("Message could not be printed") : _("Messages could not be printed"));
}

int mutt_select_sort(int reverse)
Expand Down Expand Up @@ -765,12 +763,10 @@ int mutt_save_message(struct Header *h, int delete, int decode, int decrypt)
struct stat st;

snprintf(prompt, sizeof(prompt),
decode ? (delete ? _("Decode-save%s to mailbox") :
_("Decode-copy%s to mailbox")) :
(decrypt ? (delete ? _("Decrypt-save%s to mailbox") :
_("Decrypt-copy%s to mailbox")) :
(delete ? _("Save%s to mailbox") :
_("Copy%s to mailbox"))),
decode ?
(delete ? _("Decode-save%s to mailbox") : _("Decode-copy%s to mailbox")) :
(decrypt ? (delete ? _("Decrypt-save%s to mailbox") : _("Decrypt-copy%s to mailbox")) :
(delete ? _("Save%s to mailbox") : _("Copy%s to mailbox"))),
h ? "" : _(" tagged"));

if (h)
Expand Down Expand Up @@ -993,7 +989,8 @@ int mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp)

snprintf(tmp, sizeof(tmp), "%s/%s", TYPE(b), NONULL(b->subtype));
type_changed = mutt_str_strcasecmp(tmp, obuf);
charset_changed = mutt_str_strcasecmp(charset, mutt_param_get(&b->parameter, "charset"));
charset_changed =
mutt_str_strcasecmp(charset, mutt_param_get(&b->parameter, "charset"));

/* if in send mode, check for conversion - current setting is default. */

Expand Down
5 changes: 2 additions & 3 deletions compose.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,7 @@ static void redraw_crypt_lines(struct Header *msg)
(msg->security & ENCRYPT) && SmimeEncryptWith && *SmimeEncryptWith)
{
SETCOLOR(MT_COLOR_COMPOSE_HEADER);
mutt_window_mvprintw(MuttIndexWindow, HDR_CRYPTINFO, 40, "%s",
_("Encrypt with: "));
mutt_window_mvprintw(MuttIndexWindow, HDR_CRYPTINFO, 40, "%s", _("Encrypt with: "));
NORMAL_COLOR;
printw("%s", NONULL(SmimeEncryptWith));
}
Expand Down Expand Up @@ -1543,7 +1542,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
}
else if (i == MUTT_ABORT)
break; /* abort */
/* fallthrough */
/* fallthrough */

case OP_COMPOSE_POSTPONE_MESSAGE:

Expand Down
5 changes: 3 additions & 2 deletions conn/sasl.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ static int getnameinfo_err(int ret)
err = SASL_FAIL; /* no real equivalent */
break;
case EAI_SYSTEM:
mutt_debug(1, "A system error occurred. The error code can be found in "
"errno(%d,%s)).\n",
mutt_debug(1,
"A system error occurred. The error code can be found in "
"errno(%d,%s)).\n",
errno, strerror(errno));
err = SASL_FAIL; /* no real equivalent */
break;
Expand Down
5 changes: 2 additions & 3 deletions conn/ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ static int check_host(X509 *x509cert, const char *hostname, char *err, size_t er
/* did we find a name matching hostname? */
bool match_found;

/* Check if 'hostname' matches the one of the subjectAltName extensions of
/* Check if 'hostname' matches the one of the subjectAltName extensions of
* type DNS or the Common Name (CN). */

#ifdef HAVE_LIBIDN
Expand Down Expand Up @@ -992,8 +992,7 @@ static int interactive_check_cert(X509 *cert, int idx, size_t len, SSL *ssl, int
x509_get_part(x509_issuer, part[u]));

row++;
snprintf(menu->dialog[row++], SHORT_STRING, "%s",
_("This certificate is valid"));
snprintf(menu->dialog[row++], SHORT_STRING, "%s", _("This certificate is valid"));
snprintf(menu->dialog[row++], SHORT_STRING, _(" from %s"),
asn1time_to_string(X509_get_notBefore(cert)));
snprintf(menu->dialog[row++], SHORT_STRING, _(" to %s"),
Expand Down
3 changes: 1 addition & 2 deletions conn/ssl_gnutls.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,7 @@ static int tls_check_stored_hostname(const gnutls_datum_t *cert, const char *hos
fp = fopen(CertificateFile, "r");
if (fp)
{
if (REGCOMP(&preg,
"^#H ([a-zA-Z0-9_\\.-]+) ([0-9A-F]{4}( [0-9A-F]{4}){7})[ \t]*$",
if (REGCOMP(&preg, "^#H ([a-zA-Z0-9_\\.-]+) ([0-9A-F]{4}( [0-9A-F]{4}){7})[ \t]*$",
REG_ICASE) != 0)
{
mutt_file_fclose(&fp);
Expand Down
3 changes: 1 addition & 2 deletions copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,7 @@ int mutt_copy_header(FILE *in, struct Header *h, FILE *out, int flags, const cha
fputs("MIME-Version: 1.0\n", out);
fputs("Content-Transfer-Encoding: 8bit\n", out);
fputs("Content-Type: text/plain; charset=", out);
mutt_ch_canonical_charset(chsbuf, sizeof(chsbuf),
Charset ? Charset : "us-ascii");
mutt_ch_canonical_charset(chsbuf, sizeof(chsbuf), Charset ? Charset : "us-ascii");
mutt_addr_cat(buffer, sizeof(buffer), chsbuf, MimeSpecials);
fputs(buffer, out);
fputc('\n', out);
Expand Down
14 changes: 8 additions & 6 deletions curs_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@ void mutt_progress_init(struct Progress *progress, const char *msg,
if (progress->size)
{
if (progress->flags & MUTT_PROGRESS_SIZE)
mutt_str_pretty_size(progress->sizestr, sizeof(progress->sizestr), progress->size);
mutt_str_pretty_size(progress->sizestr, sizeof(progress->sizestr),
progress->size);
else
snprintf(progress->sizestr, sizeof(progress->sizestr), "%zu", progress->size);
}
Expand Down Expand Up @@ -585,11 +586,12 @@ void mutt_progress_update(struct Progress *progress, long pos, int percent)

if (progress->size > 0)
{
message_bar((percent > 0) ? percent : (int) (100.0 * (double) progress->pos /
progress->size),
"%s %s/%s (%d%%)", progress->msg, posstr, progress->sizestr,
(percent > 0) ? percent : (int) (100.0 * (double) progress->pos /
progress->size));
message_bar(
(percent > 0) ? percent :
(int) (100.0 * (double) progress->pos / progress->size),
"%s %s/%s (%d%%)", progress->msg, posstr, progress->sizestr,
(percent > 0) ? percent :
(int) (100.0 * (double) progress->pos / progress->size));
}
else
{
Expand Down
29 changes: 15 additions & 14 deletions curs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,9 +1181,9 @@ int mutt_index_menu(void)

switch (op)
{
/* ----------------------------------------------------------------------
* movement commands
*/
/* ----------------------------------------------------------------------
* movement commands
*/

case OP_BOTTOM_PAGE:
menu_bottom_page(menu);
Expand Down Expand Up @@ -1232,7 +1232,7 @@ int mutt_index_menu(void)
case OP_GET_PARENT:
CHECK_MSGCOUNT;
CHECK_VISIBLE;
/* fallthrough */
/* fallthrough */

case OP_GET_MESSAGE:
CHECK_IN_MAILBOX;
Expand Down Expand Up @@ -1463,7 +1463,7 @@ int mutt_index_menu(void)

break;

/* --------------------------------------------------------------------
/* --------------------------------------------------------------------
* `index' specific commands
*/

Expand Down Expand Up @@ -1652,10 +1652,11 @@ int mutt_index_menu(void)
{
mutt_set_flag(Context, CURHDR, MUTT_TAG, !CURHDR->tagged);

Context->last_tag =
CURHDR->tagged ? CURHDR : ((Context->last_tag == CURHDR && !CURHDR->tagged) ?
NULL :
Context->last_tag);
Context->last_tag = CURHDR->tagged ?
CURHDR :
((Context->last_tag == CURHDR && !CURHDR->tagged) ?
NULL :
Context->last_tag);

menu->redraw |= REDRAW_STATUS;
if (Resolve && menu->current < Context->vcount - 1)
Expand Down Expand Up @@ -1707,7 +1708,7 @@ int mutt_index_menu(void)
}
break;

/* --------------------------------------------------------------------
/* --------------------------------------------------------------------
* The following operations can be performed inside of the pager.
*/

Expand Down Expand Up @@ -2772,9 +2773,9 @@ int mutt_index_menu(void)
collapse_all(menu, 1);
break;

/* --------------------------------------------------------------------
* These functions are invoked directly from the internal-pager
*/
/* --------------------------------------------------------------------
* These functions are invoked directly from the internal-pager
*/

case OP_BOUNCE_MESSAGE:

Expand Down Expand Up @@ -3174,7 +3175,7 @@ int mutt_index_menu(void)
case OP_FORWARD_TO_GROUP:
CHECK_MSGCOUNT;
CHECK_VISIBLE;
/* fallthrough */
/* fallthrough */

case OP_POST:
CHECK_ATTACH;
Expand Down
2 changes: 1 addition & 1 deletion enter.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, int mul
{
goto self_insert;
}
/* fallthrough */
/* fallthrough */

case OP_EDITOR_COMPLETE:
case OP_EDITOR_COMPLETE_QUERY:
Expand Down
4 changes: 2 additions & 2 deletions flags.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ int mutt_change_flag(struct Header *h, int bf)
int i, flag;
struct Event event;

mutt_window_mvprintw(MuttMessageWindow, 0, 0, "%s? (D/N/O/r/*/!): ",
bf ? _("Set flag") : _("Clear flag"));
mutt_window_mvprintw(MuttMessageWindow, 0, 0,
"%s? (D/N/O/r/*/!): ", bf ? _("Set flag") : _("Clear flag"));
mutt_window_clrtoeol(MuttMessageWindow);

event = mutt_getch();
Expand Down
5 changes: 3 additions & 2 deletions from.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ int is_from(const char *s, char *path, size_t pathlen, time_t *tp)
p = strchr(p + 4, ' ');
if (!p)
{
mutt_debug(1, "error parsing what appears to be a pipermail-style "
"obscured return_path: %s\n",
mutt_debug(1,
"error parsing what appears to be a pipermail-style "
"obscured return_path: %s\n",
s);
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ const struct Binding OpEditor[] = { /* map: editor */
{ "buffy-cycle", OP_EDITOR_BUFFY_CYCLE, " " },
{ "history-up", OP_EDITOR_HISTORY_UP, NULL },
{ "history-down", OP_EDITOR_HISTORY_DOWN, NULL },
{ "history-search", OP_EDITOR_HISTORY_SEARCH, "\022" },
{ "history-search", OP_EDITOR_HISTORY_SEARCH, "\022" },
{ "transpose-chars", OP_EDITOR_TRANSPOSE_CHARS, NULL },
{ NULL, 0, NULL },
};
Expand Down
Loading

0 comments on commit a13a83c

Please sign in to comment.