From: Richard Russon Date: Sun, 12 Mar 2017 17:27:50 +0000 (+0000) Subject: remove #if 0 code blocks X-Git-Tag: neomutt-20170414~31^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e609098f922247e718c576832a92525ae8f3565;p=neomutt remove #if 0 code blocks This code has been commented out for over 6 months (and much of it for more than 10 years). --- diff --git a/compose.c b/compose.c index 5f248eed8..0f2617576 100644 --- a/compose.c +++ b/compose.c @@ -1150,14 +1150,6 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ CHECK_COUNT; idx[menu->current]->content->unlink = !idx[menu->current]->content->unlink; -#if 0 - /* OPTRESOLVE is otherwise ignored on this menu. - * Where's the bug? - */ - - if (option (OPTRESOLVE) && menu->current + 1 < menu->max) - menu->current++; -# endif menu->redraw = REDRAW_INDEX; /* No send2hook since this doesn't change the message. */ break; diff --git a/copy.c b/copy.c index a30b1f163..4b4ccdc05 100644 --- a/copy.c +++ b/copy.c @@ -289,11 +289,6 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags, { if (headers[x]) { -#if 0 - if (flags & CH_DECODE) - rfc2047_decode (&headers[x]); -#endif - /* We couldn't do the prefixing when reading because RFC 2047 * decoding may have concatenated lines. */ diff --git a/crypt-gpgme.c b/crypt-gpgme.c index 2ac4ecaba..d09e8ae6a 100644 --- a/crypt-gpgme.c +++ b/crypt-gpgme.c @@ -3832,28 +3832,6 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, int secret) if (key->disabled) flags |= KEYFLAG_DISABLED; -#if 0 /* DISABLED code */ - if (!flags) - { - /* Bug in gpg. Capabilities are not listed for secret - keys. Try to deduce them from the algorithm. */ - - switch (key->subkeys[0].pubkey_algo) - { - case GPGME_PK_RSA: - flags |= KEYFLAG_CANENCRYPT; - flags |= KEYFLAG_CANSIGN; - break; - case GPGME_PK_ELG_E: - flags |= KEYFLAG_CANENCRYPT; - break; - case GPGME_PK_DSA: - flags |= KEYFLAG_CANSIGN; - break; - } - } -#endif /* DISABLED code */ - for (idx = 0, uid = key->uids; uid; idx++, uid = uid->next) { k = safe_calloc (1, sizeof *k); @@ -4447,10 +4425,6 @@ static char *find_keys (ADDRESS *adrlist, unsigned int app, int oppenc_mode) int r; int key_selected; -#if 0 - *r_application = APPLICATION_PGP|APPLICATION_SMIME; -#endif - for (p = adrlist; p ; p = p->next) { key_selected = 0; @@ -4491,13 +4465,8 @@ static char *find_keys (ADDRESS *adrlist, unsigned int app, int oppenc_mode) } else if (! oppenc_mode) { -#if 0 - k_info = crypt_getkeybystr (crypt_hook_val, KEYFLAG_CANENCRYPT, - *r_application, &forced_valid); -#else k_info = crypt_getkeybystr (crypt_hook_val, KEYFLAG_CANENCRYPT, app, &forced_valid); -#endif } } else if (r == MUTT_NO) @@ -4529,11 +4498,7 @@ static char *find_keys (ADDRESS *adrlist, unsigned int app, int oppenc_mode) k_info = crypt_ask_for_key (buf, q->mailbox, KEYFLAG_CANENCRYPT, -#if 0 - *r_application, -#else app, -#endif &forced_valid); } @@ -4548,13 +4513,6 @@ static char *find_keys (ADDRESS *adrlist, unsigned int app, int oppenc_mode) keyID = crypt_fpr_or_lkeyid (k_info); -#if 0 - if (k_info->flags & KEYFLAG_ISX509) - *r_application &= ~APPLICATION_PGP; - if (!(k_info->flags & KEYFLAG_ISX509)) - *r_application &= ~APPLICATION_SMIME; -#endif - bypass_selection: keylist_size += mutt_strlen (keyID) + 4 + 1; safe_realloc (&keylist, keylist_size); diff --git a/crypt.c b/crypt.c index 8132f1651..4c21e482b 100644 --- a/crypt.c +++ b/crypt.c @@ -513,13 +513,9 @@ int mutt_is_application_smime (BODY *m) { len++; if (!ascii_strcasecmp ((t+len), "p7m")) -#if 0 - return SMIMEENCRYPT; -#else /* Not sure if this is the correct thing to do, but it's required for compatibility with Outlook */ return (SMIMESIGN|SMIMEOPAQUE); -#endif else if (!ascii_strcasecmp ((t+len), "p7s")) return (SMIMESIGN|SMIMEOPAQUE); } diff --git a/curs_main.c b/curs_main.c index 5ae804a42..7f0d8e1de 100644 --- a/curs_main.c +++ b/curs_main.c @@ -3224,9 +3224,6 @@ int mutt_index_menu (void) mutt_clear_pager_position (); menu->menu = MENU_MAIN; menu->redraw = REDRAW_FULL; -#if 0 - set_option (OPTWEED); /* turn header weeding back on. */ -#endif } if (done) break; diff --git a/init.c b/init.c index 3b03d6885..9df285993 100644 --- a/init.c +++ b/init.c @@ -4022,10 +4022,6 @@ void mutt_init (int skip_sys_rc, LIST *commands) mutt_str_replace(&Spoolfile, VirtIncoming->path); #endif -#if 0 - set_option (OPTWEED); /* turn weeding on by default */ -#endif - FREE (&err.data); } diff --git a/main.c b/main.c index ff04d4baa..49906ddb4 100644 --- a/main.c +++ b/main.c @@ -152,10 +152,8 @@ static void start_curses (void) puts (_("Error initializing terminal.")); exit (1); } -#if 1 /* USE_SLANG_CURSES - commenting out suggested in #455. */ /* slang requires the signal handlers to be set after initializing */ mutt_signal_init (); -#endif ci_start_color (); keypad (stdscr, true); cbreak (); diff --git a/mh.c b/mh.c index 9267de938..7362ad9ab 100644 --- a/mh.c +++ b/mh.c @@ -139,19 +139,6 @@ static short mhs_set (struct mh_sequences *mhs, int i, short f) return mhs->flags[i]; } -#if 0 - -/* unused */ - -static short mhs_unset (struct mh_sequences *mhs, int i, short f) -{ - mhs_alloc (mhs, i); - mhs->flags[i] &= ~f; - return mhs->flags[i]; -} - -#endif - static int mh_read_token (char *t, int *first, int *last) { char *p; diff --git a/mutt.h b/mutt.h index 2a049fd46..3faf65b33 100644 --- a/mutt.h +++ b/mutt.h @@ -543,9 +543,6 @@ enum OPTPGPCHECKEXIT, OPTPGPLONGIDS, OPTPGPAUTODEC, -#if 0 - OPTPGPENCRYPTSELF, -#endif OPTPGPRETAINABLESIG, OPTPGPSTRICTENC, OPTFORWDECRYPT, diff --git a/mutt_ssl.c b/mutt_ssl.c index dbec6c8b4..b72e77114 100644 --- a/mutt_ssl.c +++ b/mutt_ssl.c @@ -605,9 +605,6 @@ static int ssl_socket_close (CONNECTION * conn) /* hold onto this for the life of mutt, in case we want to reconnect. * The purist in me wants a mutt_exit hook. */ -#if 0 - X509_free (data->cert); -#endif SSL_free (data->ssl); SSL_CTX_free (data->ctx); FREE (&conn->sockdata); diff --git a/muttlib.c b/muttlib.c index 7837a6335..7c9cbe67c 100644 --- a/muttlib.c +++ b/muttlib.c @@ -1735,18 +1735,6 @@ void mutt_FormatString (char *dest, /* output buffer */ } } *wptr = 0; - -#if 0 - if (flags & MUTT_FORMAT_MAKEPRINT) - { - /* Make sure that the string is printable by changing all non-printable - chars to dots, or spaces for non-printable whitespace */ - for (cp = dest ; *cp ; cp++) - if (!IsPrint (*cp) && - !((flags & MUTT_FORMAT_TREE) && (*cp <= MUTT_TREE_MAX))) - *cp = isspace ((unsigned char) *cp) ? ' ' : '.'; - } -#endif } /* This function allows the user to specify a command to read stdout from in diff --git a/pager.c b/pager.c index 722abfeec..7c5890b61 100644 --- a/pager.c +++ b/pager.c @@ -765,13 +765,8 @@ resolve_types (char *buf, char *raw, struct line_t *lineInfo, int n, int last, } else if (mutt_strncmp ("\033[0m", raw, 4) == 0) /* a little hack... */ lineInfo[n].type = MT_COLOR_NORMAL; -#if 0 - else if (mutt_strncmp ("[-- ", buf, 4) == 0) - lineInfo[n].type = MT_COLOR_ATTACHMENT; -#else else if (check_attachment_marker ((char *) raw) == 0) lineInfo[n].type = MT_COLOR_ATTACHMENT; -#endif else if (mutt_strcmp ("-- \n", buf) == 0 || mutt_strcmp ("-- \r\n", buf) == 0) { i = n + 1; diff --git a/pattern.c b/pattern.c index 8d403c007..29b7ca611 100644 --- a/pattern.c +++ b/pattern.c @@ -323,12 +323,6 @@ static int eat_regexp (pattern_t *pat, BUFFER *s, BUFFER *err) return (-1); } -#if 0 - /* If there are no RE metacharacters, use simple search anyway */ - if (!pat->stringmatch && !strpbrk (buf.data, "|[{.*+?^$")) - pat->stringmatch = 1; -#endif - if (pat->stringmatch) { pat->p.str = safe_strdup (buf.data); diff --git a/pgp.c b/pgp.c index 71041f49a..d9f9dfd6b 100644 --- a/pgp.c +++ b/pgp.c @@ -1609,16 +1609,6 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist) b->filename = safe_strdup (pgpoutfile); -#if 0 - /* The following is intended to give a clue to some completely brain-dead - * "mail environments" which are typically used by large corporations. - */ - - b->d_filename = safe_strdup ("msg.pgp"); - b->use_disp = 1; - -#endif - b->disposition = DISPNONE; b->unlink = 1; diff --git a/pgpkey.c b/pgpkey.c index 988c354db..b1cf21810 100644 --- a/pgpkey.c +++ b/pgpkey.c @@ -633,11 +633,7 @@ static pgp_key_t pgp_select_key (pgp_key_t keys, } } -# if 0 - kp = pgp_principal_key (KeyTable[menu->current]->parent); -# else kp = KeyTable[menu->current]->parent; -# endif done = 1; break; diff --git a/pgplib.c b/pgplib.c index baaf8cf95..a828219e8 100644 --- a/pgplib.c +++ b/pgplib.c @@ -54,31 +54,6 @@ const char *pgp_pkalgbytype (unsigned char type) } } - - -/* unused */ - -#if 0 - -static const char *hashalgbytype (unsigned char type) -{ - switch (type) - { - case 1: - return "MD5"; - case 2: - return "SHA1"; - case 3: - return "RIPE-MD/160"; - case 4: - return "HAVAL"; - default: - return "unknown"; - } -} - -#endif - short pgp_canencrypt (unsigned char type) { switch (type) diff --git a/pgppubring.c b/pgppubring.c index 027b767d2..b80d49922 100644 --- a/pgppubring.c +++ b/pgppubring.c @@ -951,13 +951,3 @@ static void pgpring_dump_keyblock (pgp_key_t p) } } -#if 0 -/* - * The mutt_gettext () defined in gettext.c requires iconv, - * so we do without charset conversion here. - */ -static char *mutt_gettext (const char *message) -{ - return (char *)message; -} -#endif diff --git a/recvattach.c b/recvattach.c index 99e165e57..a65532b42 100644 --- a/recvattach.c +++ b/recvattach.c @@ -839,10 +839,6 @@ mutt_attach_display_loop (MUTTMENU *menu, int op, FILE *fp, HEADER *hdr, int recv) { ATTACHPTR **idx = *idxp; -#if 0 - int old_optweed = option (OPTWEED); - set_option (OPTWEED); -#endif do { @@ -905,10 +901,6 @@ mutt_attach_display_loop (MUTTMENU *menu, int op, FILE *fp, HEADER *hdr, } while (op != OP_NULL); -#if 0 - if (option (OPTWEED) != old_optweed) - toggle_option (OPTWEED); -#endif return op; } diff --git a/regex.c b/regex.c index 410fd84fc..16c8f2883 100644 --- a/regex.c +++ b/regex.c @@ -38,15 +38,6 @@ * the use of alloca. So let's disable it for AIX. */ -#if 0 - -/* AIX requires this to be the first thing in the file. */ -# if defined (_AIX) && !defined (REGEX_MALLOC) -# pragma alloca -# endif - -#endif - #undef _GNU_SOURCE #define _GNU_SOURCE @@ -300,11 +291,6 @@ init_syntax_once () #if HAVE_ALLOCA_H #include #else /* not __GNUC__ or HAVE_ALLOCA_H */ -#if 0 /* It is a bad idea to declare alloca. We always cast the result. */ -#ifndef _AIX /* Already did AIX, up at the top. */ -char *alloca (); -#endif /* not _AIX */ -#endif #endif /* not HAVE_ALLOCA_H */ #endif /* not __GNUC__ */ @@ -3652,15 +3638,6 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop) : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \ == Sword) -/* Disabled due to a compiler bug -- see comment at case wordbound */ -#if 0 -/* Test if the character before D and the one at D differ with respect - to being word-constituent. */ -#define AT_WORD_BOUNDARY(d) \ - (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \ - || WORDCHAR_P (d - 1) != WORDCHAR_P (d)) -#endif - /* Free everything we malloc. */ #ifdef MATCH_MAY_ALLOCATE #define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL @@ -4743,17 +4720,10 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) = *p2 == (unsigned char) endline ? '\n' : p2[2]; #endif -#if 0 - if ((re_opcode_t) p1[3] == exactn - && ! ((int) p2[1] * BYTEWIDTH > (int) p1[5] - && (p2[2 + p1[5] / BYTEWIDTH] - & (1 << (p1[5] % BYTEWIDTH))))) -#else if ((re_opcode_t) p1[3] == exactn && ! ((int) p2[1] * BYTEWIDTH > (int) p1[4] && (p2[2 + p1[4] / BYTEWIDTH] & (1 << (p1[4] % BYTEWIDTH))))) -#endif { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n", @@ -4954,24 +4924,6 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) break; } -#if 0 - /* The DEC Alpha C compiler 3.x generates incorrect code for the - test WORDCHAR_P (d - 1) != WORDCHAR_P (d) in the expansion of - AT_WORD_BOUNDARY, so this code is disabled. Expanding the - macro and introducing temporary variables works around the bug. */ - - case wordbound: - DEBUG_PRINT1 ("EXECUTING wordbound.\n"); - if (AT_WORD_BOUNDARY (d)) - break; - goto fail; - - case notwordbound: - DEBUG_PRINT1 ("EXECUTING notwordbound.\n"); - if (AT_WORD_BOUNDARY (d)) - goto fail; - break; -#else case wordbound: { boolean prevchar, thischar; @@ -5001,7 +4953,6 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) goto fail; break; } -#endif case wordbeg: DEBUG_PRINT1 ("EXECUTING wordbeg.\n"); diff --git a/rfc822.c b/rfc822.c index b457db97f..16748926e 100644 --- a/rfc822.c +++ b/rfc822.c @@ -900,11 +900,7 @@ int main (int argc, char **argv) { ADDRESS *list; char buf[256]; -# if 0 - char *str = "michael, Michael Elkins , testing a really complex address: this example <@contains.a.source.route,@with.multiple.hosts:address@example.com>;, lothar@of.the.hillpeople (lothar)"; -# else char *str = "a b c "; -# endif list = rfc822_parse_adrlist (NULL, str); buf[0] = 0; diff --git a/sendlib.c b/sendlib.c index 2663b1156..90fc58f02 100644 --- a/sendlib.c +++ b/sendlib.c @@ -1195,10 +1195,6 @@ static void mutt_set_encoding (BODY *b, CONTENT *info) else if (b->type == TYPEAPPLICATION && ascii_strcasecmp (b->subtype, "pgp-keys") == 0) b->encoding = ENC7BIT; else -#if 0 - if (info->lobin || info->hibin || info->binary || info->linemax > 990 - || info->cr || (/* option (OPTENCODEFROM) && */ info->from)) -#endif { /* Determine which encoding is smaller */ if (1.33 * (float)(info->lobin+info->hibin+info->ascii) < @@ -1207,10 +1203,6 @@ static void mutt_set_encoding (BODY *b, CONTENT *info) else b->encoding = ENCQUOTEDPRINTABLE; } -#if 0 - else - b->encoding = ENC7BIT; -#endif } void mutt_stamp_attachment(BODY *a) @@ -1365,22 +1357,8 @@ BODY *mutt_make_file_attach (const char *path) * suffix. */ -#if 0 - - if ((n = mutt_lookup_mime_type (buf, sizeof (buf), xbuf, sizeof (xbuf), path)) != TYPEOTHER - || *xbuf != '\0') - { - att->type = n; - att->subtype = safe_strdup (buf); - att->xtype = safe_strdup (xbuf); - } - -#else - mutt_lookup_mime_type (att, path); -#endif - if ((info = mutt_get_content_info (path, att)) == NULL) { mutt_free_body (&att); diff --git a/sha1.c b/sha1.c index 9d336e281..0cfc61d08 100644 --- a/sha1.c +++ b/sha1.c @@ -153,28 +153,11 @@ unsigned i; unsigned char finalcount[8]; unsigned char c; -#if 0 /* untested "improvement" by DHR */ - /* Convert context->count to a sequence of bytes - * in finalcount. Second element first, but - * big-endian order within element. - * But we do it all backwards. - */ - unsigned char *fcp = &finalcount[8]; - - for (i = 0; i < 2; i++) - { - uint32_t t = context->count[i]; - int j; - - for (j = 0; j < 4; t >>= 8, j++) - *--fcp = (unsigned char) t - } -#else for (i = 0; i < 8; i++) { finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)] >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */ } -#endif + c = 0200; SHA1Update(context, &c, 1); while ((context->count[0] & 504) != 448) { diff --git a/strcasestr.c b/strcasestr.c index 2f51ab8ee..7cfe00141 100644 --- a/strcasestr.c +++ b/strcasestr.c @@ -13,7 +13,6 @@ char *strcasestr(const char *s1, const char *s2) register const char *s = s1; register const char *p = s2; -#if 1 do { if (!*p) { return (char *) s1;; @@ -31,19 +30,4 @@ char *strcasestr(const char *s1, const char *s2) s = ++s1; } } while (1); -#else - while (*p && *s) { - if ((*p == *s) - || (tolower(*((unsigned char *)p)) == tolower(*((unsigned char *)s))) - ) { - ++p; - ++s; - } else { - p = s2; - s = ++s1; - } - } - - return (*p) ? NULL : (char *) s1; -#endif } diff --git a/wcwidth.c b/wcwidth.c index 0b494c79f..5ff6e09c4 100644 --- a/wcwidth.c +++ b/wcwidth.c @@ -167,17 +167,3 @@ int wcwidth_ucs(wchar_t ucs) #endif /* !HAVE_WC_FUNCS */ -#if 0 /* original */ -int wcswidth(const wchar_t *pwcs, size_t n) -{ - int w, width = 0; - - for (;*pwcs && n-- > 0; pwcs++) - if ((w = wcwidth(*pwcs)) < 0) - return -1; - else - width += w; - - return width; -} -#endif