From 19806c1ee3019ddf9facf23eb19a13c128abfba9 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Wed, 28 Nov 2007 17:30:41 +0100 Subject: [PATCH] return isn't a function FFS Signed-off-by: Pierre Habouzit --- alias.cpkg | 4 +- attach.c | 36 +++++++------- buffy.cpkg | 2 +- commands.c | 14 +++--- compose.c | 8 +-- copy.c | 50 +++++++++---------- crypt.cpkg | 34 ++++++------- flags.c | 6 +-- handler.c | 32 ++++++------ help.c | 12 ++--- imap/imap.c | 16 +++--- imap/util.c | 4 +- init.c | 110 ++++++++++++++++++++--------------------- keymap.c | 38 +++++++------- lib-lib/file.c | 4 +- lib-lib/hash.c | 4 +- lib-lib/mapping.c | 4 +- lib-mime/crypt.c | 4 +- lib-mime/rfc3676.c | 2 +- lib-mime/rfc822parse.c | 4 +- lib-mx/compress.c | 4 +- lib-mx/hcache.c | 2 +- lib-mx/mbox.c | 46 ++++++++--------- lib-mx/mh.c | 18 +++---- lib-mx/mx.c | 40 +++++++-------- lib-sys/filter.c | 14 +++--- lib-sys/mutt_ssl.cpkg | 4 +- lib-ui/browser.c | 16 +++--- lib-ui/color.c | 36 +++++++------- lib-ui/complete.c | 4 +- lib-ui/curs_lib.c | 12 ++--- lib-ui/curs_main.c | 16 +++--- lib-ui/enter.c | 2 +- lib-ui/history.c | 8 +-- lib-ui/menu.c | 16 +++--- lib-ui/query.c | 4 +- lib-ui/status.c | 4 +- muttlib.c | 46 ++++++----------- pager.c | 26 +++++----- pattern.c | 104 +++++++++++++++++++------------------- pop.c | 2 +- postpone.c | 22 ++++----- recvattach.c | 4 +- recvcmd.c | 2 +- send.c | 44 ++++++++--------- sendlib.c | 28 +++++------ sort.c | 46 ++++++++--------- thread.c | 74 +++++++++++++-------------- 48 files changed, 505 insertions(+), 527 deletions(-) diff --git a/alias.cpkg b/alias.cpkg index a3b8d8d..4530db9 100644 --- a/alias.cpkg +++ b/alias.cpkg @@ -626,7 +626,7 @@ static int alias_SortAlias (const void *a, const void *b) alias_t *pb = *(alias_t **) b; int r = m_strcasecmp(pa->name, pb->name); - return (RSORT (r)); + return RSORT (r); } static int alias_SortAddress (const void *a, const void *b) @@ -651,7 +651,7 @@ static int alias_SortAddress (const void *a, const void *b) r = -1; else r = ascii_strcasecmp (pa->mailbox, pb->mailbox); - return (RSORT (r)); + return RSORT (r); } void mutt_alias_menu (char *buf, size_t buflen, alias_t * aliases) diff --git a/attach.c b/attach.c index 4d600f9..00df99c 100644 --- a/attach.c +++ b/attach.c @@ -255,7 +255,7 @@ static int is_mmnoask (const char *buf) if ((p = getenv ("MM_NOASK")) != NULL && *p) { if (m_strcmp(p, "1") == 0) - return (1); + return 1; m_strcpy(tmp, sizeof(tmp), p); p = tmp; @@ -264,22 +264,22 @@ static int is_mmnoask (const char *buf) if ((q = strrchr (p, '/')) != NULL) { if (*(q + 1) == '*') { if (ascii_strncasecmp (buf, p, q - p) == 0) - return (1); + return 1; } else { if (ascii_strcasecmp (buf, p) == 0) - return (1); + return 1; } } else { lng = m_strlen(p); if (buf[lng] == '/' && m_strncasecmp(buf, p, lng) == 0) - return (1); + return 1; } p = NULL; } } - return (0); + return 0; } void mutt_check_lookup_list (BODY * b, char *type, int len) @@ -701,14 +701,14 @@ int mutt_save_attachment (FILE * fp, BODY * m, char *path, int flags, if ((s.fpout = mutt_save_attachment_open (path, flags)) == NULL) { mutt_perror ("fopen"); - return (-1); + return -1; } fseeko ((s.fpin = fp), m->offset, 0); mutt_decode_attachment (m, &s); if (m_fclose(&s.fpout) != 0) { mutt_perror ("fclose"); - return (-1); + return -1; } } } else { @@ -718,13 +718,13 @@ int mutt_save_attachment (FILE * fp, BODY * m, char *path, int flags, if ((ofp = fopen (m->filename, "r")) == NULL) { mutt_perror ("fopen"); - return (-1); + return -1; } if ((nfp = mutt_save_attachment_open (path, flags)) == NULL) { mutt_perror ("fopen"); m_fclose(&ofp); - return (-1); + return -1; } if (mutt_copy_stream (ofp, nfp) == -1) { @@ -732,7 +732,7 @@ int mutt_save_attachment (FILE * fp, BODY * m, char *path, int flags, m_fclose(&ofp); m_fclose(&nfp); - return (-1); + return -1; } m_fclose(&ofp); m_fclose(&nfp); @@ -757,7 +757,7 @@ int mutt_decode_save_attachment (FILE * fp, BODY * m, int pathfd, if (s.fpout == NULL) { close(pathfd); mutt_perror ("fopen"); - return (-1); + return -1; } if (fp == NULL) { @@ -768,12 +768,12 @@ int mutt_decode_save_attachment (FILE * fp, BODY * m, int pathfd, if (stat (m->filename, &st) == -1) { mutt_perror ("stat"); m_fclose(&s.fpout); - return (-1); + return -1; } if ((s.fpin = fopen (m->filename, "r")) == NULL) { mutt_perror ("fopen"); - return (-1); + return -1; } saved_encoding = m->encoding; @@ -808,7 +808,7 @@ int mutt_decode_save_attachment (FILE * fp, BODY * m, int pathfd, m_fclose(&s.fpin); } - return (0); + return 0; } /* Ok, the difference between send and receive: @@ -867,7 +867,7 @@ int mutt_print_attachment (FILE * fp, BODY * a) if ((ifp = fopen (newfile, "r")) == NULL) { mutt_perror ("fopen"); rfc1524_entry_delete(&entry); - return (0); + return 0; } if ((thepid = mutt_create_filter (command, &fpout, NULL, NULL)) < 0) { @@ -894,7 +894,7 @@ int mutt_print_attachment (FILE * fp, BODY * a) unlink (newfile); rfc1524_entry_delete(&entry); - return (1); + return 1; } tok = mime_which_token(type, -1); @@ -956,7 +956,7 @@ int mutt_attach_check (HEADER* hdr) { if (!hdr || !hdr->content || !((regex_t*) AttachRemindRegexp.rx) || (fp = safe_fopen (hdr->content->filename, "r")) == NULL) - return (0); + return 0; while (!found && fgets (buf, sizeof (buf), fp)) { p = buf; @@ -971,5 +971,5 @@ int mutt_attach_check (HEADER* hdr) { } m_fclose(&fp); - return (found); + return found; } diff --git a/buffy.cpkg b/buffy.cpkg index b516fe7..264caac 100644 --- a/buffy.cpkg +++ b/buffy.cpkg @@ -315,7 +315,7 @@ int buffy_check(int force) } if (BuffyCount > 0 && force != 2) sidebar_draw (); - return (BuffyCount); + return BuffyCount; } int buffy_list (void) diff --git a/commands.c b/commands.c index beaac30..f15ca1c 100644 --- a/commands.c +++ b/commands.c @@ -433,7 +433,7 @@ int mutt_select_sort (int reverse) if (reverse) Sort |= SORT_REVERSE; - return (Sort != method ? 0 : -1); /* no need to resort if it's the same */ + return Sort != method ? 0 : -1; /* no need to resort if it's the same */ } /* invoke a command in a subshell */ @@ -557,7 +557,7 @@ int _mutt_save_message (HEADER * h, CONTEXT * ctx, int delete, int decode, mutt_set_flag (Context, h, M_TAG, 0); mutt_set_flag (Context, h, M_APPENDED, 1); } - return (0); + return 0; } /* returns 0 if the copy/save was successful, or -1 on error/abort */ @@ -610,7 +610,7 @@ int mutt_save_message (HEADER * h, int delete, mutt_pretty_mailbox (buf); if (mutt_enter_fname (prompt, buf, sizeof (buf), redraw, 0) == -1) - return (-1); + return -1; if (*redraw != REDRAW_FULL) { if (!h) @@ -620,7 +620,7 @@ int mutt_save_message (HEADER * h, int delete, } if (!buf[0]) - return (-1); + return -1; /* This is an undocumented feature of ELM pointed out to me by Felix von * Leitner @@ -657,7 +657,7 @@ int mutt_save_message (HEADER * h, int delete, if (h) { if (_mutt_save_message (h, &ctx, delete, decode, decrypt) != 0) { mx_close_mailbox (&ctx, NULL); - return (-1); + return -1; } } else { for (i = 0; i < Context->vcount; i++) { @@ -667,7 +667,7 @@ int mutt_save_message (HEADER * h, int delete, if (_mutt_save_message (Context->hdrs[Context->v2r[i]], &ctx, delete, decode, decrypt) != 0) { mx_close_mailbox (&ctx, NULL); - return (-1); + return -1; } } } @@ -689,7 +689,7 @@ int mutt_save_message (HEADER * h, int delete, } mutt_clear_error (); - return (0); + return 0; } return -1; diff --git a/compose.c b/compose.c index b6677d4..5e47cbe 100644 --- a/compose.c +++ b/compose.c @@ -244,7 +244,7 @@ static int delete_attachment (MUTTMENU * menu, short *idxlen, int x) idx[x] = idx[x + 1]; menu->max = --(*idxlen); - return (0); + return 0; } static void update_idx (MUTTMENU * menu, ATTACHPTR ** idx, short idxlen) @@ -348,7 +348,7 @@ static const char *compose_format_str (char *buf, ssize_t buflen, char op, case 0: *buf = 0; - return (src); + return src; default: *buf = 0; @@ -358,7 +358,7 @@ static const char *compose_format_str (char *buf, ssize_t buflen, char op, if (flags & M_FORMAT_OPTIONAL) compose_status_line(buf, buflen, menu, optional ? ifstr : elstr); - return (src); + return src; } static void compose_status_line (char *buf, ssize_t buflen, MUTTMENU * menu, @@ -1066,5 +1066,5 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ p_delete(&idx); - return (r); + return r; } diff --git a/copy.c b/copy.c index a52a4eb..f04e5b5 100644 --- a/copy.c +++ b/copy.c @@ -106,7 +106,7 @@ mutt_copy_hdr (FILE* in, FILE* out, off_t off_start, off_t off_end, } if (!ignore && fputs (buf, out) == EOF) - return (-1); + return -1; } return 0; } @@ -313,9 +313,7 @@ mutt_copy_hdr (FILE* in, FILE* out, off_t off_start, off_t off_end, p_delete(&headers[x]); p_delete(&headers); - if (error) - return (-1); - return (0); + return error ? -1 : 0; } /* flags @@ -353,7 +351,7 @@ mutt_copy_header (FILE * in, HEADER * h, FILE * out, int flags, if (mutt_copy_hdr (in, out, h->offset, h->content->offset, flags, prefix) == -1) - return (-1); + return -1; if (flags & CH_TXTPLAIN) { char chsbuf[STRING]; @@ -377,21 +375,21 @@ mutt_copy_header (FILE * in, HEADER * h, FILE * out, int flags, string_list_t *listp = h->env->in_reply_to; if (fputs ("In-Reply-To: ", out) == EOF) - return (-1); + return -1; for (; listp; listp = listp->next) if ((fputs (listp->data, out) == EOF) || (fputc (' ', out) == EOF)) - return (-1); + return -1; if (fputc ('\n', out) == EOF) - return (-1); + return -1; } if (h->env->refs_changed && h->env->references) { string_list_t *listp = h->env->references, *refs = NULL, *t; if (fputs ("References: ", out) == EOF) - return (-1); + return -1; /* Mutt stores references in reverse order, thus we create * a reordered refs list that we can put in the headers */ @@ -403,49 +401,49 @@ mutt_copy_header (FILE * in, HEADER * h, FILE * out, int flags, for (; refs; refs = refs->next) if ((fputs (refs->data, out) == EOF) || (fputc (' ', out) == EOF)) - return (-1); + return -1; /* clearing refs from memory */ for (t = refs; refs; refs = t->next, t = refs) p_delete(&refs); if (fputc ('\n', out) == EOF) - return (-1); + return -1; } if (h->old || h->read) { if (fputs ("Status: ", out) == EOF) - return (-1); + return -1; if (h->read) { if (fputs ("RO", out) == EOF) - return (-1); + return -1; } else if (h->old) { if (fputc ('O', out) == EOF) - return (-1); + return -1; } if (fputc ('\n', out) == EOF) - return (-1); + return -1; } if (h->flagged || h->replied) { if (fputs ("X-Status: ", out) == EOF) - return (-1); + return -1; if (h->replied) { if (fputc ('A', out) == EOF) - return (-1); + return -1; } if (h->flagged) { if (fputc ('F', out) == EOF) - return (-1); + return -1; } if (fputc ('\n', out) == EOF) - return (-1); + return -1; } } } @@ -460,13 +458,13 @@ mutt_copy_header (FILE * in, HEADER * h, FILE * out, int flags, if (flags & CH_PREFIX) fputs (prefix, out); if (fputc ('\n', out) == EOF) /* add header terminator */ - return (-1); + return -1; } if (ferror (out) || feof (out)) return -1; - return (0); + return 0; } /* Count the number of lines and bytes to be deleted in this body*/ @@ -628,14 +626,14 @@ _mutt_copy_message (FILE * fpout, FILE * fpin, HEADER * hdr, BODY * body, if ((flags & M_CM_DECODE_PGP) && (hdr->security & APPLICATION_PGP) && hdr->content->type == TYPEMULTIPART) { if (crypt_pgp_decrypt_mime (fpin, &fp, hdr->content, &cur)) - return (-1); + return -1; fputs ("MIME-Version: 1.0\n", fpout); } if ((flags & M_CM_DECODE_SMIME) && (hdr->security & APPLICATION_SMIME) && hdr->content->type == TYPEAPPLICATION) { if (crypt_smime_decrypt_mime (fpin, &fp, hdr->content, &cur)) - return (-1); + return -1; } mutt_write_mime_header (cur, fpout); @@ -645,7 +643,7 @@ _mutt_copy_message (FILE * fpout, FILE * fpin, HEADER * hdr, BODY * body, if (mutt_copy_bytes (fp, fpout, cur->length) == -1) { m_fclose(&fp); body_list_wipe(&cur); - return (-1); + return -1; } body_list_wipe(&cur); m_fclose(&fp); @@ -717,9 +715,9 @@ _mutt_append_message (CONTEXT * dest, FILE * fpin, CONTEXT * src __attribute__ ( fseeko(fpin, hdr->offset, 0); if (fgets (buf, sizeof (buf), fpin) == NULL) - return (-1); + return -1; if ((msg = mx_open_new_message (dest, hdr, is_from (buf, NULL, 0, NULL) ? 0 : M_ADD_FROM)) == NULL) - return (-1); + return -1; if (dest->magic == M_MBOX) chflags |= CH_FROM | CH_FORCE_FROM; chflags |= (dest->magic == M_MAILDIR ? CH_NOSTATUS : CH_UPDATE); diff --git a/crypt.cpkg b/crypt.cpkg index 67b37c2..203e685 100644 --- a/crypt.cpkg +++ b/crypt.cpkg @@ -1910,9 +1910,9 @@ int crypt_pgp_application_pgp_handler(BODY *m, STATE *s) if (needpass == -1) { state_attach_puts (_("[-- Error: could not find beginning" " of PGP message! --]\n\n"), s); - return (-1); + return -1; } - return (err); + return err; } /* MIME handler for pgp/mime encrypted messages. */ @@ -1933,7 +1933,7 @@ int crypt_pgp_encrypted_handler (BODY * a, STATE * s) if (s->flags & M_DISPLAY) state_attach_puts (_("[-- Error: malformed PGP/MIME message! --]\n\n"), s); - return (-1); + return -1; } /* Move forward to the application/pgp-encrypted body. */ @@ -1944,7 +1944,7 @@ int crypt_pgp_encrypted_handler (BODY * a, STATE * s) if (s->flags & M_DISPLAY) state_attach_puts (_("[-- Error: could not create temporary file! " "--]\n"), s); - return (-1); + return -1; } tattach = decrypt_part (a, s, fpout, 0, &is_signed); @@ -1986,7 +1986,7 @@ int crypt_pgp_encrypted_handler (BODY * a, STATE * s) m_fclose(&fpout); mutt_unlink (tempfile); - return (rc); + return rc; } /* Support for application/smime */ @@ -2004,7 +2004,7 @@ int crypt_smime_application_smime_handler (BODY * a, STATE * s) if (s->flags & M_DISPLAY) state_attach_puts (_("[-- Error: could not create temporary file! " "--]\n"), s); - return (-1); + return -1; } tattach = decrypt_part (a, s, fpout, 1, &is_signed); @@ -2050,7 +2050,7 @@ int crypt_smime_application_smime_handler (BODY * a, STATE * s) m_fclose(&fpout); mutt_unlink (tempfile); - return (rc); + return rc; } @@ -2288,8 +2288,7 @@ static int _crypt_compare_address (const void *a, const void *b) static int crypt_compare_address (const void *a, const void *b) { - return ((PgpSortKeys & SORT_REVERSE) ? !_crypt_compare_address (a, b) - : _crypt_compare_address (a, b)); + return !(PgpSortKeys & SORT_REVERSE) == _crypt_compare_address(a, b); } @@ -2308,8 +2307,7 @@ static int _crypt_compare_keyid (const void *a, const void *b) static int crypt_compare_keyid (const void *a, const void *b) { - return ((PgpSortKeys & SORT_REVERSE) ? !_crypt_compare_keyid (a, b) - : _crypt_compare_keyid (a, b)); + return !(PgpSortKeys & SORT_REVERSE) == _crypt_compare_keyid(a, b); } /* Compare 2 creation dates and the addresses. For sorting. */ @@ -2334,8 +2332,7 @@ static int _crypt_compare_date (const void *a, const void *b) static int crypt_compare_date (const void *a, const void *b) { - return ((PgpSortKeys & SORT_REVERSE) ? !_crypt_compare_date (a, b) - : _crypt_compare_date (a, b)); + return !(PgpSortKeys & SORT_REVERSE) == _crypt_compare_date(a, b); } /* Compare two trust values, the key length, the creation dates. the @@ -2376,13 +2373,12 @@ static int _crypt_compare_trust (const void *a, const void *b) if ((r = m_strcasecmp((*s)->uid, (*t)->uid))) return r > 0; - return (m_strcasecmp(crypt_keyid ((*s)), crypt_keyid ((*t)))) > 0; + return m_strcasecmp(crypt_keyid(*s), crypt_keyid(*t)) > 0; } static int crypt_compare_trust (const void *a, const void *b) { - return ((PgpSortKeys & SORT_REVERSE) ? !_crypt_compare_trust (a, b) - : _crypt_compare_trust (a, b)); + return !(PgpSortKeys & SORT_REVERSE) == _crypt_compare_trust(a, b); } /* Print the X.500 Distinguished Name part KEY from the array of parts @@ -3745,7 +3741,7 @@ int mutt_protect (HEADER * msg, char *keylist) if (!(tmp_pbody = crypt_smime_build_smime_entity (tmp_smime_pbody, keylist))) { /* signed ? free it! */ - return (-1); + return -1; } /* free tmp_body if messages was signed AND encrypted ... */ if (tmp_smime_pbody != msg->content && tmp_smime_pbody != tmp_pbody) { @@ -3770,7 +3766,7 @@ int mutt_protect (HEADER * msg, char *keylist) body_list_wipe(&tmp_pgp_pbody->next); } - return (-1); + return -1; } /* destroy temporary signature envelope when doing retainable @@ -4035,7 +4031,7 @@ int mutt_signed_handler(BODY *a, STATE *s) if (s->flags & M_DISPLAY && sigcnt) state_attach_puts (_("\n[-- End of signed data --]\n"), s); - return (rc); + return rc; } static int _mutt_check_traditional_pgp (HEADER * h, int *redraw) diff --git a/flags.c b/flags.c index f83d2a3..fe4f79a 100644 --- a/flags.c +++ b/flags.c @@ -283,7 +283,7 @@ int mutt_thread_set_flag (HEADER * hdr, int flag, int bf, int subthread) if ((Sort & SORT_MASK) != SORT_THREADS) { mutt_error _("Threading is not enabled."); - return (-1); + return -1; } if (!subthread) @@ -295,7 +295,7 @@ int mutt_thread_set_flag (HEADER * hdr, int flag, int bf, int subthread) mutt_set_flag (Context, cur->message, flag, bf); if ((cur = cur->child) == NULL) - return (0); + return 0; for (;;) { if (cur->message) @@ -309,7 +309,7 @@ int mutt_thread_set_flag (HEADER * hdr, int flag, int bf, int subthread) while (!cur->next) { cur = cur->parent; if (cur == start) - return (0); + return 0; } cur = cur->next; } diff --git a/handler.c b/handler.c index 54b4839..f75fab1 100644 --- a/handler.c +++ b/handler.c @@ -660,7 +660,7 @@ static int text_enriched_handler (BODY * a, STATE * s) p_delete(&(stte.line)); p_delete(&(stte.param)); - return (0); + return 0; } #define TXTHTML 1 @@ -816,7 +816,7 @@ static int alternative_handler (BODY * a, STATE * s) if (mustfree) body_list_wipe(&a); - return (rc); + return rc; } /* handles message/rfc822 body parts */ @@ -857,7 +857,7 @@ static int message_handler (BODY * a, STATE * s) a->encoding == ENCUUENCODED) body_list_wipe(&b); - return (rc); + return rc; } /* returns 1 if decoding the attachment will produce output */ @@ -867,11 +867,11 @@ int mutt_can_decode (BODY * a) snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype); if (mutt_is_autoview (a, type)) - return (rfc1524_mailcap_lookup (a, type, NULL, M_AUTOVIEW)); + return rfc1524_mailcap_lookup (a, type, NULL, M_AUTOVIEW); else if (a->type == TYPETEXT) - return (1); + return 1; else if (a->type == TYPEMESSAGE) - return (1); + return 1; else if (a->type == TYPEMULTIPART) { BODY *p; int tok = mime_which_token(a->subtype, -1); @@ -881,17 +881,17 @@ int mutt_can_decode (BODY * a) for (p = a->parts; p; p = p->next) { if (mutt_can_decode (p)) - return (1); + return 1; } } else if (a->type == TYPEAPPLICATION) { if (mutt_is_application_pgp(a)) - return (1); + return 1; if (mutt_is_application_smime (a)) - return (1); + return 1; } - return (0); + return 0; } static int multipart_handler (BODY * a, STATE * s) @@ -956,7 +956,7 @@ static int multipart_handler (BODY * a, STATE * s) a->encoding == ENCUUENCODED) body_list_wipe(&b); - return (rc); + return rc; } static int autoview_handler (BODY * a, STATE * s) @@ -999,7 +999,7 @@ static int autoview_handler (BODY * a, STATE * s) if ((fpin = safe_fopen (tempfile, "w+")) == NULL) { mutt_perror ("fopen"); rfc1524_entry_delete(&entry); - return (-1); + return -1; } mutt_copy_bytes (s->fpin, fpin, a->length); @@ -1073,7 +1073,7 @@ static int autoview_handler (BODY * a, STATE * s) mutt_clear_error (); } rfc1524_entry_delete(&entry); - return (rc); + return rc; } static int external_body_handler (BODY * b, STATE * s) @@ -1088,7 +1088,7 @@ static int external_body_handler (BODY * b, STATE * s) state_mark_attach (s); state_puts (_("[-- Error: message/external-body has no access-type parameter --]\n"), s); } - return (-1); + return -1; } expiration = parameter_getval(b->parameter, "expiration"); @@ -1155,7 +1155,7 @@ static int external_body_handler (BODY * b, STATE * s) CH_DECODE, NULL); } } - return (0); + return 0; } static void mutt_decode_base64(STATE *s, long len, int istext, iconv_t cd) @@ -1454,5 +1454,5 @@ int mutt_body_handler (BODY * b, STATE * s) bail: s->flags = oflags; - return (rc); + return rc; } diff --git a/help.c b/help.c index 0717d64..30bcbde 100644 --- a/help.c +++ b/help.c @@ -27,16 +27,16 @@ static struct binding_t *help_lookupFunction (int op, int menu) /* first look in the generic map for the function */ for (i = 0; OpGeneric[i].name; i++) if (OpGeneric[i].op == op) - return (&OpGeneric[i]); + return &OpGeneric[i]; } if ((map = km_get_table (menu))) { for (i = 0; map[i].name; i++) if (map[i].op == op) - return (&map[i]); + return &map[i]; } - return (NULL); + return NULL; } static int print_macro (FILE * f, int maxwidth, const char **macro) @@ -92,7 +92,7 @@ static int print_macro (FILE * f, int maxwidth, const char **macro) fprintf (f, "?"); } } - return (maxwidth - n); + return maxwidth - n; } static int pad (FILE * f, int col, int i) @@ -102,10 +102,10 @@ static int pad (FILE * f, int col, int i) if (col < i) { snprintf (fmt, sizeof (fmt), "%%-%ds", i - col); fprintf (f, fmt, ""); - return (i); + return i; } fputc (' ', f); - return (col + 1); + return col + 1; } static void help_format_line (FILE * f, int ismacro, diff --git a/imap/imap.c b/imap/imap.c index de761d3..38a633c 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -649,7 +649,7 @@ int imap_open_mailbox_append (CONTEXT * ctx) if (!(idata = imap_conn_find (&(mx.account), 0))) { p_delete(&mx.mbox); - return (-1); + return -1; } conn = idata->conn; @@ -671,7 +671,7 @@ int imap_open_mailbox_append (CONTEXT * ctx) if (imap_create_mailbox (idata, mailbox) < 0) return -1; - return (0); + return 0; } /* imap_logout: Gracefully log out of server. */ @@ -1396,7 +1396,7 @@ static int imap_complete_hosts (char *dest, ssize_t len) { matchlen = m_strlen(dest); if (!Incoming.len) - return (-1); + return -1; for (i = 0; i < Incoming.len; i++) { mailbox = Incoming.arr[i]; if (!m_strncmp(dest, mailbox->path, matchlen)) { @@ -1524,7 +1524,7 @@ int imap_reconnect (CONTEXT * ctx) IMAP_DATA *imap_data; if (!ctx) - return (-1); + return -1; imap_data = (IMAP_DATA *) ctx->data; @@ -1545,9 +1545,9 @@ int imap_reconnect (CONTEXT * ctx) int imap_is_magic (const char* path, struct stat* st __attribute__ ((unused))) { url_scheme_t s; if (!path || !*path) - return (-1); + return -1; s = url_check_scheme (NONULL (path)); - return ((s == U_IMAP || s == U_IMAPS) ? M_IMAP : -1); + return (s == U_IMAP || s == U_IMAPS) ? M_IMAP : -1; } static int acl_check_imap (CONTEXT* ctx, int bit) { @@ -1576,7 +1576,7 @@ static int imap_open_new_message (MESSAGE * msg, static int _imap_check_mailbox (CONTEXT* ctx, int* index_hint, int lock __attribute__ ((unused))) { - return (imap_check_mailbox (ctx, index_hint, 0)); + return imap_check_mailbox (ctx, index_hint, 0); } static int imap_commit_message (MESSAGE* msg, CONTEXT* ctx) { @@ -1584,7 +1584,7 @@ static int imap_commit_message (MESSAGE* msg, CONTEXT* ctx) { if ((r = m_fclose(&msg->fp)) == 0) r = imap_append_message (ctx, msg); - return (r); + return r; } mx_t const imap_mx = { diff --git a/imap/util.c b/imap/util.c index b6ba310..3cf6fbc 100644 --- a/imap/util.c +++ b/imap/util.c @@ -207,14 +207,14 @@ int imap_get_literal_count (const char *buf, long *bytes) char *pn; if (!(pc = strchr (buf, '{'))) - return (-1); + return -1; pc++; pn = pc; while (isdigit ((unsigned char) *pc)) pc++; *pc = 0; *bytes = atoi (pn); - return (0); + return 0; } /* imap_get_qualifier: in a tagged response, skip tag and status for diff --git a/init.c b/init.c index c9442ce..295c05c 100644 --- a/init.c +++ b/init.c @@ -99,19 +99,19 @@ static int bool_from_string (struct option_t* dst, const char* val, int flag = -1; if (!dst) - return (0); + return 0; if (ascii_strncasecmp (val, "yes", 3) == 0) flag = 1; else if (ascii_strncasecmp (val, "no", 2) == 0) flag = 0; if (flag < 0) - return (0); + return 0; if (flag) set_option (dst->data); else unset_option (dst->data); - return (1); + return 1; } static void num_to_string (char* dst, ssize_t dstlen, @@ -129,7 +129,7 @@ static int num_from_string (struct option_t* dst, const char* val, char* t = NULL; if (!dst) - return (0); + return 0; num = strtol (val, &t, 0); @@ -138,7 +138,7 @@ static int num_from_string (struct option_t* dst, const char* val, snprintf (errbuf, errlen, _("'%s' is invalid for $%s"), val, dst->option); } - return (0); + return 0; } /* just temporarily accept new val so that check_special for @@ -148,10 +148,10 @@ static int num_from_string (struct option_t* dst, const char* val, if (!check_special (dst->option, (unsigned long) num, errbuf, errlen)) { *((short*) dst->data) = old; - return (0); + return 0; } - return (1); + return 1; } static void str_to_string (char* dst, ssize_t dstlen, @@ -165,30 +165,30 @@ static int path_from_string (struct option_t* dst, const char* val, char path[_POSIX_PATH_MAX]; if (!dst) - return (0); + return 0; if (m_strisempty(val)) { p_delete((char**) dst->data); - return (1); + return 1; } path[0] = '\0'; m_strcpy(path, sizeof(path), val); mutt_expand_path (path, sizeof(path)); m_strreplace((char **) dst->data, path); - return (1); + return 1; } static int str_from_string (struct option_t* dst, const char* val, char* errbuf, ssize_t errlen) { if (!dst) - return (0); + return 0; if (!check_special (dst->option, (unsigned long) val, errbuf, errlen)) - return (0); + return 0; m_strreplace((char**) dst->data, val); - return (1); + return 1; } static void quad_to_string (char* dst, ssize_t dstlen, @@ -203,7 +203,7 @@ static int quad_from_string (struct option_t* dst, const char* val, int flag = -1; if (!dst) - return (0); + return 0; if (ascii_strncasecmp (val, "yes", 3) == 0) flag = M_YES; else if (ascii_strncasecmp (val, "no", 2) == 0) @@ -214,10 +214,10 @@ static int quad_from_string (struct option_t* dst, const char* val, flag = M_ASKNO; if (flag < 0) - return (0); + return 0; set_quadoption (dst->data, flag); - return (1); + return 1; } static void sort_to_string (char* dst, ssize_t dstlen, @@ -246,11 +246,11 @@ static int sort_from_string (struct option_t* dst, const char* val, if (errbuf) snprintf (errbuf, errlen, _("%s: Unknown type."), dst->option); - return (0); + return 0; } if (parse_sort (dst, val, map, errbuf, errlen) == -1) - return (0); - return (1); + return 0; + return 1; } static void rx_to_string (char* dst, ssize_t dstlen, @@ -268,13 +268,13 @@ static int rx_from_string (struct option_t* dst, const char* val, char* s = NULL; if (!dst) - return (0); + return 0; if (option (OPTATTACHMSG) && !m_strcmp(dst->option, "reply_regexp")) { if (errbuf) snprintf (errbuf, errlen, "Operation not permitted when in attach-message mode."); - return (0); + return 0; } if (!((rx_t*) dst->data)) @@ -284,7 +284,7 @@ static int rx_from_string (struct option_t* dst, const char* val, /* something to do? */ if (m_strisempty(val) || (p->pattern && m_strcmp(p->pattern, val) == 0)) - return (1); + return 1; if (m_strcmp(dst->option, "mask") != 0) flags |= mutt_which_case (val); @@ -301,7 +301,7 @@ static int rx_from_string (struct option_t* dst, const char* val, regerror (e, rx, errbuf, errlen); regfree (rx); p_delete(&rx); - return (0); + return 0; } if (p->rx) { @@ -316,7 +316,7 @@ static int rx_from_string (struct option_t* dst, const char* val, if (m_strcmp(dst->option, "reply_regexp") == 0) mutt_adjust_all_subjects (); - return (1); + return 1; } static int magic_from_string (struct option_t* dst, const char* val, @@ -325,7 +325,7 @@ static int magic_from_string (struct option_t* dst, const char* val, int flag = -1; if (!dst || m_strisempty(val)) - return (0); + return 0; if (ascii_strncasecmp (val, "mbox", 4) == 0) flag = M_MBOX; else if (ascii_strncasecmp (val, "mh", 2) == 0) @@ -334,10 +334,10 @@ static int magic_from_string (struct option_t* dst, const char* val, flag = M_MAILDIR; if (flag < 0) - return (0); + return 0; *((short*) dst->data) = flag; - return (1); + return 1; } @@ -365,7 +365,7 @@ int mutt_option_value (const char* val, char* dst, ssize_t dstlen) { if (!(option = hash_find (ConfigOptions, val))) { *dst = '\0'; - return (0); + return 0; } tmp = p_new(char, dstlen+1); FuncTable[DTYPE(option->type)].opt_tostr (tmp, dstlen, option); @@ -384,7 +384,7 @@ int mutt_option_value (const char* val, char* dst, ssize_t dstlen) { memcpy (dst, t, l+1); p_delete(&tmp); - return (1); + return 1; } static void toggle_quadoption (int opt) @@ -417,7 +417,7 @@ int query_quadoption2(int v, const char *prompt) switch (v) { case M_YES: case M_NO: - return (v); + return v; default: return mutt_yesorno(prompt, (v == M_ASKYES)); @@ -431,7 +431,7 @@ int query_quadoption (int opt, const char *prompt) switch (v) { case M_YES: case M_NO: - return (v); + return v; default: return mutt_yesorno(prompt, (v == M_ASKYES)); @@ -719,7 +719,7 @@ static int parse_alias (BUFFER * buf, BUFFER * s, if (!MoreArgs (s)) { m_strcpy(err->data, err->dsize, _("alias: no address")); - return (-1); + return -1; } mutt_extract_token (buf, s, 0); @@ -799,7 +799,7 @@ static int parse_my_hdr (BUFFER * buf, BUFFER * s, unsigned long data __attribut mutt_extract_token (buf, s, M_TOKEN_SPACE | M_TOKEN_QUOTE); if ((p = strpbrk (buf->data, ": \t")) == NULL || *p != ':') { m_strcpy(err->data, err->dsize, _("invalid header field")); - return (-1); + return -1; } keylen = p - buf->data + 1; @@ -846,7 +846,7 @@ parse_sort (struct option_t* dst, const char *s, const struct mapping_t *map, if ((i = mutt_getvaluebyname (s, map)) == -1) { if (errbuf) snprintf (errbuf, errlen, _("'%s' is invalid for $%s"), s, dst->option); - return (-1); + return -1; } *((short*) dst->data) = i | flags; @@ -896,7 +896,7 @@ static int init_expand (char** dst, struct option_t* src) { } else /* for non-string: take value as is */ *dst = m_strdup(src->init); - return (1); + return 1; } /* if additional data more == 1, we want to resolve synonyms */ @@ -935,17 +935,17 @@ static int check_num (const char* option, unsigned long p, if ((int) p < 0) { if (errbuf) snprintf (errbuf, errlen, _("'%d' is invalid for $%s"), (int) p, option); - return (0); + return 0; } - return (1); + return 1; } static int check_history (const char* option __attribute__ ((unused)), unsigned long p, char* errbuf, ssize_t errlen) { if (!check_num ("history", p, errbuf, errlen)) - return (0); + return 0; mutt_init_history (); - return (1); + return 1; } static int check_special (const char* name, unsigned long val, @@ -958,7 +958,7 @@ static int check_special (const char* name, unsigned long val, val, errbuf, errlen)); } } - return (1); + return 1; } static const struct mapping_t* get_sortmap (struct option_t* option) { @@ -981,7 +981,7 @@ static const struct mapping_t* get_sortmap (struct option_t* option) { map = SortMethods; break; } - return (map); + return map; } static int parse_set (BUFFER * tmp, BUFFER * s, unsigned long data, @@ -1019,25 +1019,25 @@ static int parse_set (BUFFER * tmp, BUFFER * s, unsigned long data, option = hash_find(ConfigOptions, tmp->data); if (!option && !(reset && m_strcmp("all", tmp->data) == 0)) { snprintf (err->data, err->dsize, _("%s: unknown variable"), tmp->data); - return (-1); + return -1; } s->dptr = vskipspaces(s->dptr); if (reset) { if (query || unset || inv) { snprintf (err->data, err->dsize, _("prefix is illegal with reset")); - return (-1); + return -1; } if (s && *s->dptr == '=') { snprintf (err->data, err->dsize, _("value is illegal with reset")); - return (-1); + return -1; } if (!m_strcmp("all", tmp->data)) { if (CurrentMenu == MENU_PAGER) { snprintf (err->data, err->dsize, _("Not available in this menu.")); - return (-1); + return -1; } hash_map (ConfigOptions, mutt_restore_default, 1); set_option (OPTFORCEREDRAWINDEX); @@ -1046,7 +1046,7 @@ static int parse_set (BUFFER * tmp, BUFFER * s, unsigned long data, set_option (OPTNEEDRESORT); set_option (OPTRESORTINIT); set_option (OPTREDRAWTREE); - return (0); + return 0; } else { mutt_restore_default (NULL, option, 1); } @@ -1057,7 +1057,7 @@ static int parse_set (BUFFER * tmp, BUFFER * s, unsigned long data, if (s && *s->dptr == '=') { if (unset || inv || query) { snprintf (err->data, err->dsize, "Usage: set variable=yes|no"); - return (-1); + return -1; } s->dptr++; @@ -1068,7 +1068,7 @@ static int parse_set (BUFFER * tmp, BUFFER * s, unsigned long data, unset = 1; else { snprintf (err->data, err->dsize, "Usage: set variable=yes|no"); - return (-1); + return -1; } } @@ -1158,7 +1158,7 @@ static int parse_set (BUFFER * tmp, BUFFER * s, unsigned long data, set_option (OPTRESORTINIT); set_option (OPTREDRAWTREE); } - return (r); + return r; } #define MAXERRS 128 @@ -1177,7 +1177,7 @@ static int source_rc (const char *rcfile, BUFFER * err) if ((f = mutt_open_read (rcfile, &pid)) == NULL) { snprintf (err->data, err->dsize, "%s: %s", rcfile, strerror (errno)); - return (-1); + return -1; } p_clear(&token, 1); @@ -1223,7 +1223,7 @@ static int source_rc (const char *rcfile, BUFFER * err) rcfile); rc = -1; } - return (rc); + return rc; } #undef MAXERRS @@ -1238,7 +1238,7 @@ static int parse_source (BUFFER * tmp, BUFFER * s, do { if (mutt_extract_token (tmp, s, 0) != 0) { snprintf (err->data, err->dsize, _("source: error at %s"), s->dptr); - return (-1); + return -1; } m_strcpy(path, sizeof(path), tmp->data); @@ -1248,7 +1248,7 @@ static int parse_source (BUFFER * tmp, BUFFER * s, } while (MoreArgs (s)); - return ((rc < 0) ? -1 : 0); + return (rc < 0) ? -1 : 0; } /* line command to execute @@ -1298,7 +1298,7 @@ int mutt_parse_rc_line (const char *line, BUFFER * token, BUFFER * err) finish: if (expn.destroy) p_delete(&expn.data); - return (r); + return r; } @@ -1579,7 +1579,7 @@ static int mutt_execute_commands (string_list_t * p) if (mutt_parse_rc_line (p->data, &token, &err) != 0) { fprintf (stderr, _("Error in command line: %s\n"), err.data); p_delete(&token.data); - return (-1); + return -1; } } p_delete(&token.data); diff --git a/keymap.c b/keymap.c index 87b2b28..580c2a4 100644 --- a/keymap.c +++ b/keymap.c @@ -146,7 +146,7 @@ static int parsekeys (const char *str, keycode_t * d, int max) len--; } - return (max - len); + return max - len; } /* insert a key sequence into the specified map. the map is sorted by ASCII @@ -301,7 +301,7 @@ static int retry_generic (int menu, keycode_t * keys, int keyslen, mutt_ungetch (lastkey, 0); for (; keyslen; keyslen--) mutt_ungetch (keys[keyslen - 1], 0); - return (km_dokey (MENU_GENERIC)); + return km_dokey (MENU_GENERIC); } if (menu != MENU_EDITOR) { /* probably a good idea to flush input here so we can abort macros */ @@ -325,7 +325,7 @@ int km_dokey (int menu) if (!map) - return (retry_generic (menu, NULL, 0, 0)); + return retry_generic (menu, NULL, 0, 0); for (;;) { /* ncurses doesn't return on resized screen when timeout is set to zero */ @@ -385,12 +385,12 @@ int km_dokey (int menu) /* Nope. Business as usual */ while (LastKey > map->keys[pos]) { if (pos > map->eq || !map->next) - return (retry_generic (menu, map->keys, pos, LastKey)); + return retry_generic (menu, map->keys, pos, LastKey); map = map->next; } if (LastKey != map->keys[pos]) - return (retry_generic (menu, map->keys, pos, LastKey)); + return retry_generic (menu, map->keys, pos, LastKey); if (++pos == map->len) { @@ -448,7 +448,7 @@ const char *km_keyname(int c) snprintf (buf, sizeof (buf), "%c", (unsigned char) c); else snprintf (buf, sizeof (buf), "\\x%hx", (unsigned short) c); - return (buf); + return buf; } int km_expand_key (char *s, size_t len, struct keymap_t *map) @@ -457,14 +457,14 @@ int km_expand_key (char *s, size_t len, struct keymap_t *map) int p = 0; if (!map) - return (0); + return 0; for (;;) { m_strcpy(s, len, km_keyname(map->keys[p])); len -= (l = m_strlen(s)); if (++p >= map->len || !len) - return (1); + return 1; s += l; } @@ -479,7 +479,7 @@ struct keymap_t *km_find_func (int menu, int func) for (; map; map = map->next) if (map->op == func) break; - return (map); + return map; } void km_init (void) @@ -618,7 +618,7 @@ int mutt_parse_push (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ } else push_string (buf->data); - return (r); + return r; } /* expects to see: ,,... */ @@ -658,14 +658,14 @@ static char *parse_keymap (int *menu, BUFFER * s, int maxmenus, int *nummenus, m_strcpy(err->data, err->dsize, _("null key sequence")); } else if (MoreArgs (s)) - return (buf.data); + return buf.data; } else { m_strcpy(err->data, err->dsize, _("too few arguments")); } error: p_delete(&buf.data); - return (NULL); + return NULL; } static int @@ -676,9 +676,9 @@ try_bind (char *key, int menu, char *func, struct binding_t *bindings) for (i = 0; bindings[i].name; i++) if (m_strcmp(func, bindings[i].name) == 0) { km_bindkey (key, menu, bindings[i].op); - return (0); + return 0; } - return (-1); + return -1; } struct binding_t *km_get_table (int menu) @@ -754,7 +754,7 @@ int mutt_parse_bind (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ } } p_delete(&key); - return (r); + return r; } /* macro */ @@ -769,7 +769,7 @@ int mutt_parse_macro (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ if ((key = parse_keymap (menu, s, sizeof (menu) / sizeof (menu[0]), &nummenus, err)) == NULL) - return (-1); + return -1; mutt_extract_token (buf, s, M_TOKEN_CONDENSE); /* make sure the macro sequence is not an empty string */ @@ -801,7 +801,7 @@ int mutt_parse_macro (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ } } p_delete(&key); - return (r); + return r; } /* exec function-name */ @@ -815,7 +815,7 @@ int mutt_parse_exec (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ if (!MoreArgs (s)) { m_strcpy(err->data, err->dsize, _("exec: no arguments")); - return (-1); + return -1; } do { @@ -833,7 +833,7 @@ int mutt_parse_exec (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ if (ops[nops] == OP_NULL) { mutt_flushinp (); mutt_error (_("%s: no such function"), function); - return (-1); + return -1; } nops++; } diff --git a/lib-lib/file.c b/lib-lib/file.c index 4cd3b83..ed74aad 100644 --- a/lib-lib/file.c +++ b/lib-lib/file.c @@ -70,7 +70,7 @@ int safe_open(const char *path, int flags) return -1; } - return (fd); + return fd; } @@ -226,7 +226,7 @@ FILE *safe_fopen(const char *path, const char *mode) flags |= (mode[1] == '+' ? O_RDWR : O_WRONLY); if ((fd = safe_open(path, flags)) < 0) - return (NULL); + return NULL; return fdopen (fd, mode); } diff --git a/lib-lib/hash.c b/lib-lib/hash.c index 569ed30..c703def 100644 --- a/lib-lib/hash.c +++ b/lib-lib/hash.c @@ -117,7 +117,7 @@ int hash_insert(hash_t *table, const char *key, void *data) if (r == 0) { p_delete(&ptr); - return (-1); + return -1; } if (r > 0) break; @@ -136,7 +136,7 @@ void *hash_find(const hash_t *table, const char *key) for (ptr = table->table[hash]; ptr; ptr = ptr->next) { if (m_strcmp(key, ptr->key) == 0) - return (ptr->data); + return ptr->data; } return NULL; } diff --git a/lib-lib/mapping.c b/lib-lib/mapping.c index f446ffd..4c1e7f0 100644 --- a/lib-lib/mapping.c +++ b/lib-lib/mapping.c @@ -37,7 +37,7 @@ const char *mutt_getnamebyvalue(int val, const struct mapping_t *map) for (i = 0; map[i].name; i++) if (map[i].value == val) - return (map[i].name); + return map[i].name; return NULL; } @@ -48,7 +48,7 @@ int mutt_getvaluebyname(const char *name, const struct mapping_t *map) for (i = 0; map[i].name; i++) if (ascii_strcasecmp (map[i].name, name) == 0) - return (map[i].value); + return map[i].value; return -1; } diff --git a/lib-mime/crypt.c b/lib-mime/crypt.c index af64a2c..c17793c 100644 --- a/lib-mime/crypt.c +++ b/lib-mime/crypt.c @@ -192,10 +192,10 @@ int mutt_is_application_smime (BODY * m) case 'm': case 'M': /* Not sure if this is the correct thing to do, but it's required for compatibility with Outlook */ - return (SMIMESIGN | SMIMEOPAQUE); + return SMIMESIGN | SMIMEOPAQUE; case 's': case 'S': - return (SMIMESIGN | SMIMEOPAQUE); + return SMIMESIGN | SMIMEOPAQUE; } } } diff --git a/lib-mime/rfc3676.c b/lib-mime/rfc3676.c index 3caa76f..bc47b85 100644 --- a/lib-mime/rfc3676.c +++ b/lib-mime/rfc3676.c @@ -196,7 +196,7 @@ int rfc3676_handler (BODY * a, STATE * s) { } p_delete(&curline); - return (0); + return 0; } /* sets mtime of 'to' to mtime of 'from' */ diff --git a/lib-mime/rfc822parse.c b/lib-mime/rfc822parse.c index a1b4d54..49e806d 100644 --- a/lib-mime/rfc822parse.c +++ b/lib-mime/rfc822parse.c @@ -419,7 +419,7 @@ BODY *mutt_read_mime_header(FILE *fp, int digest) } p_delete(&line); - return (body); + return body; } void mutt_parse_part(FILE *fp, BODY *b) @@ -578,7 +578,7 @@ mutt_parse_multipart(FILE *fp, const char *bound, off_t end_off, int digest) mutt_parse_part(fp, b); } - return (head); + return head; } /* parses a date string in RFC822 format: diff --git a/lib-mx/compress.c b/lib-mx/compress.c index 2b18cbb..65093c5 100644 --- a/lib-mx/compress.c +++ b/lib-mx/compress.c @@ -59,7 +59,7 @@ static void mbox_unlock_compressed (CONTEXT * ctx, FILE * fp) static int is_new (const char *path) { - return (access (path, W_OK) && errno == ENOENT); + return access (path, W_OK) && errno == ENOENT; } static const char *find_compress_hook (int type, const char *path) @@ -102,7 +102,7 @@ int mutt_can_append_compressed (const char *path) int magic; if (is_new (path)) - return (find_compress_hook (M_CLOSEHOOK, path) ? 1 : 0); + return find_compress_hook (M_CLOSEHOOK, path) ? 1 : 0; magic = mx_get_magic (path); diff --git a/lib-mx/hcache.c b/lib-mx/hcache.c index a82921b..01db5bd 100644 --- a/lib-mx/hcache.c +++ b/lib-mx/hcache.c @@ -476,7 +476,7 @@ void mutt_hcache_delete(hcache_t *db, const char *filename, char path[_POSIX_PATH_MAX]; if (!db) - return -1; + return; snprintf(path, sizeof(path), "%s%s", db->folder, filename); diff --git a/lib-mx/mbox.c b/lib-mx/mbox.c index 9fd7a40..22f1172 100644 --- a/lib-mx/mbox.c +++ b/lib-mx/mbox.c @@ -57,7 +57,7 @@ int mbox_lock_mailbox(CONTEXT *ctx, int excl, int retry) return 0; } - return (r); + return r; } static void mbox_unlock_mailbox (CONTEXT * ctx) @@ -88,7 +88,7 @@ static int mbox_parse_mailbox (CONTEXT * ctx) /* Save information about the folder at the time we opened it. */ if (stat (ctx->path, &sb) == -1) { mutt_perror (ctx->path); - return (-1); + return -1; } ctx->size = sb.st_size; @@ -219,7 +219,7 @@ static int mbox_parse_mailbox (CONTEXT * ctx) mx_update_context (ctx, count); } - return (0); + return 0; } #undef PREV @@ -265,12 +265,12 @@ static int _mbox_check_mailbox (CONTEXT * ctx, int *index_hint) if (stat (ctx->path, &st) == 0) { if (st.st_mtime == ctx->mtime && st.st_size == ctx->size) - return (0); + return 0; if (st.st_size == ctx->size) { /* the file was touched, but it is still the same length, so just exit */ ctx->mtime = st.st_mtime; - return (0); + return 0; } if (st.st_size > ctx->size) { @@ -283,7 +283,7 @@ static int _mbox_check_mailbox (CONTEXT * ctx, int *index_hint) * probably the new mail arrived: no reason to wait till we can * parse it: we'll get it on the next pass */ - return (M_LOCKED); + return M_LOCKED; } unlock = 1; } @@ -310,7 +310,7 @@ static int _mbox_check_mailbox (CONTEXT * ctx, int *index_hint) mutt_unblock_signals (); } - return (M_NEW_MAIL); /* signal that new mail arrived */ + return M_NEW_MAIL; /* signal that new mail arrived */ } else modified = 1; @@ -328,7 +328,7 @@ static int _mbox_check_mailbox (CONTEXT * ctx, int *index_hint) mbox_unlock_mailbox (ctx); mutt_unblock_signals (); } - return (M_REOPENED); + return M_REOPENED; } } @@ -339,7 +339,7 @@ static int _mbox_check_mailbox (CONTEXT * ctx, int *index_hint) mutt_unblock_signals (); mutt_error _("Mailbox was corrupted!"); - return (-1); + return -1; } static int mbox_check_mailbox(CONTEXT *ctx, int *index_hint, int lock) @@ -398,7 +398,7 @@ static int mbox_sync_mailbox (CONTEXT * ctx, int unused __attribute__ ((unused)) mx_fastclose_mailbox (ctx); mutt_error _("Fatal error! Could not reopen mailbox!"); - return (-1); + return -1; } mutt_block_signals (); @@ -420,7 +420,7 @@ static int mbox_sync_mailbox (CONTEXT * ctx, int unused __attribute__ ((unused)) } else if (i < 0) /* fatal error */ - return (-1); + return -1; /* Create a temporary file to write the new version of the mailbox in. */ fp = m_tempfile(tempfile, _POSIX_PATH_MAX, NONULL(mod_core.tmpdir), NULL); @@ -528,7 +528,7 @@ static int mbox_sync_mailbox (CONTEXT * ctx, int unused __attribute__ ((unused)) mx_fastclose_mailbox (ctx); mutt_perror (_("Can't create temporary file")); mutt_sleep (5); - return (-1); + return -1; } if (fseeko (ctx->fp, offset, SEEK_SET) != 0 /* seek the append location */ @@ -576,7 +576,7 @@ static int mbox_sync_mailbox (CONTEXT * ctx, int unused __attribute__ ((unused)) mutt_pretty_mailbox (savefile); mutt_error (_("Write failed! Saved partial mailbox to %s"), savefile); mutt_sleep (5); - return (-1); + return -1; } /* Restore the previous access/modification times */ @@ -590,7 +590,7 @@ static int mbox_sync_mailbox (CONTEXT * ctx, int unused __attribute__ ((unused)) mutt_unblock_signals (); mx_fastclose_mailbox (ctx); mutt_error _("Fatal error! Could not reopen mailbox!"); - return (-1); + return -1; } /* update the offsets of the rewritten messages */ @@ -607,7 +607,7 @@ static int mbox_sync_mailbox (CONTEXT * ctx, int unused __attribute__ ((unused)) unlink (tempfile); /* remove partial copy of the mailbox */ mutt_unblock_signals (); - return (0); /* signal success */ + return 0; /* signal success */ bail: /* Come here in case of disaster */ @@ -635,7 +635,7 @@ bail: /* Come here in case of disaster */ mutt_error _("Could not reopen mailbox!"); mx_fastclose_mailbox (ctx); - return (-1); + return -1; } if (need_sort) @@ -732,7 +732,7 @@ static int mbox_reopen_mailbox (CONTEXT * ctx, int *index_hint) p_delete(&old_hdrs); ctx->quiet = 0; - return (-1); + return -1; } /* now try to recover the old flags */ @@ -802,7 +802,7 @@ static int mbox_reopen_mailbox (CONTEXT * ctx, int *index_hint) ctx->quiet = 0; - return ((ctx->changed || msg_mod) ? M_REOPENED : M_NEW_MAIL); + return (ctx->changed || msg_mod) ? M_REOPENED : M_NEW_MAIL; } /* @@ -818,7 +818,7 @@ int mbox_check_empty (const char *path) if (stat (path, &st) == -1) return -1; - return ((st.st_size == 0)); + return st.st_size == 0; } int mbox_is_magic (const char* path, struct stat* st) @@ -828,7 +828,7 @@ int mbox_is_magic (const char* path, struct stat* st) char tmp[_POSIX_PATH_MAX]; if (S_ISDIR(st->st_mode)) - return (-1); + return -1; if (st->st_size == 0) { return M_MBOX; @@ -850,12 +850,12 @@ int mbox_is_magic (const char* path, struct stat* st) utime (path, ×); } else { mutt_perror (path); - return (-1); /* fopen failed */ + return -1; /* fopen failed */ } if (magic == -1 && mutt_can_read_compressed (path)) - return (M_COMPRESSED); - return (magic); + return M_COMPRESSED; + return magic; } static int mbox_commit_message (MESSAGE* msg, CONTEXT* ctx) { diff --git a/lib-mx/mh.c b/lib-mx/mh.c index dacef77..23d21fe 100644 --- a/lib-mx/mh.c +++ b/lib-mx/mh.c @@ -181,7 +181,7 @@ static int mh_mkstemp (CONTEXT * dest, FILE ** fp, char **tgt) p_delete(tgt); close (fd); unlink (path); - return (-1); + return -1; } return 0; @@ -803,7 +803,7 @@ static int _mh_read_dir (CONTEXT * ctx, const char *subdir) } static int mh_read_dir (CONTEXT* ctx) { - return (_mh_read_dir (ctx, NULL)); + return _mh_read_dir (ctx, NULL); } /* read a maildir style mailbox */ @@ -813,7 +813,7 @@ static int maildir_read_dir (CONTEXT * ctx) * of the main folder path from which to read messages */ if (_mh_read_dir (ctx, "new") == -1 || _mh_read_dir (ctx, "cur") == -1) - return (-1); + return -1; return 0; } @@ -916,7 +916,7 @@ static int maildir_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr p_delete(&msg->path); close (fd); unlink (path); - return (-1); + return -1; } return 0; @@ -1027,7 +1027,7 @@ static int _mh_commit_message (MESSAGE * msg, CONTEXT * ctx, HEADER * hdr, if ((dirp = opendir (ctx->path)) == NULL) { mutt_perror (ctx->path); - return (-1); + return -1; } /* figure out what the next message number is */ @@ -1177,7 +1177,7 @@ static int maildir_sync_message (CONTEXT * ctx, int msgno) (h->env && (h->env->refs_changed || h->env->irt_changed))) { /* when doing attachment deletion/rethreading, fall back to the MH case. */ if (mh_rewrite_message (ctx, msgno) != 0) - return (-1); + return -1; } else { /* we just have to rename the file. */ @@ -1190,7 +1190,7 @@ static int maildir_sync_message (CONTEXT * ctx, int msgno) char *p; if ((p = strrchr (h->path, '/')) == NULL) { - return (-1); + return -1; } p++; m_strcpy(newpath, sizeof(newpath), p); @@ -1216,11 +1216,11 @@ static int maildir_sync_message (CONTEXT * ctx, int msgno) if (rename (oldpath, fullpath) != 0) { mutt_perror ("rename"); - return (-1); + return -1; } m_strreplace(&h->path, partpath); } - return (0); + return 0; } static int mh_sync_mailbox (CONTEXT * ctx, int unused __attribute__ ((unused)), int *index_hint) diff --git a/lib-mx/mx.c b/lib-mx/mx.c index 493b421..609b047 100644 --- a/lib-mx/mx.c +++ b/lib-mx/mx.c @@ -77,7 +77,7 @@ static int mx_get_idx (const char* path) { if (!mxfmts[i]->local) t = mxfmts[i]->mx_is_magic(path, NULL); if (t >= 1) - return (t-1); + return t-1; } if (stat (path, &st) == 0) { /* if stat() succeeded, keep testing until success and @@ -86,7 +86,7 @@ static int mx_get_idx (const char* path) { if (mxfmts[i]->local) t = mxfmts[i]->mx_is_magic(path, &st); if (t >= 1) - return (t-1); + return t-1; } } return -1; @@ -147,14 +147,14 @@ int mx_get_magic (const char *path) { if (m_strlen(path) == 0) return -1; if ((i = mx_get_idx (path)) >= 0) - return (mxfmts[i]->type); + return mxfmts[i]->type; return -1; } int mx_is_local (int m) { if (!MX_IDX(m)) - return (0); - return (mxfmts[m]->local); + return 0; + return mxfmts[m]->local; } /* mx_access: Wrapper for access, checks permissions on a given mailbox. @@ -165,8 +165,8 @@ int mx_access (const char *path, int flags) int i = 0; if ((i = mx_get_idx (path)) >= 0 && mxfmts[i]->mx_access) - return (mxfmts[i]->mx_access(path,flags)); - return (0); + return mxfmts[i]->mx_access(path,flags); + return 0; } static int mx_open_mailbox_append (CONTEXT * ctx, int flags) @@ -308,7 +308,7 @@ CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT * pctx) mx_fastclose_mailbox (ctx); if (!pctx) p_delete(&ctx); - return (NULL); + return NULL; } /* if the user has a `push' command in their .muttrc, or in a folder-hook, @@ -341,7 +341,7 @@ CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT * pctx) } unset_option (OPTFORCEREFRESH); - return (ctx); + return ctx; } /* free up memory associated with the mailbox context */ @@ -617,10 +617,10 @@ static int _mx_close_mailbox (CONTEXT * ctx, int *index_hint) int mx_close_mailbox (CONTEXT * ctx, int *index_hint) { int ret = 0; if (!ctx) - return (0); + return 0; ret = _mx_close_mailbox (ctx, index_hint); sidebar_set_buffystats (ctx); - return (ret); + return ret; } /* update a Context structure's internal tables. */ @@ -736,7 +736,7 @@ static int _mx_sync_mailbox (CONTEXT * ctx, int *index_hint) if (!ctx->changed && !ctx->deleted) { mutt_message _("Mailbox is unchanged."); - return (0); + return 0; } if (ctx->deleted) { @@ -801,13 +801,13 @@ static int _mx_sync_mailbox (CONTEXT * ctx, int *index_hint) } } - return (rc); + return rc; } int mx_sync_mailbox (CONTEXT* ctx, int* index_hint) { int ret = _mx_sync_mailbox (ctx, index_hint); sidebar_set_buffystats (ctx); - return (ret); + return ret; } /* args: @@ -821,7 +821,7 @@ MESSAGE *mx_open_new_message (CONTEXT * dest, HEADER * hdr, int flags) address_t *p = NULL; if (!MX_IDX(dest->magic-1)) { - return (NULL); + return NULL; } msg = p_new(MESSAGE, 1); @@ -868,7 +868,7 @@ int mx_check_mailbox (CONTEXT * ctx, int *index_hint, int lock) { if (ctx->locked) lock = 0; if (MX_IDX(ctx->magic-1) && mxfmts[ctx->magic-1]->mx_check_mailbox) - return (mxfmts[ctx->magic-1]->mx_check_mailbox(ctx, index_hint, lock)); + return mxfmts[ctx->magic-1]->mx_check_mailbox(ctx, index_hint, lock); } return -1; @@ -922,7 +922,7 @@ MESSAGE *mx_open_message (CONTEXT * ctx, int msgno) p_delete(&msg); break; } - return (msg); + return msg; } /* commit a message to a folder */ @@ -933,7 +933,7 @@ int mx_commit_message (MESSAGE * msg, CONTEXT * ctx) { } if (!ctx || !MX_IDX(ctx->magic-1) || !mxfmts[ctx->magic-1]->mx_commit_message) return -1; - return (mxfmts[ctx->magic-1]->mx_commit_message (msg, ctx)); + return mxfmts[ctx->magic-1]->mx_commit_message (msg, ctx); } /* close a pointer to a message */ @@ -955,7 +955,7 @@ int mx_close_message (MESSAGE ** msg) } p_delete(msg); - return (r); + return r; } void mx_alloc_memory (CONTEXT * ctx) @@ -1043,7 +1043,7 @@ int mx_check_empty (const char *path) { int i = 0; if ((i = mx_get_idx (path)) >= 0 && mxfmts[i]->mx_check_empty) - return (mxfmts[i]->mx_check_empty(path)); + return mxfmts[i]->mx_check_empty(path); errno = EINVAL; return -1; } diff --git a/lib-sys/filter.c b/lib-sys/filter.c index 78e08fb..f2d6086 100644 --- a/lib-sys/filter.c +++ b/lib-sys/filter.c @@ -25,7 +25,7 @@ mutt_create_filter_fd (const char *cmd, FILE ** in, FILE ** out, FILE ** err, if (in) { *in = 0; if (pipe (pin) == -1) - return (-1); + return -1; } if (out) { @@ -35,7 +35,7 @@ mutt_create_filter_fd (const char *cmd, FILE ** in, FILE ** out, FILE ** err, close (pin[0]); close (pin[1]); } - return (-1); + return -1; } } @@ -50,7 +50,7 @@ mutt_create_filter_fd (const char *cmd, FILE ** in, FILE ** out, FILE ** err, close (pout[0]); close (pout[1]); } - return (-1); + return -1; } } @@ -110,7 +110,7 @@ mutt_create_filter_fd (const char *cmd, FILE ** in, FILE ** out, FILE ** err, close (perr[1]); } - return (-1); + return -1; } if (out) { @@ -128,12 +128,12 @@ mutt_create_filter_fd (const char *cmd, FILE ** in, FILE ** out, FILE ** err, *err = fdopen (perr[0], "r"); } - return (thepid); + return thepid; } pid_t mutt_create_filter (const char *s, FILE ** in, FILE ** out, FILE ** err) { - return (mutt_create_filter_fd (s, in, out, err, -1, -1, -1)); + return mutt_create_filter_fd (s, in, out, err, -1, -1, -1); } int mutt_wait_filter (pid_t pid) @@ -171,6 +171,6 @@ FILE *mutt_open_read (const char *path, pid_t * thepid) *thepid = -1; } - return (f); + return f; } diff --git a/lib-sys/mutt_ssl.cpkg b/lib-sys/mutt_ssl.cpkg index a86eab1..4dddccd 100644 --- a/lib-sys/mutt_ssl.cpkg +++ b/lib-sys/mutt_ssl.cpkg @@ -440,7 +440,7 @@ static char *tls_make_date (time_t t, char *s, ssize_t len) m_strcpy(s, len, _("[invalid date]")); } - return (s); + return s; } static int tls_check_stored_hostname (const gnutls_datum * cert, @@ -835,7 +835,7 @@ static int tls_check_certificate (CONNECTION * conn) unset_option (OPTUNBUFFEREDINPUT); mutt_menuDestroy (&menu); gnutls_x509_crt_deinit (cert); - return (done == 2); + return done == 2; } /* vim:set ft=c: */ diff --git a/lib-ui/browser.c b/lib-ui/browser.c index 466cf77..dc8bb59 100644 --- a/lib-ui/browser.c +++ b/lib-ui/browser.c @@ -53,7 +53,7 @@ static int browser_compare_subject (const void *a, const void *b) int r = strcoll(NONULL(pa->name), NONULL(pb->name)); - return ((BrowserSort & SORT_REVERSE) ? -r : r); + return (BrowserSort & SORT_REVERSE) ? -r : r; } static int browser_compare_date (const void *a, const void *b) @@ -63,7 +63,7 @@ static int browser_compare_date (const void *a, const void *b) int r = pa->mtime - pb->mtime; - return ((BrowserSort & SORT_REVERSE) ? -r : r); + return (BrowserSort & SORT_REVERSE) ? -r : r; } static int browser_compare_size (const void *a, const void *b) @@ -73,7 +73,7 @@ static int browser_compare_size (const void *a, const void *b) int r = pa->size - pb->size; - return ((BrowserSort & SORT_REVERSE) ? -r : r); + return (BrowserSort & SORT_REVERSE) ? -r : r; } static void browser_sort (struct browser_state *state) @@ -105,7 +105,7 @@ static int link_is_dir (const char *folder, const char *path) mutt_concat_path(fullpath, sizeof(fullpath), folder, path); if (stat (fullpath, &st) == 0) - return (S_ISDIR (st.st_mode)); + return S_ISDIR (st.st_mode); else return 0; } @@ -330,19 +330,19 @@ static int examine_directory (MUTTMENU * menu, struct browser_state *state, } } mutt_perror (d); - return (-1); + return -1; } if (!S_ISDIR (s.st_mode)) { mutt_error (_("%s is not a directory."), d); - return (-1); + return -1; } buffy_check (0); if ((dp = opendir (d)) == NULL) { mutt_perror (d); - return (-1); + return -1; } init_state (state, menu); @@ -382,7 +382,7 @@ static int examine_mailboxes (MUTTMENU * menu, struct browser_state *state) BUFFY* tmp; if (!Incoming.len) - return (-1); + return -1; buffy_check (0); init_state (state, menu); diff --git a/lib-ui/color.c b/lib-ui/color.c index 96b0cc2..7aa0d16 100644 --- a/lib-ui/color.c +++ b/lib-ui/color.c @@ -71,7 +71,7 @@ static COLOR_LINE *mutt_new_color_line (void) p->fg = p->bg = -1; - return (p); + return p; } static void mutt_free_color_line(COLOR_LINE ** l) @@ -117,7 +117,7 @@ parse_color_name (const char *s, int *col, int *attr, int brite, BUFFER * err) if ((*col = mutt_getvaluebyname (s, Colors)) == -1) { snprintf (err->data, err->dsize, _("%s: no such color"), s); - return (-1); + return -1; } return 0; @@ -134,18 +134,18 @@ int mutt_parse_uncolor(BUFFER *buf, BUFFER *s, unsigned long data, BUFFER if ((object = mutt_getvaluebyname (buf->data, Fields)) == -1) { snprintf (err->data, err->dsize, _("%s: no such object"), buf->data); - return (-1); + return -1; } if (m_strncmp(buf->data, "index", 5) != 0) { snprintf (err->data, err->dsize, _("%s: command valid only for index object"), "uncolor"); - return (-1); + return -1; } if (!MoreArgs (s)) { snprintf (err->data, err->dsize, _("%s: too few arguments"), "uncolor"); - return (-1); + return -1; } if (option(OPTNOCURSES)) { @@ -195,7 +195,7 @@ int mutt_parse_uncolor(BUFFER *buf, BUFFER *s, unsigned long data, BUFFER for (i = 0; Context && i < Context->msgcount; i++) Context->hdrs[i]->pair = 0; } - return (0); + return 0; } @@ -258,7 +258,7 @@ add_pattern (COLOR_LINE ** top, const char *s, int sensitive, (sensitive ? mutt_which_case (s) : REG_ICASE))) != 0) { regerror (r, &tmp->rx, err->data, err->dsize); mutt_free_color_line(&tmp); - return (-1); + return -1; } tmp->next = *top; tmp->pattern = m_strdup(s); @@ -301,7 +301,7 @@ parse_object (BUFFER * buf, BUFFER * s, int *o, int *ql, BUFFER * err) } else if ((*o = mutt_getvaluebyname (buf->data, Fields)) == -1) { snprintf (err->data, err->dsize, _("%s: no such object"), buf->data); - return (-1); + return -1; } return 0; @@ -313,23 +313,23 @@ parse_color_pair (BUFFER * buf, BUFFER * s, int *fg, int *bg, int *attr, { if (!MoreArgs (s)) { m_strcpy(err->data, err->dsize, _("color: too few arguments")); - return (-1); + return -1; } mutt_extract_token (buf, s, 0); if (parse_color_name (buf->data, fg, attr, A_BOLD, err) != 0) - return (-1); + return -1; if (!MoreArgs (s)) { m_strcpy(err->data, err->dsize, _("color: too few arguments")); - return (-1); + return -1; } mutt_extract_token (buf, s, 0); if (parse_color_name (buf->data, bg, attr, A_BLINK, err) != 0) - return (-1); + return -1; return 0; } @@ -347,7 +347,7 @@ parse_attr_spec (BUFFER * buf, BUFFER * s, int *fg, int *bg, int *attr, if (!MoreArgs (s)) { m_strcpy(err->data, err->dsize, _("mono: too few arguments")); - return (-1); + return -1; } mutt_extract_token (buf, s, 0); @@ -366,7 +366,7 @@ parse_attr_spec (BUFFER * buf, BUFFER * s, int *fg, int *bg, int *attr, *attr = A_NORMAL; /* needs use = instead of |= to clear other bits */ else { snprintf (err->data, err->dsize, _("%s: no such attribute"), buf->data); - return (-1); + return -1; } return 0; @@ -399,7 +399,7 @@ int mutt_parse_color(BUFFER *buf, BUFFER *s, unsigned long i, BUFFER *err) || object == MT_COLOR_INDEX) { if (!MoreArgs (s)) { m_strcpy(err->data, err->dsize, _("too few arguments")); - return (-1); + return -1; } mutt_extract_token (buf, s, 0); @@ -407,7 +407,7 @@ int mutt_parse_color(BUFFER *buf, BUFFER *s, unsigned long i, BUFFER *err) if (MoreArgs (s)) { m_strcpy(err->data, err->dsize, _("too many arguments")); - return (-1); + return -1; } if (option(OPTNOCURSES)) @@ -418,7 +418,7 @@ int mutt_parse_color(BUFFER *buf, BUFFER *s, unsigned long i, BUFFER *err) && use_default_colors () != OK) { m_strcpy(err->data, err->dsize, _("default colors not supported")); - return (-1); + return -1; } if (object == MT_COLOR_HEADER) @@ -455,5 +455,5 @@ int mutt_parse_color(BUFFER *buf, BUFFER *s, unsigned long i, BUFFER *err) if (object == MT_COLOR_NORMAL) BKGDSET(main_w, MT_COLOR_NORMAL); - return (r); + return r; } diff --git a/lib-ui/complete.c b/lib-ui/complete.c index aa51e5b..f8a660a 100644 --- a/lib-ui/complete.c +++ b/lib-ui/complete.c @@ -92,7 +92,7 @@ int mutt_complete (char *s, ssize_t slen) } if (dirp == NULL) { - return (-1); + return -1; } /* @@ -154,5 +154,5 @@ int mutt_complete (char *s, ssize_t slen) else m_strcpy(s, slen, filepart); - return (init ? 0 : -1); + return init ? 0 : -1; } diff --git a/lib-ui/curs_lib.c b/lib-ui/curs_lib.c index cfdba38..5e16f4d 100644 --- a/lib-ui/curs_lib.c +++ b/lib-ui/curs_lib.c @@ -42,7 +42,7 @@ event_t mutt_getch (void) event_t err = { -1, OP_NULL }, ret; if (!option (OPTUNBUFFEREDINPUT) && UngetCount) - return (KeyEvent[--UngetCount]); + return KeyEvent[--UngetCount]; SigInt = 0; @@ -58,7 +58,7 @@ event_t mutt_getch (void) ret.ch = ch; ret.op = 0; - return (ch == ctrl ('G') ? err : ret); + return ch == ctrl ('G') ? err : ret; } int mutt_get_field_unbuffered (char *msg, char *buf, ssize_t buflen, int flags) @@ -69,7 +69,7 @@ int mutt_get_field_unbuffered (char *msg, char *buf, ssize_t buflen, int flags) rc = mutt_get_field (msg, buf, buflen, flags); unset_option (OPTUNBUFFEREDINPUT); - return (rc); + return rc; } void mutt_clear_error (void) @@ -230,7 +230,7 @@ int mutt_yesorno (const char *msg, int def) mutt_refresh (); } CLEARLINE(stdscr, LINES - 1); - return (def); + return def; } /* this function is called when the user presses the abort key */ @@ -378,7 +378,7 @@ int mutt_any_key_to_continue (const char *s) close (f); fputs ("\r\n", stdout); mutt_clear_error (); - return (ch); + return ch; } int _mutt_enter_fname (const char *prompt, char *buf, ssize_t blen, @@ -397,7 +397,7 @@ int _mutt_enter_fname (const char *prompt, char *buf, ssize_t blen, ch = mutt_getch (); if (ch.ch == -1) { CLEARLINE(stdscr, LINES - 1); - return (-1); + return -1; } else if (ch.ch == '?') { mutt_refresh (); diff --git a/lib-ui/curs_main.c b/lib-ui/curs_main.c index 4a8a2be..6a40a00 100644 --- a/lib-ui/curs_main.c +++ b/lib-ui/curs_main.c @@ -156,8 +156,8 @@ static int ci_next_undeleted (int msgno) for (i = msgno + 1; i < Context->vcount; i++) if (!Context->hdrs[Context->v2r[i]]->deleted) - return (i); - return (-1); + return i; + return -1; } static int ci_previous_undeleted (int msgno) @@ -166,8 +166,8 @@ static int ci_previous_undeleted (int msgno) for (i = msgno - 1; i >= 0; i--) if (!Context->hdrs[Context->v2r[i]]->deleted) - return (i); - return (-1); + return i; + return -1; } /* Return the index of the first new message, or failing that, the first @@ -182,13 +182,13 @@ static int ci_first_message (void) if (!Context->hdrs[Context->v2r[i]]->read && !Context->hdrs[Context->v2r[i]]->deleted) { if (!Context->hdrs[Context->v2r[i]]->old) - return (i); + return i; else if (old == -1) old = i; } } if (old != -1) - return (old); + return old; /* If Sort is reverse and not threaded, the latest message is first. * If Sort is threaded, the latest message is first iff exactly one @@ -199,7 +199,7 @@ static int ci_first_message (void) ((Sort ^ SortAux) & SORT_REVERSE))) return 0; else - return (Context->vcount ? Context->vcount - 1 : 0); + return Context->vcount ? Context->vcount - 1 : 0; } return 0; } @@ -1976,7 +1976,7 @@ int mutt_index_menu (void) } mutt_menuDestroy (&menu); - return (closed); + return closed; } void mutt_set_header_color (CONTEXT * ctx, HEADER * curhdr) diff --git a/lib-ui/enter.c b/lib-ui/enter.c index 860f667..8fe60ed 100644 --- a/lib-ui/enter.c +++ b/lib-ui/enter.c @@ -675,7 +675,7 @@ int _mutt_get_field(const char *field, char *buf, ssize_t buflen, int flags, CLEARLINE(stdscr, LINES - 1); p_delete(&es.wbuf); - return (ret); + return ret; } /* diff --git a/lib-ui/history.c b/lib-ui/history.c index b27daed..e7bcc5e 100644 --- a/lib-ui/history.c +++ b/lib-ui/history.c @@ -82,13 +82,13 @@ const char *mutt_history_next (history_class_t hclass) struct history *h = &History[hclass]; if (!HistSize) - return (""); /* disabled */ + return ""; /* disabled */ next = h->cur + 1; if (next > HistSize - 1) next = 0; h->cur = h->hist[next] ? next : 0; - return (h->hist[h->cur] ? h->hist[h->cur] : ""); + return h->hist[h->cur] ? h->hist[h->cur] : ""; } const char *mutt_history_prev (history_class_t hclass) @@ -97,7 +97,7 @@ const char *mutt_history_prev (history_class_t hclass) struct history *h = &History[hclass]; if (!HistSize) - return (""); /* disabled */ + return ""; /* disabled */ prev = h->cur - 1; if (prev < 0) { @@ -107,5 +107,5 @@ const char *mutt_history_prev (history_class_t hclass) } if (h->hist[prev]) h->cur = prev; - return (h->hist[h->cur] ? h->hist[h->cur] : ""); + return h->hist[h->cur] ? h->hist[h->cur] : ""; } diff --git a/lib-ui/menu.c b/lib-ui/menu.c index dc53571..6917d94 100644 --- a/lib-ui/menu.c +++ b/lib-ui/menu.c @@ -492,7 +492,7 @@ static int menu_search_generic (MUTTMENU * m, regex_t * re, int n) char buf[LONG_STRING]; menu_make_entry (buf, sizeof (buf), m, n); - return (regexec (re, buf, 0, NULL, 0)); + return regexec (re, buf, 0, NULL, 0); } MUTTMENU *mutt_new_menu (void) @@ -506,7 +506,7 @@ MUTTMENU *mutt_new_menu (void) p->pagelen = LINES - 3; p->color = default_color; p->search = menu_search_generic; - return (p); + return p; } void mutt_menuDestroy (MUTTMENU ** p) @@ -540,7 +540,7 @@ static int menu_search (MUTTMENU * menu, int op) if (mutt_get_field ((op == OP_SEARCH) ? _("Search for: ") : _("Reverse search for: "), buf, sizeof (buf), M_CLEAR) != 0 || !buf[0]) - return (-1); + return -1; m_strreplace(&menu->searchBuf, buf); menu->searchDir = (op == OP_SEARCH) ? M_SEARCH_DOWN : M_SEARCH_UP; } @@ -548,7 +548,7 @@ static int menu_search (MUTTMENU * menu, int op) if (!menu->searchBuf) { mutt_error _("No search pattern."); - return (-1); + return -1; } } @@ -562,7 +562,7 @@ static int menu_search (MUTTMENU * menu, int op) regerror (r, &re, buf, sizeof (buf)); regfree (&re); mutt_error ("%s", buf); - return (-1); + return -1; } r = menu->current + searchDir; @@ -578,7 +578,7 @@ static int menu_search (MUTTMENU * menu, int op) regfree (&re); mutt_error _("Not found."); - return (-1); + return -1; } static int menu_dialog_translate_op (int i) @@ -629,7 +629,7 @@ int menu_redraw (MUTTMENU * menu) if (menu->redraw & REDRAW_FULL) { menu_redraw_full (menu); /* allow the caller to do any local configuration */ - return (OP_REDRAW); + return OP_REDRAW; } if (!menu->dialog) @@ -854,7 +854,7 @@ int mutt_menuLoop (MUTTMENU * menu) break; default: - return (i); + return i; } } /* not reached */ diff --git a/lib-ui/query.c b/lib-ui/query.c index f9bdc7a..a9415e4 100644 --- a/lib-ui/query.c +++ b/lib-ui/query.c @@ -205,12 +205,12 @@ int mutt_query_complete (char *buf, ssize_t buflen) rfc822_addrcat(buf, buflen, tmpa, 0); address_list_wipe(&tmpa); mutt_clear_error (); - return (0); + return 0; } /* multiple results, choose from query menu */ query_menu (buf, buflen, results, 1); } - return (0); + return 0; } void mutt_query_menu (char *buf, ssize_t buflen) diff --git a/lib-ui/status.c b/lib-ui/status.c index b94f551..00ccde8 100644 --- a/lib-ui/status.c +++ b/lib-ui/status.c @@ -268,7 +268,7 @@ status_format_str(char *buf, ssize_t buflen, char op, const char *src, case 0: *buf = 0; - return (src); + return src; default: *buf = 0; @@ -278,7 +278,7 @@ status_format_str(char *buf, ssize_t buflen, char op, const char *src, if (flags & M_FORMAT_OPTIONAL) menu_status_line(buf, buflen, menu, optional ? ifstr : elstr); - return (src); + return src; } void menu_status_line(char* buf, ssize_t len, MUTTMENU* menu, const char* p) diff --git a/muttlib.c b/muttlib.c index 1c23817..0d86826 100644 --- a/muttlib.c +++ b/muttlib.c @@ -249,7 +249,7 @@ int mutt_check_overwrite (const char *attname, const char *path, tmp[0] = 0; if (mutt_get_field (_("File under directory: "), tmp, sizeof (tmp), M_FILE | M_CLEAR) != 0 || !tmp[0]) - return (-1); + return -1; mutt_concat_path(fname, flen, path, tmp); } else @@ -350,7 +350,7 @@ int mutt_save_confirm (const char *s, struct stat *st) } } } - return (ret); + return ret; } void mutt_sleep (short s) @@ -364,30 +364,24 @@ static int mutt_cmp_addr (const address_t * a, const address_t * b) while (a && b) { if (m_strcmp(a->mailbox, b->mailbox) || m_strcmp(a->personal, b->personal)) - return (0); + return 0; a = a->next; b = b->next; } - if (a || b) - return (0); - - return (1); + return !(a || b); } static int mutt_cmp_list (const string_list_t * a, const string_list_t * b) { while (a && b) { if (m_strcmp(a->data, b->data)) - return (0); + return 0; a = a->next; b = b->next; } - if (a || b) - return (0); - - return (1); + return !(a || b); } static int mutt_cmp_env (const ENVELOPE * e1, const ENVELOPE * e2) @@ -402,16 +396,11 @@ static int mutt_cmp_env (const ENVELOPE * e1, const ENVELOPE * e2) !mutt_cmp_addr (e1->to, e2->to) || !mutt_cmp_addr (e1->cc, e2->cc) || !mutt_cmp_addr (e1->return_path, e2->return_path)) - return (0); + return 0; else - return (1); - } - else { - if (e1 == NULL && e2 == NULL) - return (1); - else - return (0); + return 1; } + return e1 == NULL && e2 == NULL; } static int mutt_cmp_body (const BODY * b1, const BODY * b2) @@ -422,8 +411,8 @@ static int mutt_cmp_body (const BODY * b1, const BODY * b2) m_strcmp(b1->description, b2->description) || !parameter_equal(b1->parameter, b2->parameter) || b1->length != b2->length) - return (0); - return (1); + return 0; + return 1; } int mutt_cmp_header (const HEADER * h1, const HEADER * h2) { if (h1 && h2) { @@ -437,16 +426,11 @@ int mutt_cmp_header (const HEADER * h1, const HEADER * h2) { h1->mime != h2->mime || !mutt_cmp_env (h1->env, h2->env) || !mutt_cmp_body (h1->content, h2->content)) - return (0); - else - return (1); - } - else { - if (h1 == NULL && h2 == NULL) - return (1); + return 0; else - return (0); + return 1; } + return h1 == NULL && h2 == NULL; } @@ -554,7 +538,7 @@ int mutt_extract_token(BUFFER *dest, BUFFER *tok, int flags) } } while (pc && *pc != '`'); if (!pc) { - return (-1); + return -1; } cmd = p_dupstr(tok->dptr, pc - tok->dptr); diff --git a/pager.c b/pager.c index 3bed820..2e29e65 100644 --- a/pager.c +++ b/pager.c @@ -336,7 +336,7 @@ static struct q_class_t *classify_quote (struct q_class_t **QuoteList, class->color = ColorQuote[0]; *QuoteList = class; } - return (*QuoteList); + return *QuoteList; } /* Did I mention how much I like emulating Lisp in C? */ @@ -733,7 +733,7 @@ static int is_ansi(unsigned char *buf) { while (isdigit(*buf) || *buf == ';') buf++; - return (*buf == 'm'); + return *buf == 'm'; } static int check_attachment_marker(char *p) @@ -775,7 +775,7 @@ fill_buffer (FILE * f, off_t *last_pos, off_t offset, unsigned char *buf, fseeko (f, offset, 0); if (fgets ((char *) buf, blen - 1, f) == NULL) { fmt[0] = 0; - return (-1); + return -1; } *last_pos = ftello (f); b_read = (int) (*last_pos - offset); @@ -1016,7 +1016,7 @@ display_line (FILE * f, off_t *last_pos, struct line_t **lineInfo, int n, &buf_ready) < 0) { if (change_last) (*last)--; - return (-1); + return -1; } resolve_types ((char *) fmt, (char *) buf, *lineInfo, n, *last, @@ -1048,7 +1048,7 @@ display_line (FILE * f, off_t *last_pos, struct line_t **lineInfo, int n, &buf_ready) < 0) { if (change_last) (*last)--; - return (-1); + return -1; } regexec ((regex_t *) QuoteRegexp.rx, (char *) fmt, 1, pmatch, 0); (*lineInfo)[n].quote = classify_quote (QuoteList, @@ -1064,7 +1064,7 @@ display_line (FILE * f, off_t *last_pos, struct line_t **lineInfo, int n, &buf_ready) < 0) { if (change_last) (*last)--; - return (-1); + return -1; } offset = 0; @@ -1094,18 +1094,18 @@ display_line (FILE * f, off_t *last_pos, struct line_t **lineInfo, int n, if (!(flags & M_SHOW) && (*lineInfo)[n + 1].offset > 0) { /* we've already scanned this line, so just exit */ - return (0); + return 0; } if ((flags & M_SHOWCOLOR) && *force_redraw && (*lineInfo)[n + 1].offset > 0) { /* no need to try to display this line... */ - return (1); /* fake display */ + return 1; /* fake display */ } if ((b_read = fill_buffer (f, last_pos, (*lineInfo)[n].offset, buf, fmt, sizeof (buf), &buf_ready)) < 0) { if (change_last) (*last)--; - return (-1); + return -1; } /* now chose a good place to break the line */ @@ -1188,7 +1188,7 @@ display_line (FILE * f, off_t *last_pos, struct line_t **lineInfo, int n, if (!(flags & M_SHOW)) flags = 0; - return (flags); + return flags; } static int upNLines (int nlines, struct line_t *info, int cur, int hiding) @@ -1242,13 +1242,13 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra) if ((fp = fopen (fname, "r")) == NULL) { mutt_perror (fname); - return (-1); + return -1; } if (stat (fname, &sb) != 0) { mutt_perror (fname); m_fclose(&fp); - return (-1); + return -1; } unlink (fname); @@ -2267,7 +2267,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra) p_delete(&lineInfo); if (pager_index) mutt_menuDestroy (&pager_index); - return (rc != -1 ? rc : 0); + return rc != -1 ? rc : 0; } #undef CHECK_ATTACH diff --git a/pattern.c b/pattern.c index 3ba5e62..94c1f9c 100644 --- a/pattern.c +++ b/pattern.c @@ -140,7 +140,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno) s.fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(mod_core.tmpdir), NULL); if (!s.fpout) { mutt_error(_("Could not create temporary file")); - return (0); + return 0; } if (pat->op != M_BODY) @@ -211,12 +211,12 @@ int eat_regexp (pattern_t * pat, BUFFER * s, BUFFER * err) if (mutt_extract_token (&buf, s, M_TOKEN_PATTERN | M_TOKEN_COMMENT) != 0 || !buf.data) { snprintf (err->data, err->dsize, _("Error in expression: %s"), s->dptr); - return (-1); + return -1; } if (!*buf.data) { snprintf (err->data, err->dsize, _("Empty expression")); - return (-1); + return -1; } if (pat->stringmatch) { @@ -230,7 +230,7 @@ int eat_regexp (pattern_t * pat, BUFFER * s, BUFFER * err) regerror (r, pat->rx, err->data, err->dsize); regfree (pat->rx); p_delete(&pat->rx); - return (-1); + return -1; } } return 0; @@ -481,7 +481,7 @@ static const char *parse_date_range (const char *pc, struct tm *min, if ((flag & M_PDR_ERROR) && !(flag & M_PDR_ABSOLUTE)) { /* getDate has its own error message, don't overwrite it here */ snprintf (err->data, err->dsize, _("Invalid relative date: %s"), pc - 1); } - return ((flag & M_PDR_ERROR) ? NULL : pc); + return (flag & M_PDR_ERROR) ? NULL : pc; } static int eat_date (pattern_t * pat, BUFFER * s, BUFFER * err) @@ -493,7 +493,7 @@ static int eat_date (pattern_t * pat, BUFFER * s, BUFFER * err) if (mutt_extract_token (&buffer, s, M_TOKEN_COMMENT | M_TOKEN_PATTERN) != 0 || !buffer.data) { m_strcpy(err->data, err->dsize, _("error in expression")); - return (-1); + return -1; } p_clear(&min, 1); @@ -557,7 +557,7 @@ static int eat_date (pattern_t * pat, BUFFER * s, BUFFER * err) /* mininum date specified */ if ((pc = getDate (pc, &min, err)) == NULL) { p_delete(&buffer.data); - return (-1); + return -1; } haveMin = TRUE; pc = vskipspaces(pc); @@ -590,7 +590,7 @@ static int eat_date (pattern_t * pat, BUFFER * s, BUFFER * err) if (!parse_date_range (pc, &min, &max, haveMin, &baseMin, err)) { /* bail out on any parsing error */ p_delete(&buffer.data); - return (-1); + return -1; } } } @@ -612,7 +612,7 @@ static const struct pattern_flags *lookup_tag (char tag) for (i = 0; Flags[i].tag; i++) if (Flags[i].tag == tag) - return (&Flags[i]); + return &Flags[i]; return NULL; } @@ -779,7 +779,7 @@ pattern_t *mutt_pattern_comp(const char *s, int flags, BUFFER *err) tmp->child = curlist; curlist = tmp; } - return (curlist); + return curlist; } static int @@ -816,7 +816,7 @@ static int match_adrlist (pattern_t* pat, int match_personal, int alladdr __attr (match_personal && a->personal && patmatch (pat, a->personal) == 0))) { va_end (ap); - return (!pat->alladdr); /* Found match, or non-match if alladdr */ + return !pat->alladdr; /* Found match, or non-match if alladdr */ } } } @@ -836,10 +836,10 @@ int mutt_is_list_recipient (int alladdr, address_t * a1, address_t * a2) { for (; a1; a1 = a1->next) if (alladdr ^ mutt_is_subscribed_list (a1)) - return (!alladdr); + return !alladdr; for (; a2; a2 = a2->next) if (alladdr ^ mutt_is_subscribed_list (a2)) - return (!alladdr); + return !alladdr; return alladdr; } @@ -847,10 +847,10 @@ int mutt_is_list_cc (int alladdr, address_t * a1, address_t * a2) { for (; a1; a1 = a1->next) if (alladdr ^ mutt_is_mail_list (a1)) - return (!alladdr); + return !alladdr; for (; a2; a2 = a2->next) if (alladdr ^ mutt_is_mail_list (a2)) - return (!alladdr); + return !alladdr; return alladdr; } @@ -858,10 +858,10 @@ static int match_user (int alladdr, address_t * a1, address_t * a2) { for (; a1; a1 = a1->next) if (alladdr ^ mutt_addr_is_user (a1)) - return (!alladdr); + return !alladdr; for (; a2; a2 = a2->next) if (alladdr ^ mutt_addr_is_user (a2)) - return (!alladdr); + return !alladdr; return alladdr; } @@ -881,7 +881,7 @@ static int valid_realname (const char *name) ret--; p++; } - return (ret >= 1); + return ret >= 1; } /* flags @@ -892,31 +892,31 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, { switch (pat->op) { case M_AND: - return (pat->not ^ (perform_and (pat->child, flags, ctx, h) > 0)); + return pat->not ^ (perform_and (pat->child, flags, ctx, h) > 0); case M_OR: - return (pat->not ^ (perform_or (pat->child, flags, ctx, h) > 0)); + return pat->not ^ (perform_or (pat->child, flags, ctx, h) > 0); case M_ALL: - return (!pat->not); + return !pat->not; case M_EXPIRED: - return (pat->not ^ h->expired); + return pat->not ^ h->expired; case M_SUPERSEDED: - return (pat->not ^ h->superseded); + return pat->not ^ h->superseded; case M_FLAG: - return (pat->not ^ h->flagged); + return pat->not ^ h->flagged; case M_TAG: - return (pat->not ^ h->tagged); + return pat->not ^ h->tagged; case M_NEW: - return (pat->not ? h->old || h->read : !(h->old || h->read)); + return pat->not ? h->old || h->read : !(h->old || h->read); case M_UNREAD: - return (pat->not ? h->read : !h->read); + return pat->not ? h->read : !h->read; case M_REPLIED: - return (pat->not ^ h->replied); + return pat->not ^ h->replied; case M_OLD: - return (pat->not ? (!h->old || h->read) : (h->old && !h->read)); + return pat->not ? (!h->old || h->read) : (h->old && !h->read); case M_READ: - return (pat->not ^ h->read); + return pat->not ^ h->read; case M_DELETED: - return (pat->not ^ h->deleted); + return pat->not ^ h->deleted; case M_MESSAGE: return (pat->not ^ (h->msgno >= pat->min - 1 && (pat->max == M_MAXRANGE || h->msgno <= @@ -925,14 +925,14 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, return (pat-> not ^ (h->date_sent >= pat->min && h->date_sent <= pat->max)); case M_DATE_RECEIVED: - return (pat->not ^ (h->received >= pat->min && h->received <= pat->max)); + return pat->not ^ (h->received >= pat->min && h->received <= pat->max); case M_BODY: case M_HEADER: case M_WHOLE_MSG: /* IMAP search sets h->matched at search compile time */ if (ctx->magic == M_IMAP && pat->stringmatch) - return (h->matched); - return (pat->not ^ msg_search (ctx, pat, h->msgno)); + return h->matched; + return pat->not ^ msg_search (ctx, pat, h->msgno); case M_SENDER: return (pat->not ^ match_adrlist (pat, flags & M_MATCH_FULL_ADDRESS, pat->alladdr, 1, h->env->sender)); @@ -962,7 +962,7 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, && (pat->max == M_MAXRANGE || h->content->length <= pat->max))); case M_REFERENCE: - return (pat->not ^ match_reference (pat, h->env->references)); + return pat->not ^ match_reference (pat, h->env->references); case M_ADDRESS: return (pat-> not ^ (h->env @@ -994,13 +994,13 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, return (pat-> not ^ (h->env && match_user (pat->alladdr, h->env->from, NULL))); case M_COLLAPSED: - return (pat->not ^ (h->collapsed && h->num_hidden > 1)); + return pat->not ^ (h->collapsed && h->num_hidden > 1); case M_CRYPT_SIGN: - return (pat->not ^ ((h->security & SIGN) ? 1 : 0)); + return pat->not ^ ((h->security & SIGN) ? 1 : 0); case M_CRYPT_VERIFIED: - return (pat->not ^ ((h->security & GOODSIGN) ? 1 : 0)); + return pat->not ^ ((h->security & GOODSIGN) ? 1 : 0); case M_CRYPT_ENCRYPT: - return (pat->not ^ ((h->security & ENCRYPT) ? 1 : 0)); + return pat->not ^ ((h->security & ENCRYPT) ? 1 : 0); case M_PGP_KEY: return (pat->not ^ ((h->security & APPLICATION_PGP) && (h->security & PGPKEY))); @@ -1013,7 +1013,7 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, not ^ (h->env->spam && h->env->spam->data && patmatch (pat, h->env->spam->data) == 0)); case M_DUPLICATED: - return (pat->not ^ (h->thread && h->thread->duplicate_thread)); + return pat->not ^ (h->thread && h->thread->duplicate_thread); case M_MIMEATTACH: { @@ -1032,9 +1032,9 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, } case M_UNREFERENCED: - return (pat->not ^ (h->thread && !h->thread->child)); + return pat->not ^ (h->thread && !h->thread->child); case M_MULTIPART: - return (pat->not ^ (h->content && h->content->type == TYPEMULTIPART)); + return pat->not ^ (h->content && h->content->type == TYPEMULTIPART); case M_REALNAME: /* realname filter: * we have a match if @@ -1051,7 +1051,7 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, )) ^ pat->not; } mutt_error (_("error: unknown op %d (report this error)."), pat->op); - return (-1); + return -1; } static void quote_simple (char *tmp, ssize_t len, const char *p) @@ -1114,7 +1114,7 @@ int mutt_pattern_func (int op, const char *prompt) m_strcpy(buf, sizeof(buf), NONULL(Context->pattern)); if (prompt || op != M_LIMIT) if (mutt_get_field (prompt, buf, sizeof (buf), M_PATTERN | M_CLEAR) != 0 || !buf[0]) - return (-1); + return -1; mutt_message _("Compiling search pattern..."); @@ -1126,7 +1126,7 @@ int mutt_pattern_func (int op, const char *prompt) if ((pat = mutt_pattern_comp (buf, M_FULL_MSG, &err)) == NULL) { p_delete(&simple); mutt_error ("%s", err.data); - return (-1); + return -1; } if (Context->magic == M_IMAP && imap_search (Context, pat) < 0) @@ -1221,7 +1221,7 @@ int mutt_search_command (int cur, int op) if (mutt_get_field ((op == OP_SEARCH) ? _("Search for: ") : _("Reverse search for: "), buf, sizeof (buf), M_CLEAR | M_PATTERN) != 0 || !buf[0]) - return (-1); + return -1; if (op == OP_SEARCH) unset_option (OPTSEARCHREVERSE); @@ -1244,7 +1244,7 @@ int mutt_search_command (int cur, int op) if ((SearchPattern = mutt_pattern_comp (temp, M_FULL_MSG, &err)) == NULL) { mutt_error ("%s", error); - return (-1); + return -1; } mutt_clear_error (); } @@ -1252,7 +1252,7 @@ int mutt_search_command (int cur, int op) else if (!SearchPattern) { mutt_error _("No search pattern."); - return (-1); + return -1; } if (option (OPTSEARCHINVALID)) { @@ -1276,7 +1276,7 @@ int mutt_search_command (int cur, int op) else { mutt_message _("Search hit bottom without finding match"); - return (-1); + return -1; } } else if (i < 0) { @@ -1287,7 +1287,7 @@ int mutt_search_command (int cur, int op) else { mutt_message _("Search hit top without finding match"); - return (-1); + return -1; } } @@ -1310,7 +1310,7 @@ int mutt_search_command (int cur, int op) mutt_error _("Search interrupted."); SigInt = 0; - return (-1); + return -1; } i += incr; @@ -1318,5 +1318,5 @@ int mutt_search_command (int cur, int op) mutt_error _("Not found."); - return (-1); + return -1; } diff --git a/pop.c b/pop.c index a066f6e..2258d0f 100644 --- a/pop.c +++ b/pop.c @@ -994,7 +994,7 @@ static int pop_fetch_headers (CONTEXT * ctx) } mutt_clear_error (); - return (new_count - old_count); + return new_count - old_count; } /* delete all cached messages */ diff --git a/postpone.c b/postpone.c index 16d3584..b8a3b41 100644 --- a/postpone.c +++ b/postpone.c @@ -72,7 +72,7 @@ int mutt_num_postponed (int force) if (stat (Postponed, &st) == -1) { PostCount = 0; LastModify = 0; - return (0); + return 0; } if (S_ISDIR (st.st_mode)) { @@ -92,7 +92,7 @@ int mutt_num_postponed (int force) LastModify = st.st_mtime; if (access (Postponed, R_OK | F_OK) != 0) - return (PostCount = 0); + return PostCount = 0; if (mx_open_mailbox (Postponed, M_NOSORT | M_QUIET, &ctx) == NULL) PostCount = 0; else @@ -100,7 +100,7 @@ int mutt_num_postponed (int force) mx_fastclose_mailbox (&ctx); } - return (PostCount); + return PostCount; } void mutt_update_num_postponed (void) @@ -167,7 +167,7 @@ static HEADER *select_msg (void) Sort = orig_sort; mutt_menuDestroy (&menu); - return (r > -1 ? PostContext->hdrs[r] : NULL); + return r > -1 ? PostContext->hdrs[r] : NULL; } /* args: @@ -196,13 +196,13 @@ int mutt_get_postponed (CONTEXT * ctx, HEADER * hdr, HEADER ** cur, char *fcc, int opt_delete; if (!Postponed) - return (-1); + return -1; if ((PostContext = mx_open_mailbox (Postponed, M_NOSORT, NULL)) == NULL) { PostCount = 0; mutt_error _("No postponed messages."); - return (-1); + return -1; } if (!PostContext->msgcount) { @@ -211,7 +211,7 @@ int mutt_get_postponed (CONTEXT * ctx, HEADER * hdr, HEADER ** cur, char *fcc, p_delete(&PostContext); mutt_error _("No postponed messages."); - return (-1); + return -1; } if (PostContext->msgcount == 1) { @@ -221,13 +221,13 @@ int mutt_get_postponed (CONTEXT * ctx, HEADER * hdr, HEADER ** cur, char *fcc, else if ((h = select_msg ()) == NULL) { mx_close_mailbox (PostContext, NULL); p_delete(&PostContext); - return (-1); + return -1; } if (mutt_prepare_template (NULL, PostContext, hdr, h, 0) < 0) { mx_fastclose_mailbox (PostContext); p_delete(&PostContext); - return (-1); + return -1; } /* finished with this message, so delete it. */ @@ -318,7 +318,7 @@ int mutt_get_postponed (CONTEXT * ctx, HEADER * hdr, HEADER ** cur, char *fcc, tmp = tmp->next; } } - return (code); + return code; } int mutt_parse_crypt_hdr (char *p, int set_signas) @@ -431,7 +431,7 @@ int mutt_prepare_template (FILE * fp, CONTEXT * ctx, HEADER * newhdr, p_clear(&s, 1); if (!fp && (msg = mx_open_message (ctx, hdr->msgno)) == NULL) - return (-1); + return -1; if (!fp) fp = msg->fp; diff --git a/recvattach.c b/recvattach.c index ff47923..2ca1964 100644 --- a/recvattach.c +++ b/recvattach.c @@ -109,7 +109,7 @@ ATTACHPTR **mutt_gen_attach_list (BODY * m, if (level == 0) mutt_update_tree (idx, *idxlen); - return (idx); + return idx; } /* %c = character set: convert? @@ -588,7 +588,7 @@ static int can_print(BODY * top, int tag) } } else if (top->parts) - return (can_print(top->parts, tag)); + return can_print(top->parts, tag); if (!tag) break; } diff --git a/recvcmd.c b/recvcmd.c index 6b8a093..0d8813b 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -720,7 +720,7 @@ attach_reply_envelope_defaults (ENVELOPE * env, ATTACHPTR ** idx, if ((flags & SENDLISTREPLY) && !env->to) { mutt_error _("No mailing lists found!"); - return (-1); + return -1; } mutt_fix_reply_recipients (env); diff --git a/send.c b/send.c index d077993..2ec0954 100644 --- a/send.c +++ b/send.c @@ -117,9 +117,9 @@ static int mutt_addrsrc (address_t * a, address_t * lst) { for (; lst; lst = lst->next) { if (mutt_addrcmp (a, lst)) - return (1); + return 1; } - return (0); + return 0; } /* removes addresses from "b" which are contained in "a" */ @@ -218,7 +218,7 @@ static int edit_address (address_t ** a, const char *field) mutt_addrlist_to_local (*a); rfc822_addrcat(buf, sizeof(buf), *a, 0); if (mutt_get_field (field, buf, sizeof (buf), M_ALIAS) != 0) - return (-1); + return -1; address_list_wipe(a); *a = mutt_expand_aliases (mutt_parse_adrlist (NULL, buf)); if ((idna_ok = mutt_addrlist_to_idna (*a, &err)) != 0) { @@ -239,15 +239,15 @@ static int edit_envelope (ENVELOPE * en, int flags) regmatch_t pat_match[1]; if (edit_address (&en->to, "To: ") == -1 || en->to == NULL) - return (-1); + return -1; if (option (OPTASKCC) && edit_address (&en->cc, "Cc: ") == -1) - return (-1); + return -1; if (option (OPTASKBCC) && edit_address (&en->bcc, "Bcc: ") == -1) - return (-1); + return -1; if (en->subject) { if (option (OPTFASTREPLY)) - return (0); + return 0; else m_strcpy(buf, sizeof(buf), en->subject); } @@ -286,7 +286,7 @@ static int edit_envelope (ENVELOPE * en, int flags) != M_NO)) { mutt_message _("No subject, aborting."); - return (-1); + return -1; } m_strreplace(&en->subject, buf); @@ -501,7 +501,7 @@ static int default_to (address_t ** to, ENVELOPE * env, int flags, int hmfupto) break; default: - return (-1); /* abort */ + return -1; /* abort */ } } else @@ -510,7 +510,7 @@ static int default_to (address_t ** to, ENVELOPE * env, int flags, int hmfupto) else address_list_append(to, address_list_dup(env->from)); - return (0); + return 0; } int mutt_fetch_recips (ENVELOPE * out, ENVELOPE * in, int flags) @@ -532,11 +532,11 @@ int mutt_fetch_recips (ENVELOPE * out, ENVELOPE * in, int flags) if (in->mail_followup_to && hmfupto == M_YES && default_to (&out->cc, in, flags & SENDLISTREPLY, hmfupto) == -1) - return (-1); /* abort */ + return -1; /* abort */ } else { if (default_to (&out->to, in, flags & SENDGROUPREPLY, hmfupto) == -1) - return (-1); /* abort */ + return -1; /* abort */ if ((flags & SENDGROUPREPLY) && (!in->mail_followup_to || hmfupto != M_YES)) @@ -692,7 +692,7 @@ envelope_defaults (ENVELOPE * env, CONTEXT * ctx, HEADER * cur, int flags) */ mutt_error _("No tagged messages are visible!"); - return (-1); + return -1; } } else @@ -714,7 +714,7 @@ envelope_defaults (ENVELOPE * env, CONTEXT * ctx, HEADER * cur, int flags) if ((flags & SENDLISTREPLY) && !env->to) { mutt_error _("No mailing lists found!"); - return (-1); + return -1; } mutt_make_misc_reply_headers (env, ctx, cur, curenv); @@ -723,7 +723,7 @@ envelope_defaults (ENVELOPE * env, CONTEXT * ctx, HEADER * cur, int flags) else if (flags & SENDFORWARD) mutt_make_forward_subject (env, ctx, cur); - return (0); + return 0; } static int generate_body (FILE * tempfp, /* stream for outgoing message */ @@ -740,7 +740,7 @@ static int generate_body (FILE * tempfp, /* stream for outgoing message * if ((i = query_quadoption (OPT_INCLUDE, _("Include message in reply?"))) == -1) - return (-1); + return -1; if (i == M_YES) { mutt_message _("Including quoted message..."); @@ -752,7 +752,7 @@ static int generate_body (FILE * tempfp, /* stream for outgoing message * if (include_reply (ctx, h, tempfp) == -1) { mutt_error _("Could not include all requested messages!"); - return (-1); + return -1; } fputc ('\n', tempfp); } @@ -809,7 +809,7 @@ static int generate_body (FILE * tempfp, /* stream for outgoing message * mutt_clear_error (); - return (0); + return 0; } void mutt_set_followup_to (ENVELOPE * e) @@ -913,7 +913,7 @@ address_t *mutt_default_from (void) adr->mailbox = m_strdup(NONULL(mod_core.username)); } - return (adr); + return adr; } static int send_message (HEADER * msg) @@ -933,19 +933,19 @@ static int send_message (HEADER * msg) if ((mutt_write_mime_body (msg->content, tempfp) == -1)) { m_fclose(&tempfp); unlink (tempfile); - return (-1); + return -1; } if (m_fclose(&tempfp) != 0) { mutt_perror (_("Can't create temporary file")); unlink (tempfile); - return (-1); + return -1; } i = mutt_invoke_mta (msg->env->from, msg->env->to, msg->env->cc, msg->env->bcc, tempfile, (msg->content->encoding == ENC8BIT)); - return (i); + return i; } /* rfc2047 encode the content-descriptions */ diff --git a/sendlib.c b/sendlib.c index 1f15e17..5df5166 100644 --- a/sendlib.c +++ b/sendlib.c @@ -324,7 +324,7 @@ int mutt_write_mime_header (BODY * a, FILE * f) fprintf (f, "Content-Transfer-Encoding: %s\n", ENCODING (a->encoding)); /* Do NOT add the terminator here!!! */ - return (ferror (f) ? -1 : 0); + return ferror (f) ? -1 : 0; } int mutt_write_mime_body (BODY * a, FILE * f) @@ -341,7 +341,7 @@ int mutt_write_mime_body (BODY * a, FILE * f) if (!(p = parameter_getval(a->parameter, "boundary"))) { mutt_error _("No boundary parameter found! [report this error]"); - return (-1); + return -1; } m_strcpy(boundary, sizeof(boundary), p); @@ -354,7 +354,7 @@ int mutt_write_mime_body (BODY * a, FILE * f) return -1; } fprintf (f, "\n--%s--\n", boundary); - return (ferror (f) ? -1 : 0); + return ferror (f) ? -1 : 0; } /* This is pretty gross, but it's the best solution for now... */ @@ -389,7 +389,7 @@ int mutt_write_mime_body (BODY * a, FILE * f) fgetconv_close (&fc); m_fclose(&fpin); - return (ferror (f) ? -1 : 0); + return ferror (f) ? -1 : 0; } typedef struct { @@ -745,7 +745,7 @@ CONTENT *mutt_get_content_info (const char *fname, BODY * b) } if ((fp = fopen (fname, "r")) == NULL) { - return (NULL); + return NULL; } info = p_new(CONTENT, 1); @@ -886,7 +886,7 @@ bye: m_strreplace(&att->xtype, xtype); } - return (type); + return type; } void mutt_message_to_7bit (BODY * a, FILE * fp) @@ -1156,7 +1156,7 @@ BODY *mutt_make_message_attach (CONTEXT * ctx, HEADER * hdr, int attach_msg) m_fclose(&fp); - return (body); + return body; } BODY *mutt_make_file_attach (const char *path) @@ -1445,7 +1445,7 @@ int mutt_write_rfc822_header (FILE * fp, ENVELOPE * env, BODY * attach, } } - return (ferror (fp) == 0 ? 0 : -1); + return ferror (fp) == 0 ? 0 : -1; } static void encode_headers (string_list_t * h) @@ -1736,7 +1736,7 @@ send_msg(const char *path, const char **args, const char *msg, char **tempfile) mutt_unblock_signals_system (1); - return (st); + return st; } static const char ** @@ -1750,7 +1750,7 @@ add_args(const char **args, ssize_t *argslen, ssize_t *argsmax, address_t * addr args[(*argslen)++] = addr->mailbox; } } - return (args); + return args; } static const char ** @@ -1760,7 +1760,7 @@ add_option(const char **args, ssize_t *argslen, ssize_t *argsmax, const char *s) p_realloc(&args, *argsmax += 5); } args[(*argslen)++] = s; - return (args); + return args; } int mutt_invoke_mta(address_t *from, address_t *to, address_t *cc, @@ -1850,7 +1850,7 @@ int mutt_invoke_mta(address_t *from, address_t *to, address_t *cc, i = 1; else i = -1; - return (i); + return i; } /* For postponing (!final) do the necessary encodings only */ @@ -2006,7 +2006,7 @@ int mutt_write_fcc (const char *path, HEADER * hdr, const char *msgid, set_noconv_flags (hdr->content, 1); if (mx_open_mailbox (path, M_APPEND | M_QUIET, &f) == NULL) { - return (-1); + return -1; } /* We need to add a Content-Length field to avoid problems where a line in @@ -2024,7 +2024,7 @@ int mutt_write_fcc (const char *path, HEADER * hdr, const char *msgid, hdr->read = !post; /* make sure to put it in the `cur' directory (maildir) */ if ((msg = mx_open_new_message (&f, hdr, M_ADD_FROM)) == NULL) { mx_close_mailbox (&f, NULL); - return (-1); + return -1; } /* post == 1 => postpone message. Set mode = -1 in mutt_write_rfc822_header() diff --git a/sort.c b/sort.c index d97535f..00f14aa 100644 --- a/sort.c +++ b/sort.c @@ -38,7 +38,7 @@ static int compare_score (const void *a, const void *b) int result = (*pb)->score - (*pa)->score; /* note that this is reverse */ AUXSORT (result, a, b); - return (SORTCODE (result)); + return SORTCODE (result); } static int compare_size (const void *a, const void *b) @@ -48,7 +48,7 @@ static int compare_size (const void *a, const void *b) int result = (*pa)->content->length - (*pb)->content->length; AUXSORT (result, a, b); - return (SORTCODE (result)); + return SORTCODE (result); } static int compare_date_sent (const void *a, const void *b) @@ -58,7 +58,7 @@ static int compare_date_sent (const void *a, const void *b) int result = (*pa)->date_sent - (*pb)->date_sent; AUXSORT (result, a, b); - return (SORTCODE (result)); + return SORTCODE (result); } static int compare_subject (const void *a, const void *b) @@ -78,7 +78,7 @@ static int compare_subject (const void *a, const void *b) else rc = m_strcasecmp((*pa)->env->real_subj, (*pb)->env->real_subj); AUXSORT (rc, a, b); - return (SORTCODE (rc)); + return SORTCODE (rc); } const char *mutt_get_name (address_t * a) @@ -116,7 +116,7 @@ static int compare_to (const void *a, const void *b) result = m_strcasecmp(fa, fb); AUXSORT (result, a, b); - return (SORTCODE (result)); + return SORTCODE (result); } static int compare_from (const void *a, const void *b) @@ -136,7 +136,7 @@ static int compare_from (const void *a, const void *b) result = m_strcasecmp(fa, fb); AUXSORT (result, a, b); - return (SORTCODE (result)); + return SORTCODE (result); } static int compare_date_received (const void *a, const void *b) @@ -146,7 +146,7 @@ static int compare_date_received (const void *a, const void *b) int result = (*pa)->received - (*pb)->received; AUXSORT (result, a, b); - return (SORTCODE (result)); + return SORTCODE (result); } static int compare_order (const void *a, const void *b) @@ -154,7 +154,7 @@ static int compare_order (const void *a, const void *b) HEADER **ha = (HEADER **) a; HEADER **hb = (HEADER **) b; /* no need to auxsort because you will never have equality here */ - return (SORTCODE ((*ha)->index - (*hb)->index)); + return SORTCODE ((*ha)->index - (*hb)->index); } static int compare_spam (const void *a, const void *b) @@ -172,14 +172,14 @@ static int compare_spam (const void *a, const void *b) /* If one msg has spam attr but other does not, sort the one with first. */ if (ahas && !bhas) - return (SORTCODE (1)); + return SORTCODE (1); if (!ahas && bhas) - return (SORTCODE (-1)); + return SORTCODE (-1); /* Else, if neither has a spam attr, presume equality. Fall back on aux. */ if (!ahas && !bhas) { AUXSORT (result, a, b); - return (SORTCODE (result)); + return SORTCODE (result); } @@ -192,7 +192,7 @@ static int compare_spam (const void *a, const void *b) /* If either aptr or bptr is equal to data, there is no numeric */ /* value for that spam attribute. In this case, compare lexically. */ if ((aptr == (*ppa)->env->spam->data) || (bptr == (*ppb)->env->spam->data)) - return (SORTCODE (m_strcmp(aptr, bptr))); + return SORTCODE (m_strcmp(aptr, bptr)); /* Otherwise, we have numeric value for both attrs. If these values */ /* are equal, then we first fall back upon string comparison, then */ @@ -203,32 +203,32 @@ static int compare_spam (const void *a, const void *b) AUXSORT (result, a, b); } - return (SORTCODE (result)); + return SORTCODE (result); } sort_t *mutt_get_sort_func (int method) { switch (method & SORT_MASK) { case SORT_RECEIVED: - return (compare_date_received); + return compare_date_received; case SORT_ORDER: - return (compare_order); + return compare_order; case SORT_DATE: - return (compare_date_sent); + return compare_date_sent; case SORT_SUBJECT: - return (compare_subject); + return compare_subject; case SORT_FROM: - return (compare_from); + return compare_from; case SORT_SIZE: - return (compare_size); + return compare_size; case SORT_TO: - return (compare_to); + return compare_to; case SORT_SCORE: - return (compare_score); + return compare_score; case SORT_SPAM: - return (compare_spam); + return compare_spam; default: - return (NULL); + return NULL; } /* not reached */ } diff --git a/thread.c b/thread.c index c5cc040..5dc9842 100644 --- a/thread.c +++ b/thread.c @@ -20,10 +20,10 @@ static int is_descendant (THREAD * a, THREAD * b) { while (a) { if (a == b) - return (1); + return 1; a = a->parent; } - return (0); + return 0; } /* Determines whether to display a message's subject. */ @@ -33,11 +33,11 @@ static int need_display_subject (CONTEXT * ctx, HEADER * hdr) /* if the user disabled subject hiding, display it */ if (!option (OPTHIDETHREADSUBJECT)) - return (1); + return 1; /* if our subject is different from our parent's, display it */ if (hdr->subject_changed) - return (1); + return 1; /* if our subject is different from that of our closest previously displayed * sibling, display the subject */ @@ -45,7 +45,7 @@ static int need_display_subject (CONTEXT * ctx, HEADER * hdr) hdr = tmp->message; if (hdr && VISIBLE (hdr, ctx)) { if (hdr->subject_changed) - return (1); + return 1; else break; } @@ -57,14 +57,14 @@ static int need_display_subject (CONTEXT * ctx, HEADER * hdr) hdr = tmp->message; if (hdr) { if (VISIBLE (hdr, ctx)) - return (0); + return 0; else if (hdr->subject_changed) - return (1); + return 1; } } /* if we have no visible parent or previous sibling, display the subject */ - return (1); + return 1; } static void linearize_tree (CONTEXT * ctx) @@ -353,7 +353,7 @@ static string_list_t *make_subject_list (THREAD * cur, time_t * dateptr) cur = cur->next; } - return (subjects); + return subjects; } /* find the best possible match for a parent mesage based upon subject. @@ -395,7 +395,7 @@ static THREAD *find_subject (CONTEXT * ctx, THREAD * cur) subjects = subjects->next; p_delete(&oldlist); } - return (last); + return last; } /* remove cur and its descendants from their current location. @@ -514,7 +514,7 @@ static int compare_threads (const void *a, const void *b) else { sort_func = NULL; sort_func = mutt_get_sort_func (Sort); - return (sort_func ? 1 : 0); + return sort_func ? 1 : 0; } } @@ -531,7 +531,7 @@ THREAD *mutt_sort_subthreads (THREAD * thread, int init) */ Sort ^= SORT_REVERSE; if (!compare_threads (NULL, NULL)) - return (thread); + return thread; top = thread; @@ -628,7 +628,7 @@ THREAD *mutt_sort_subthreads (THREAD * thread, int init) else { Sort ^= SORT_REVERSE; p_delete(&array); - return (top); + return top; } } @@ -877,18 +877,18 @@ static HEADER *find_virtual (THREAD * cur, int reverse) THREAD *top; if (cur->message && cur->message->virtual >= 0) - return (cur->message); + return cur->message; top = cur; if ((cur = cur->child) == NULL) - return (NULL); + return NULL; while (reverse && cur->next) cur = cur->next; for (;;) { if (cur->message && cur->message->virtual >= 0) - return (cur->message); + return cur->message; if (cur->child) { cur = cur->child; @@ -902,7 +902,7 @@ static HEADER *find_virtual (THREAD * cur, int reverse) while (!(reverse ? cur->prev : cur->next)) { cur = cur->parent; if (cur == top) - return (NULL); + return NULL; } cur = reverse ? cur->prev : cur->next; } @@ -918,7 +918,7 @@ int _mutt_aside_thread (HEADER * hdr, short dir, short subthreads) if ((Sort & SORT_MASK) != SORT_THREADS) { mutt_error _("Threading is not enabled."); - return (hdr->virtual); + return hdr->virtual; } cur = hdr->thread; @@ -942,7 +942,7 @@ int _mutt_aside_thread (HEADER * hdr, short dir, short subthreads) do { cur = cur->next; if (!cur) - return (-1); + return -1; tmp = find_virtual (cur, 0); } while (!tmp); } @@ -950,12 +950,12 @@ int _mutt_aside_thread (HEADER * hdr, short dir, short subthreads) do { cur = cur->prev; if (!cur) - return (-1); + return -1; tmp = find_virtual (cur, 1); } while (!tmp); } - return (tmp->virtual); + return tmp->virtual; } int mutt_parent_message (CONTEXT * ctx, HEADER * hdr) @@ -965,24 +965,24 @@ int mutt_parent_message (CONTEXT * ctx, HEADER * hdr) if ((Sort & SORT_MASK) != SORT_THREADS) { mutt_error _("Threading is not enabled."); - return (hdr->virtual); + return hdr->virtual; } for (thread = hdr->thread->parent; thread; thread = thread->parent) { if ((hdr = thread->message) != NULL) { if (VISIBLE (hdr, ctx)) - return (hdr->virtual); + return hdr->virtual; else { mutt_error _("Parent message is not visible in this limited view."); - return (-1); + return -1; } } } mutt_error _("Parent message is not available."); - return (-1); + return -1; } void mutt_set_virtual (CONTEXT * ctx) @@ -1019,7 +1019,7 @@ int _mutt_traverse_thread (CONTEXT * ctx, HEADER * cur, int flag) if ((Sort & SORT_MASK) != SORT_THREADS && !(flag & M_THREAD_GET_HIDDEN)) { mutt_error (_("Threading is not enabled.")); - return (cur->virtual); + return cur->virtual; } final = cur->virtual; @@ -1059,13 +1059,13 @@ int _mutt_traverse_thread (CONTEXT * ctx, HEADER * cur, int flag) if (thread == top && (thread = thread->child) == NULL) { /* return value depends on action requested */ if (flag & (M_THREAD_COLLAPSE | M_THREAD_UNCOLLAPSE)) - return (final); + return final; else if (flag & M_THREAD_UNREAD) - return ((old && new) ? new : (old ? old : new)); + return (old && new) ? new : (old ? old : new); else if (flag & M_THREAD_GET_HIDDEN) - return (num_hidden); + return num_hidden; else if (flag & M_THREAD_NEXT_UNREAD) - return (min_unread); + return min_unread; } for (;;) { @@ -1135,15 +1135,15 @@ int _mutt_traverse_thread (CONTEXT * ctx, HEADER * cur, int flag) /* return value depends on action requested */ if (flag & (M_THREAD_COLLAPSE | M_THREAD_UNCOLLAPSE)) - return (final); + return final; else if (flag & M_THREAD_UNREAD) - return ((old && new) ? new : (old ? old : new)); + return (old && new) ? new : (old ? old : new); else if (flag & M_THREAD_GET_HIDDEN) - return (num_hidden + 1); + return num_hidden + 1; else if (flag & M_THREAD_NEXT_UNREAD) - return (min_unread); + return min_unread; - return (0); + return 0; #undef CHECK_LIMIT } @@ -1157,7 +1157,7 @@ int mutt_messages_in_thread (CONTEXT * ctx, HEADER * hdr, int flag) int i, rc; if ((Sort & SORT_MASK) != SORT_THREADS || !hdr->thread) - return (1); + return 1; threads[0] = hdr->thread; while (threads[0]->parent) @@ -1182,7 +1182,7 @@ int mutt_messages_in_thread (CONTEXT * ctx, HEADER * hdr, int flag) if (flag) rc += 1; - return (rc); + return rc; } -- 2.20.1