diff --git a/address/address.c b/address/address.c index 50cfa163804..ffb99ed369b 100644 --- a/address/address.c +++ b/address/address.c @@ -698,7 +698,8 @@ void mutt_addr_cat(char *buf, size_t buflen, const char *value, const char *spec if (strpbrk(value, specials)) { - char tmp[256], *pc = tmp; + char tmp[256]; + char *pc = tmp; size_t tmplen = sizeof(tmp) - 3; *pc++ = '"'; diff --git a/address/group.c b/address/group.c index de18b5926c1..ffbfa759a99 100644 --- a/address/group.c +++ b/address/group.c @@ -103,7 +103,8 @@ void mutt_grouplist_clear(struct GroupList *head) if (!head) return; - struct GroupNode *np = STAILQ_FIRST(head), *next = NULL; + struct GroupNode *np = STAILQ_FIRST(head); + struct GroupNode *next = NULL; while (np) { group_remove(np->group); @@ -156,7 +157,8 @@ void mutt_grouplist_destroy(struct GroupList *head) if (!head) return; - struct GroupNode *np = STAILQ_FIRST(head), *next = NULL; + struct GroupNode *np = STAILQ_FIRST(head); + struct GroupNode *next = NULL; while (np) { next = STAILQ_NEXT(np, entries); @@ -176,7 +178,8 @@ static void group_add_addrlist(struct Group *g, struct Address *a) if (!g || !a) return; - struct Address **p = NULL, *q = NULL; + struct Address **p = NULL; + struct Address *q = NULL; for (p = &g->as; *p; p = &((*p)->next)) ; diff --git a/alias.c b/alias.c index d07f9310f01..dc3c8d8aa89 100644 --- a/alias.c +++ b/alias.c @@ -369,7 +369,8 @@ struct Address *mutt_get_address(struct Envelope *env, const char **pfxp) void mutt_alias_create(struct Envelope *cur, struct Address *iaddr) { struct Alias *new = NULL; - char buf[1024], tmp[1024], prompt[128], *pc = NULL; + char buf[1024], tmp[1024], prompt[128]; + char *pc = NULL; char *err = NULL; char fixed[1024]; struct Address *addr = NULL; diff --git a/email/parameter.c b/email/parameter.c index d90bcac8830..dbc9529dd7c 100644 --- a/email/parameter.c +++ b/email/parameter.c @@ -63,7 +63,8 @@ void mutt_param_free(struct ParameterList *p) if (!p) return; - struct Parameter *np = TAILQ_FIRST(p), *next = NULL; + struct Parameter *np = TAILQ_FIRST(p); + struct Parameter *next = NULL; while (np) { next = TAILQ_NEXT(np, entries); diff --git a/email/tags.c b/email/tags.c index ca0d8bf3e5a..d1fc589a420 100644 --- a/email/tags.c +++ b/email/tags.c @@ -115,7 +115,8 @@ void driver_tags_free(struct TagHead *head) if (!head) return; - struct TagNode *np = STAILQ_FIRST(head), *next = NULL; + struct TagNode *np = STAILQ_FIRST(head); + struct TagNode *next = NULL; while (np) { next = STAILQ_NEXT(np, entries); diff --git a/email/url.c b/email/url.c index 02b0676685a..f7ec6709c8d 100644 --- a/email/url.c +++ b/email/url.c @@ -291,7 +291,8 @@ void url_free(struct Url **u) if (!u || !*u) return; - struct UrlQueryString *np = STAILQ_FIRST(&(*u)->query_strings), *next = NULL; + struct UrlQueryString *np = STAILQ_FIRST(&(*u)->query_strings); + struct UrlQueryString *next = NULL; while (np) { next = STAILQ_NEXT(np, entries); diff --git a/flags.c b/flags.c index d121ade7148..5a0ee52525c 100644 --- a/flags.c +++ b/flags.c @@ -375,7 +375,8 @@ void mutt_emails_set_flag(struct Mailbox *m, struct EmailList *el, int flag, boo */ int mutt_thread_set_flag(struct Email *e, int flag, bool bf, bool subthread) { - struct MuttThread *start = NULL, *cur = e->thread; + struct MuttThread *start = NULL; + struct MuttThread *cur = e->thread; if ((C_Sort & SORT_MASK) != SORT_THREADS) { diff --git a/handler.c b/handler.c index f3bb0b9c560..0b86ea24664 100644 --- a/handler.c +++ b/handler.c @@ -436,7 +436,8 @@ static bool is_mmnoask(const char *buf) return false; char *p = NULL; - char tmp[1024], *q = NULL; + char tmp[1024]; + char *q = NULL; if (mutt_str_strcmp(val, "1") == 0) return true; diff --git a/hdrline.c b/hdrline.c index a47e2a4027d..df6abf4f449 100644 --- a/hdrline.c +++ b/hdrline.c @@ -553,7 +553,8 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co unsigned long data, MuttFormatFlags flags) { struct HdrFormatInfo *hfi = (struct HdrFormatInfo *) data; - char fmt[128], tmp[1024], *p = NULL, *tags = NULL; + char fmt[128], tmp[1024]; + char *p = NULL, *tags = NULL; int optional = (flags & MUTT_FORMAT_OPTIONAL); int threads = ((C_Sort & SORT_MASK) == SORT_THREADS); int is_index = (flags & MUTT_FORMAT_INDEX); diff --git a/init.c b/init.c index 43c12bcaba5..18e62fc1a20 100644 --- a/init.c +++ b/init.c @@ -1002,7 +1002,8 @@ static enum CommandResult parse_alternates(struct Buffer *buf, struct Buffer *s, static enum CommandResult parse_attachments(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) { - char op, *category = NULL; + char op; + char *category = NULL; struct ListHead *head = NULL; mutt_extract_token(buf, s, MUTT_TOKEN_NO_FLAGS); @@ -2280,7 +2281,8 @@ static enum CommandResult parse_unalternates(struct Buffer *buf, struct Buffer * static enum CommandResult parse_unattachments(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) { - char op, *p = NULL; + char op; + char *p = NULL; struct ListHead *head = NULL; mutt_extract_token(buf, s, MUTT_TOKEN_NO_FLAGS); diff --git a/keymap.c b/keymap.c index 356658c96e3..d2f557c631f 100644 --- a/keymap.c +++ b/keymap.c @@ -471,7 +471,8 @@ const char *mutt_get_func(const struct Binding *bindings, int op) */ static void generic_tokenize_push_string(char *s, void (*generic_push)(int, int)) { - char *pp = NULL, *p = s + mutt_str_strlen(s) - 1; + char *pp = NULL; + char *p = s + mutt_str_strlen(s) - 1; size_t l; int i, op = OP_NULL; diff --git a/maildir/maildir.c b/maildir/maildir.c index 7bf204920b7..ef972ae0234 100644 --- a/maildir/maildir.c +++ b/maildir/maildir.c @@ -365,7 +365,8 @@ int maildir_mbox_check(struct Mailbox *m, int *index_hint) int num_new = 0; /* number of new messages added to the mailbox */ bool flags_changed = false; /* message flags were changed in the mailbox */ struct Maildir *md = NULL; /* list of messages in the mailbox */ - struct Maildir **last = NULL, *p = NULL; + struct Maildir **last = NULL; + struct Maildir *p = NULL; int count = 0; struct Hash *fnames = NULL; /* hash table for quickly looking up the base filename for a maildir message */ diff --git a/mutt/list.c b/mutt/list.c index 5c252aeb5e1..805b3a57f68 100644 --- a/mutt/list.c +++ b/mutt/list.c @@ -119,7 +119,8 @@ void mutt_list_free(struct ListHead *h) if (!h) return; - struct ListNode *np = STAILQ_FIRST(h), *next = NULL; + struct ListNode *np = STAILQ_FIRST(h); + struct ListNode *next = NULL; while (np) { next = STAILQ_NEXT(np, entries); @@ -140,7 +141,8 @@ void mutt_list_free_type(struct ListHead *h, list_free_t fn) if (!h || !fn) return; - struct ListNode *np = STAILQ_FIRST(h), *next = NULL; + struct ListNode *np = STAILQ_FIRST(h); + struct ListNode *next = NULL; while (np) { next = STAILQ_NEXT(np, entries); @@ -162,7 +164,8 @@ void mutt_list_clear(struct ListHead *h) if (!h) return; - struct ListNode *np = STAILQ_FIRST(h), *next = NULL; + struct ListNode *np = STAILQ_FIRST(h); + struct ListNode *next = NULL; while (np) { next = STAILQ_NEXT(np, entries); diff --git a/mutt_thread.c b/mutt_thread.c index 246198b26bf..92e24c4c082 100644 --- a/mutt_thread.c +++ b/mutt_thread.c @@ -76,7 +76,8 @@ static bool is_visible(struct Email *e, struct Context *ctx) */ static bool need_display_subject(struct Context *ctx, struct Email *e) { - struct MuttThread *tmp = NULL, *tree = e->thread; + struct MuttThread *tmp = NULL; + struct MuttThread *tree = e->thread; /* if the user disabled subject hiding, display it */ if (!C_HideThreadSubject) @@ -172,7 +173,8 @@ static void linearize_tree(struct Context *ctx) */ static void calculate_visibility(struct Context *ctx, int *max_depth) { - struct MuttThread *tmp = NULL, *tree = ctx->tree; + struct MuttThread *tmp = NULL; + struct MuttThread *tree = ctx->tree; int hide_top_missing = C_HideTopMissing && !C_HideMissing; int hide_top_limited = C_HideTopLimited && !C_HideLimited; int depth = 0; @@ -290,7 +292,8 @@ void mutt_draw_tree(struct Context *ctx) enum TreeChar corner = (C_Sort & SORT_REVERSE) ? MUTT_TREE_ULCORNER : MUTT_TREE_LLCORNER; enum TreeChar vtee = (C_Sort & SORT_REVERSE) ? MUTT_TREE_BTEE : MUTT_TREE_TTEE; int depth = 0, start_depth = 0, max_depth = 0, width = C_NarrowTree ? 1 : 2; - struct MuttThread *nextdisp = NULL, *pseudo = NULL, *parent = NULL, *tree = ctx->tree; + struct MuttThread *nextdisp = NULL, *pseudo = NULL, *parent = NULL; + struct MuttThread *tree = ctx->tree; /* Do the visibility calculations and free the old thread chars. * From now on we can simply ignore invisible subtrees */ @@ -533,7 +536,8 @@ static void pseudo_threads(struct Context *ctx) struct Mailbox *m = ctx->mailbox; - struct MuttThread *tree = ctx->tree, *top = tree; + struct MuttThread *tree = ctx->tree; + struct MuttThread *top = tree; struct MuttThread *tmp = NULL, *cur = NULL, *parent = NULL, *curchild = NULL, *nextchild = NULL; diff --git a/muttlib.c b/muttlib.c index fbdcfe42553..ad20439e2e0 100644 --- a/muttlib.c +++ b/muttlib.c @@ -836,7 +836,9 @@ void mutt_safe_path(char *buf, size_t buflen, struct Address *a) void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const char *src, format_t *callback, unsigned long data, MuttFormatFlags flags) { - char prefix[128], tmp[1024], *cp = NULL, *wptr = buf, ch; + char prefix[128], tmp[1024]; + char *cp = NULL, *wptr = buf; + char ch; char if_str[128], else_str[128]; size_t wlen, count, len, wid; FILE *fp_filter = NULL; diff --git a/ncrypt/smime.c b/ncrypt/smime.c index 061c12140ff..22c6b287d54 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -1348,7 +1348,8 @@ static char *smime_extract_signer_certificate(char *infile) */ void smime_class_invoke_import(char *infile, char *mailbox) { - char *certfile = NULL, buf[256]; + char *certfile = NULL; + char buf[256]; FILE *fp_smime_in = NULL; FILE *fp_err = mutt_file_mkstemp(); @@ -1419,7 +1420,8 @@ void smime_class_invoke_import(char *infile, char *mailbox) */ int smime_class_verify_sender(struct Email *e) { - char *mbox = NULL, *certfile = NULL, tempfname[PATH_MAX]; + char *mbox = NULL, *certfile = NULL; + char tempfname[PATH_MAX]; int rc = 1; mutt_mktemp(tempfname, sizeof(tempfname)); diff --git a/nntp/nntp.c b/nntp/nntp.c index 16715b521d1..bdf880156e3 100644 --- a/nntp/nntp.c +++ b/nntp/nntp.c @@ -2668,7 +2668,8 @@ static int nntp_mbox_close(struct Mailbox *m) if (!m) return -1; - struct NntpMboxData *mdata = m->mdata, *tmp_mdata = NULL; + struct NntpMboxData *mdata = m->mdata; + struct NntpMboxData *tmp_mdata = NULL; if (!mdata) return 0; diff --git a/pgpewrap.c b/pgpewrap.c index 8b8526a7a62..e4f5ca07bbc 100644 --- a/pgpewrap.c +++ b/pgpewrap.c @@ -21,7 +21,8 @@ static void print_usage(const char *progname) int main(int argc, char **argv) { - char **opts = NULL, **opt = NULL, *pfx = NULL; + char **opts = NULL, **opt = NULL; + char *pfx = NULL; if (argc < 2) { diff --git a/remailer.c b/remailer.c index 0f284f8daab..3ad72eceb49 100644 --- a/remailer.c +++ b/remailer.c @@ -166,7 +166,8 @@ static struct Remailer **mix_type2_list(size_t *l) char line[8192]; char *t = NULL; - struct Remailer **type2_list = NULL, *p = NULL; + struct Remailer **type2_list = NULL; + struct Remailer *p = NULL; size_t slots = 0, used = 0; int fd_null = open("/dev/null", O_RDWR); diff --git a/send.c b/send.c index 4d86c43544e..503e77fe193 100644 --- a/send.c +++ b/send.c @@ -548,7 +548,8 @@ static int include_forward(struct Mailbox *m, struct Email *e, FILE *fp_out) static int inline_forward_attachments(struct Mailbox *m, struct Email *cur, struct Body ***plast, int *forwardq) { - struct Body **last = *plast, *body = NULL; + struct Body **last = *plast; + struct Body *body = NULL; struct Message *msg = NULL; struct AttachCtx *actx = NULL; int rc = 0, i; diff --git a/sendlib.c b/sendlib.c index bafacaeccdd..849d681bd04 100644 --- a/sendlib.c +++ b/sendlib.c @@ -1992,7 +1992,8 @@ static int fold_one_header(FILE *fp, const char *tag, const char *value, */ static char *unfold_header(char *s) { - char *p = s, *q = s; + char *p = s; + char *q = s; while (p && (p[0] != '\0')) { @@ -2126,7 +2127,8 @@ static int write_one_header(FILE *fp, int pfxw, int max, int wraplen, const char int mutt_write_one_header(FILE *fp, const char *tag, const char *value, const char *pfx, int wraplen, CopyHeaderFlags chflags) { - char *p = (char *) value, *last = NULL, *line = NULL; + char *p = (char *) value; + char *last = NULL, *line = NULL; int max = 0, w, rc = -1; int pfxw = mutt_strwidth(pfx); char *v = mutt_str_strdup(value);