From: Richard Russon Date: Sun, 19 Aug 2018 02:30:02 +0000 (+0100) Subject: kill assign-assign X-Git-Tag: 2019-10-25~687^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=154c4dc55c2edd24d3dacb794e7cecf08e78cda3;p=neomutt kill assign-assign --- diff --git a/alias.c b/alias.c index 3438d6a52..4068af96e 100644 --- a/alias.c +++ b/alias.c @@ -85,7 +85,10 @@ static struct Address *expand_aliases_r(struct Address *a, struct ListHead *expn if (head) last->next = w; else - head = last = w; + { + head = w; + last = w; + } while (last && last->next) last = last->next; } @@ -115,7 +118,10 @@ static struct Address *expand_aliases_r(struct Address *a, struct ListHead *expn last = last->next; } else - head = last = a; + { + head = a; + last = a; + } a = a->next; last->next = NULL; } diff --git a/color.c b/color.c index aba956ec0..0ee914570 100644 --- a/color.c +++ b/color.c @@ -154,8 +154,8 @@ static struct ColorLine *new_color_line(void) { struct ColorLine *p = mutt_mem_calloc(1, sizeof(struct ColorLine)); - p->fg = p->bg = -1; - + p->fg = -1; + p->bg = -1; return p; } @@ -367,11 +367,12 @@ static int mutt_lookup_color(short pair, short *fg, short *bg) */ int mutt_combine_color(int fg_attr, int bg_attr) { - short fg, bg; + short fg = COLOR_DEFAULT; + short bg = COLOR_DEFAULT; - fg = bg = COLOR_DEFAULT; mutt_lookup_color(fg_attr, &fg, NULL); mutt_lookup_color(bg_attr, NULL, &bg); + if ((fg == COLOR_DEFAULT) && (bg == COLOR_DEFAULT)) return A_NORMAL; return mutt_alloc_color(fg, bg); diff --git a/compose.c b/compose.c index 8b7082378..42b4cc4aa 100644 --- a/compose.c +++ b/compose.c @@ -1202,7 +1202,8 @@ int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen, * and remove from the msg->content list */ if (!alts) { - group->parts = alts = bptr; + group->parts = bptr; + alts = bptr; bptr = bptr->next; alts->next = NULL; } @@ -1300,7 +1301,8 @@ int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen, * and remove from the msg->content list */ if (!alts) { - group->parts = alts = bptr; + group->parts = bptr; + alts = bptr; bptr = bptr->next; alts->next = NULL; } diff --git a/config/mbtable.c b/config/mbtable.c index 7641bb431..c1cafdf8b 100644 --- a/config/mbtable.c +++ b/config/mbtable.c @@ -61,7 +61,8 @@ struct MbTable *mbtable_parse(const char *s) /* This could be more space efficient. However, being used on tiny * strings (Tochars and StatusChars), the overhead is not great. */ t->chars = mutt_mem_calloc(slen, sizeof(char *)); - d = t->segmented_str = mutt_mem_calloc(slen * 2, sizeof(char)); + t->segmented_str = mutt_mem_calloc(slen * 2, sizeof(char)); + d = t->segmented_str; memset(&mbstate, 0, sizeof(mbstate)); while (slen && (k = mbrtowc(NULL, s, slen, &mbstate))) diff --git a/copy.c b/copy.c index a1d086b20..8b5c1891b 100644 --- a/copy.c +++ b/copy.c @@ -221,7 +221,8 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, { if ((flags & CH_FROM) == 0) continue; - this_is_from = from = true; + this_is_from = true; + from = true; } else if (buf[0] == '\n' || (buf[0] == '\r' && buf[1] == '\n')) break; /* end of header */ @@ -949,7 +950,9 @@ static void format_address_header(char **h, struct Address *a) { struct Address *tmp = a->next; a->next = NULL; - *buf = *cbuf = *c2buf = '\0'; + *buf = '\0'; + *cbuf = '\0'; + *c2buf = '\0'; const size_t l = mutt_addr_write(buf, sizeof(buf), a, false); a->next = tmp; diff --git a/curs_lib.c b/curs_lib.c index 7d54af5d7..131afe25a 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -289,16 +289,14 @@ int mutt_yesorno(const char *msg, int def) char *expr = NULL; regex_t reyes; regex_t reno; - int reyes_ok; - int reno_ok; char answer[2]; answer[1] = '\0'; - reyes_ok = (expr = nl_langinfo(YESEXPR)) && (expr[0] == '^') && - (REGCOMP(&reyes, expr, REG_NOSUB) == 0); - reno_ok = (expr = nl_langinfo(NOEXPR)) && (expr[0] == '^') && - (REGCOMP(&reno, expr, REG_NOSUB) == 0); + bool reyes_ok = (expr = nl_langinfo(YESEXPR)) && (expr[0] == '^') && + (REGCOMP(&reyes, expr, REG_NOSUB) == 0); + bool reno_ok = (expr = nl_langinfo(NOEXPR)) && (expr[0] == '^') && + (REGCOMP(&reno, expr, REG_NOSUB) == 0); /* In order to prevent the default answer to the question to wrapped * around the screen in the even the question is wider than the screen, diff --git a/edit.c b/edit.c index d1f775760..bb06bd21b 100644 --- a/edit.c +++ b/edit.c @@ -511,7 +511,8 @@ int mutt_builtin_editor(const char *path, struct Header *msg, struct Header *cur char *tag = NULL, *err = NULL; be_free_memory(buf, buflen); buf = NULL; - bufmax = buflen = 0; + bufmax = 0; + buflen = 0; if (EditHeaders) { diff --git a/editmsg.c b/editmsg.c index bbd404cc5..3553e67c1 100644 --- a/editmsg.c +++ b/editmsg.c @@ -209,7 +209,8 @@ static int edit_or_view_one_message(bool edit, struct Context *ctx, struct Heade o_read = cur->read; o_old = cur->old; - cur->read = cur->old = false; + cur->read = false; + cur->old = false; msg = mx_msg_open_new(&tmpctx, cur, of); cur->read = o_read; cur->old = o_old; diff --git a/email/address.c b/email/address.c index 55b6ba0dc..036200880 100644 --- a/email/address.c +++ b/email/address.c @@ -743,7 +743,10 @@ struct Address *mutt_addr_copy_list(struct Address *addr, bool prune) last = last->next; } else - top = last = mutt_addr_copy(addr); + { + last = mutt_addr_copy(addr); + top = last; + } } return top; } @@ -768,7 +771,10 @@ struct Address *mutt_addr_append(struct Address **a, struct Address *b, bool pru if (tmp) tmp->next = mutt_addr_copy_list(b, prune); else - tmp = *a = mutt_addr_copy_list(b, prune); + { + *a = mutt_addr_copy_list(b, prune); + tmp = *a; + } while (tmp && tmp->next) tmp = tmp->next; return tmp; diff --git a/email/parse.c b/email/parse.c index 74392abd2..e47228f57 100644 --- a/email/parse.c +++ b/email/parse.c @@ -309,7 +309,8 @@ char *mutt_extract_message_id(const char *s, const char **saveptr) if (*p == '<') { s = p; - o = onull = NULL; + o = NULL; + onull = NULL; continue; } @@ -339,7 +340,9 @@ char *mutt_extract_message_id(const char *s, const char **saveptr) else if (o) { /* more than two lines, give up */ - s = o = onull = NULL; + s = NULL; + o = NULL; + onull = NULL; } else { @@ -1342,7 +1345,10 @@ struct Body *mutt_parse_multipart(FILE *fp, const char *boundary, LOFF_T end_off last = new; } else - last = head = new; + { + last = new; + head = new; + } } } } diff --git a/email/rfc2047.c b/email/rfc2047.c index 7b4a1c7b9..f3e7966a9 100644 --- a/email/rfc2047.c +++ b/email/rfc2047.c @@ -447,7 +447,10 @@ static int encode(const char *d, size_t dlen, int col, const char *fromcode, ulen = mutt_str_strlen(u); /* Find earliest and latest things we must encode. */ - s0 = s1 = t0 = t1 = 0; + s0 = 0; + s1 = 0; + t0 = 0; + t1 = 0; for (t = u; t < (u + ulen); t++) { if ((*t & 0x80) || ((*t == '=') && (t[1] == '?') && ((t == u) || HSPACE(*(t - 1))))) diff --git a/email/thread.c b/email/thread.c index d7709de27..cf72844ac 100644 --- a/email/thread.c +++ b/email/thread.c @@ -204,7 +204,8 @@ void clean_references(struct MuttThread *brk, struct MuttThread *cur) FREE(&np); } - h->env->refs_changed = h->changed = true; + h->env->refs_changed = true; + h->changed = true; } } } diff --git a/enter.c b/enter.c index f7e36d700..47974ba01 100644 --- a/enter.c +++ b/enter.c @@ -327,7 +327,8 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, bool mu break; case OP_EDITOR_KILL_LINE: - state->curpos = state->lastchar = 0; + state->curpos = 0; + state->lastchar = 0; break; case OP_EDITOR_KILL_EOL: @@ -743,7 +744,10 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, bool mu { first = 0; if (IsWPrint(wc)) /* why? */ - state->curpos = state->lastchar = 0; + { + state->curpos = 0; + state->lastchar = 0; + } } if (wc == '\r' || wc == '\n') diff --git a/hcache/bdb.c b/hcache/bdb.c index 105cf129b..f061ccd10 100644 --- a/hcache/bdb.c +++ b/hcache/bdb.c @@ -62,8 +62,10 @@ struct HcacheDbCtx static void dbt_init(DBT *dbt, void *data, size_t len) { dbt->data = data; - dbt->size = dbt->ulen = len; - dbt->dlen = dbt->doff = 0; + dbt->size = len; + dbt->ulen = len; + dbt->dlen = 0; + dbt->doff = 0; dbt->flags = DB_DBT_USERMEM; } @@ -74,7 +76,10 @@ static void dbt_init(DBT *dbt, void *data, size_t len) static void dbt_empty_init(DBT *dbt) { dbt->data = NULL; - dbt->size = dbt->ulen = dbt->dlen = dbt->doff = 0; + dbt->size = 0; + dbt->ulen = 0; + dbt->dlen = 0; + dbt->doff = 0; dbt->flags = 0; } diff --git a/imap/imap.c b/imap/imap.c index 323d96680..1c2902e38 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -1103,7 +1103,10 @@ void imap_close_connection(struct ImapData *idata) mutt_socket_close(idata->conn); idata->state = IMAP_DISCONNECTED; } - idata->seqno = idata->nextcmd = idata->lastcmd = idata->status = false; + idata->seqno = false; + idata->nextcmd = false; + idata->lastcmd = false; + idata->status = false; memset(idata->cmds, 0, sizeof(struct ImapCommand) * idata->cmdslots); } diff --git a/imap/message.c b/imap/message.c index fa48ce9b4..c1414b1df 100644 --- a/imap/message.c +++ b/imap/message.c @@ -218,7 +218,11 @@ static char *msg_parse_flags(struct ImapHeader *h, char *s) FREE(&hd->flags_system); FREE(&hd->flags_remote); - hd->deleted = hd->flagged = hd->replied = hd->read = hd->old = false; + hd->deleted = false; + hd->flagged = false; + hd->replied = false; + hd->read = false; + hd->old = false; /* start parsing */ while (*s && *s != ')') @@ -1281,7 +1285,9 @@ int imap_append_message(struct Context *ctx, struct Message *msg) imap_munge_mbox_name(idata, mbox, sizeof(mbox), mailbox); mutt_date_make_imap(internaldate, sizeof(internaldate), msg->received); - imap_flags[0] = imap_flags[1] = 0; + imap_flags[0] = 0; + imap_flags[1] = 0; + if (msg->flags.read) mutt_str_strcat(imap_flags, sizeof(imap_flags), " \\Seen"); if (msg->flags.replied) diff --git a/init.c b/init.c index 4cd780dac..0d9e0cc0c 100644 --- a/init.c +++ b/init.c @@ -2931,7 +2931,8 @@ int mutt_init(bool skip_sys_rc, struct ListHead *commands) snprintf(buffer, sizeof(buffer), "Reply-To: %s", p); mutt_buffer_init(&buf); - buf.data = buf.dptr = buffer; + buf.data = buffer; + buf.dptr = buffer; buf.dsize = mutt_str_strlen(buffer); mutt_buffer_init(&token); @@ -3172,7 +3173,8 @@ int mutt_parse_rc_line(/* const */ char *line, struct Buffer *token, struct Buff return 0; mutt_buffer_init(&expn); - expn.data = expn.dptr = line; + expn.data = line; + expn.dptr = line; expn.dsize = mutt_str_strlen(line); *err->data = 0; diff --git a/main.c b/main.c index e72140273..f898e69b8 100644 --- a/main.c +++ b/main.c @@ -1041,7 +1041,10 @@ int main(int argc, char *argv[], char *envp[]) a = a->next; } else - msg->content = a = mutt_make_file_attach(np->data); + { + a = mutt_make_file_attach(np->data); + msg->content = a; + } if (!a) { mutt_error(_("%s: unable to attach file"), np->data); diff --git a/mbox/mbox.c b/mbox/mbox.c index ba0a070b1..55850b6f9 100644 --- a/mbox/mbox.c +++ b/mbox/mbox.c @@ -162,7 +162,8 @@ static int mmdf_parse_mailbox(struct Context *ctx) if (ctx->msgcount == ctx->hdrmax) mx_alloc_memory(ctx); - ctx->hdrs[ctx->msgcount] = hdr = mutt_header_new(); + hdr = mutt_header_new(); + ctx->hdrs[ctx->msgcount] = hdr; hdr->offset = loc; hdr->index = ctx->msgcount; @@ -333,7 +334,8 @@ static int mbox_parse_mailbox(struct Context *ctx) if (ctx->msgcount == ctx->hdrmax) mx_alloc_memory(ctx); - curhdr = ctx->hdrs[ctx->msgcount] = mutt_header_new(); + ctx->hdrs[ctx->msgcount] = mutt_header_new(); + curhdr = ctx->hdrs[ctx->msgcount]; curhdr->received = t - mutt_date_local_tz(t); curhdr->offset = loc; curhdr->index = ctx->msgcount; diff --git a/mutt/charset.c b/mutt/charset.c index edafdff7d..3a240300a 100644 --- a/mutt/charset.c +++ b/mutt/charset.c @@ -746,7 +746,8 @@ int mutt_ch_convert_string(char **ps, const char *from, const char *to, int flag ib = s; ibl = len + 1; obl = MB_LEN_MAX * ibl; - ob = buf = mutt_mem_malloc(obl + 1); + buf = mutt_mem_malloc(obl + 1); + ob = buf; mutt_ch_iconv(cd, &ib, &ibl, &ob, &obl, inrepls, outrepl, &rc); iconv_close(cd); @@ -823,7 +824,8 @@ struct FgetConv *mutt_ch_fgetconv_open(FILE *file, const char *from, const char static const char *repls[] = { "\357\277\275", "?", 0 }; fc = mutt_mem_malloc(sizeof(struct FgetConv)); - fc->p = fc->ob = fc->bufo; + fc->p = fc->bufo; + fc->ob = fc->bufo; fc->ib = fc->bufi; fc->ibl = 0; fc->inrepls = mutt_ch_is_utf8(to) ? repls : repls + 1; @@ -868,7 +870,8 @@ int mutt_ch_fgetconv(struct FgetConv *fc) return (unsigned char) *(fc->p)++; /* Try to convert some more */ - fc->p = fc->ob = fc->bufo; + fc->p = fc->bufo; + fc->ob = fc->bufo; if (fc->ibl) { size_t obl = sizeof(fc->bufo); diff --git a/mutt/history.c b/mutt/history.c index c5b4aa0d2..404e711e0 100644 --- a/mutt/history.c +++ b/mutt/history.c @@ -368,7 +368,8 @@ static void remove_history_dups(enum HistoryClass hclass, const char *str) return; /* disabled */ /* Remove dups from 0..last-1 compacting up. */ - source = dest = 0; + source = 0; + dest = 0; while (source < h->last) { if (mutt_str_strcmp(h->hist[source], str) == 0) @@ -387,7 +388,8 @@ static void remove_history_dups(enum HistoryClass hclass, const char *str) h->hist[source--] = NULL; /* Remove dups from last+1 .. History compacting down. */ - source = dest = History; + source = History; + dest = History; while (source > old_last) { if (mutt_str_strcmp(h->hist[source], str) == 0) diff --git a/mutt/md5.c b/mutt/md5.c index 313e01899..d05ac8883 100644 --- a/mutt/md5.c +++ b/mutt/md5.c @@ -263,7 +263,8 @@ void mutt_md5_init_ctx(struct Md5Ctx *ctx) ctx->C = 0x98badcfe; ctx->D = 0x10325476; - ctx->total[0] = ctx->total[1] = 0; + ctx->total[0] = 0; + ctx->total[1] = 0; ctx->buflen = 0; } diff --git a/mutt/sha1.c b/mutt/sha1.c index 29358d23a..284d4671c 100644 --- a/mutt/sha1.c +++ b/mutt/sha1.c @@ -168,7 +168,11 @@ void mutt_sha1_transform(uint32_t state[5], const unsigned char buffer[64]) state[3] += d; state[4] += e; /* Wipe variables */ - a = b = c = d = e = 0; + a = 0; + b = 0; + c = 0; + d = 0; + e = 0; memset(block, '\0', sizeof(block)); } @@ -184,7 +188,8 @@ void mutt_sha1_init(struct Sha1Ctx *context) context->state[2] = 0x98BADCFE; context->state[3] = 0x10325476; context->state[4] = 0xC3D2E1F0; - context->count[0] = context->count[1] = 0; + context->count[0] = 0; + context->count[1] = 0; } /** diff --git a/mutt_lua.c b/mutt_lua.c index f4a86b126..7b4a0b746 100644 --- a/mutt_lua.c +++ b/mutt_lua.c @@ -107,7 +107,8 @@ static int lua_mutt_call(lua_State *l) mutt_str_strncat(buffer, sizeof(buffer), " ", 1); } - expn.data = expn.dptr = buffer; + expn.data = buffer; + expn.dptr = buffer; expn.dsize = mutt_str_strlen(buffer); if (command->func(&token, &expn, command->data, &err)) diff --git a/mutt_thread.c b/mutt_thread.c index 16551e948..a3dc52188 100644 --- a/mutt_thread.c +++ b/mutt_thread.c @@ -638,7 +638,8 @@ struct MuttThread *mutt_sort_subthreads(struct MuttThread *thread, bool init) top = thread; - array = mutt_mem_calloc((array_size = 256), sizeof(struct MuttThread *)); + array_size = 256; + array = mutt_mem_calloc(array_size, sizeof(struct MuttThread *)); while (true) { if (init || !thread->sort_key) @@ -822,7 +823,10 @@ void mutt_sort_threads(struct Context *ctx, bool init) /* we want a quick way to see if things are actually attached to the top of the * thread tree or if they're just dangling, so we attach everything to a top * node temporarily */ - top.parent = top.next = top.prev = NULL; + top.parent = NULL; + top.next = NULL; + top.prev = NULL; + top.child = ctx->tree; for (thread = ctx->tree; thread; thread = thread->next) thread->parent = ⊤ @@ -1415,7 +1419,8 @@ static bool link_threads(struct Header *parent, struct Header *child, struct Con mutt_list_insert_head(&child->env->in_reply_to, mutt_str_strdup(parent->env->message_id)); mutt_set_flag(ctx, child, MUTT_TAG, 0); - child->env->irt_changed = child->changed = true; + child->env->irt_changed = true; + child->changed = true; return true; } diff --git a/muttlib.c b/muttlib.c index e6be323ec..22a10717d 100644 --- a/muttlib.c +++ b/muttlib.c @@ -218,9 +218,11 @@ char *mutt_expand_path_regex(char *buf, size_t buflen, bool regex) { struct Header *h = mutt_header_new(); h->env = mutt_env_new(); - h->env->from = h->env->to = alias; + h->env->from = alias; + h->env->to = alias; mutt_default_save(p, sizeof(p), h); - h->env->from = h->env->to = NULL; + h->env->from = NULL; + h->env->to = NULL; mutt_header_free(&h); /* Avoid infinite recursion if the resulting folder starts with '@' */ if (*p != '@') @@ -1078,7 +1080,10 @@ void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const c int pl, pw; pl = mutt_mb_charlen(src, &pw); if (pl <= 0) - pl = pw = 1; + { + pl = 1; + pw = 1; + } /* see if there's room to add content, else ignore */ if ((col < cols && wlen < buflen) || soft) @@ -1149,7 +1154,10 @@ void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const c int pl, pw; pl = mutt_mb_charlen(src, &pw); if (pl <= 0) - pl = pw = 1; + { + pl = 1; + pw = 1; + } /* see if there's room to add content, else ignore */ if (col < cols && wlen < buflen) diff --git a/ncrypt/crypt.c b/ncrypt/crypt.c index 92367c8b2..73014ec14 100644 --- a/ncrypt/crypt.c +++ b/ncrypt/crypt.c @@ -270,7 +270,8 @@ int mutt_protect(struct Header *msg, char *keylist) tmp_pbody = crypt_smime_sign_message(msg->content); if (!tmp_pbody) return -1; - pbody = tmp_smime_pbody = tmp_pbody; + pbody = tmp_pbody; + tmp_smime_pbody = tmp_pbody; } if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP) && @@ -281,7 +282,8 @@ int mutt_protect(struct Header *msg, char *keylist) return -1; flags &= ~SIGN; - pbody = tmp_pgp_pbody = tmp_pbody; + pbody = tmp_pbody; + tmp_pgp_pbody = tmp_pbody; } if ((WithCrypto != 0) && (msg->security & APPLICATION_SMIME) && @@ -1256,19 +1258,22 @@ const char *crypt_get_fingerprint_or_id(char *p, const char **pphint, if (pfcopy) { /* Use pfcopy to strip all spaces from fingerprint and as hint. */ - s1 = s2 = pfcopy; + s1 = pfcopy; + s2 = pfcopy; do { *(s1++) = *(s2 = mutt_str_skip_whitespace(s2)); } while (*(s2++)); phint = pfcopy; - ps = pl = NULL; + ps = NULL; + pl = NULL; } else { phint = p; - ps = pl = NULL; + ps = NULL; + pl = NULL; if (isid == 1) { if (mutt_str_strlen(pf) == 16) diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index 0e597be84..a4246b29f 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -4054,7 +4054,8 @@ static char *list_to_pattern(struct ListHead *list) n++; /* delimiter or end of string */ } n++; /* make sure to allocate at least one byte */ - pattern = p = mutt_mem_calloc(1, n); + p = mutt_mem_calloc(1, n); + pattern = p; STAILQ_FOREACH(np, list, entries) { s = np->data; @@ -4292,7 +4293,8 @@ static struct CryptKeyInfo *crypt_select_key(struct CryptKeyInfo *keys, *forced_valid = 0; /* build the key table */ - keymax = i = 0; + keymax = 0; + i = 0; struct CryptKeyInfo **key_table = NULL; for (k = keys; k; k = k->next) { @@ -4565,7 +4567,8 @@ static struct CryptKeyInfo *crypt_getkeybyaddr(struct Address *a, { struct CryptKeyInfo *tmp = NULL; - *matches_endp = tmp = crypt_copy_key(k); + tmp = crypt_copy_key(k); + *matches_endp = tmp; matches_endp = &tmp->next; if (this_key_has_strong) @@ -4658,7 +4661,8 @@ static struct CryptKeyInfo *crypt_getkeybystr(char *p, short abilities, mutt_debug(5, "match.\n"); - *matches_endp = tmp = crypt_copy_key(k); + tmp = crypt_copy_key(k); + *matches_endp = tmp; matches_endp = &tmp->next; } else diff --git a/ncrypt/gnupgparse.c b/ncrypt/gnupgparse.c index 10f0bc152..07ac6a2e9 100644 --- a/ncrypt/gnupgparse.c +++ b/ncrypt/gnupgparse.c @@ -80,7 +80,7 @@ static void fix_uid(char *uid) char *s = NULL, *d = NULL; iconv_t cd; - for (s = d = uid; *s;) + for (s = uid, d = uid; *s;) { if (*s == '\\' && *(s + 1) == 'x' && isxdigit((unsigned char) *(s + 2)) && isxdigit((unsigned char) *(s + 3))) @@ -435,7 +435,8 @@ struct PgpKeyInfo *pgp_get_candidates(enum PgpRing keyring, struct ListHead *hin { if (k) kend = &k->next; - *kend = k = kk; + *kend = kk; + k = kk; if (is_sub) { diff --git a/nntp/nntp.c b/nntp/nntp.c index 2cc95be62..c57414c68 100644 --- a/nntp/nntp.c +++ b/nntp/nntp.c @@ -1188,7 +1188,8 @@ static int parse_overview_line(char *line, void *data) mx_alloc_memory(ctx); /* parse header */ - hdr = ctx->hdrs[ctx->msgcount] = mutt_header_new(); + ctx->hdrs[ctx->msgcount] = mutt_header_new(); + hdr = ctx->hdrs[ctx->msgcount]; hdr->env = mutt_rfc822_read_header(fp, hdr, false, false); hdr->env->newsgroups = mutt_str_strdup(nntp_data->group); hdr->received = hdr->date_sent; @@ -1206,7 +1207,8 @@ static int parse_overview_line(char *line, void *data) { mutt_debug(2, "mutt_hcache_fetch %s\n", buf); mutt_header_free(&hdr); - ctx->hdrs[ctx->msgcount] = hdr = mutt_hcache_restore(hdata); + hdr = mutt_hcache_restore(hdata); + ctx->hdrs[ctx->msgcount] = hdr; mutt_hcache_free(fc->hc, &hdata); hdr->data = NULL; hdr->read = false; @@ -1375,7 +1377,8 @@ static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first, if (hdata) { mutt_debug(2, "mutt_hcache_fetch %s\n", buf); - ctx->hdrs[ctx->msgcount] = hdr = mutt_hcache_restore(hdata); + hdr = mutt_hcache_restore(hdata); + ctx->hdrs[ctx->msgcount] = hdr; mutt_hcache_free(fc.hc, &hdata); hdr->data = NULL; @@ -1448,7 +1451,8 @@ static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first, } /* parse header */ - hdr = ctx->hdrs[ctx->msgcount] = mutt_header_new(); + ctx->hdrs[ctx->msgcount] = mutt_header_new(); + hdr = ctx->hdrs[ctx->msgcount]; hdr->env = mutt_rfc822_read_header(fp, hdr, false, false); hdr->received = hdr->date_sent; mutt_file_fclose(&fp); @@ -2032,7 +2036,8 @@ static int check_mailbox(struct Context *ctx) if (ctx->msgcount >= ctx->hdrmax) mx_alloc_memory(ctx); - ctx->hdrs[ctx->msgcount] = hdr = mutt_hcache_restore(hdata); + hdr = mutt_hcache_restore(hdata); + ctx->hdrs[ctx->msgcount] = hdr; mutt_hcache_free(hc, &hdata); hdr->data = NULL; if (hdr->deleted) @@ -2471,7 +2476,8 @@ int nntp_check_msgid(struct Context *ctx, const char *msgid) /* parse header */ if (ctx->msgcount == ctx->hdrmax) mx_alloc_memory(ctx); - struct Header *hdr = ctx->hdrs[ctx->msgcount] = mutt_header_new(); + ctx->hdrs[ctx->msgcount] = mutt_header_new(); + struct Header *hdr = ctx->hdrs[ctx->msgcount]; hdr->data = mutt_mem_calloc(1, sizeof(struct NntpHeaderData)); hdr->env = mutt_rfc822_read_header(fp, hdr, false, false); mutt_file_fclose(&fp); diff --git a/notmuch/mutt_notmuch.c b/notmuch/mutt_notmuch.c index a216745f9..93fa85fc0 100644 --- a/notmuch/mutt_notmuch.c +++ b/notmuch/mutt_notmuch.c @@ -770,7 +770,8 @@ static void apply_exclude_tags(notmuch_query_t *query) mutt_debug(2, "nm: query exclude tag '%s'\n", tag); notmuch_query_add_tag_exclude(query, tag); - end = tag = NULL; + end = NULL; + tag = NULL; } notmuch_query_set_omit_excluded(query, 1); FREE(&buf); @@ -1446,7 +1447,8 @@ static int update_tags(notmuch_message_t *msg, const char *tags) mutt_debug(1, "nm: add tag: '%s'\n", (*tag == '+') ? tag + 1 : tag); notmuch_message_add_tag(msg, (*tag == '+') ? tag + 1 : tag); } - end = tag = NULL; + end = NULL; + tag = NULL; } notmuch_message_thaw(msg); @@ -1511,7 +1513,8 @@ static int update_header_flags(struct Context *ctx, struct Header *hdr, const ch else if (strcmp(tag, "flagged") == 0) mutt_set_flag(ctx, hdr, MUTT_FLAG, 1); } - end = tag = NULL; + end = NULL; + tag = NULL; } FREE(&buf); @@ -2661,7 +2664,8 @@ static int nm_mbox_sync(struct Context *ctx, int *index_hint) if (!ctx->quiet) mutt_progress_update(&progress, i, -1); - *old = *new = '\0'; + *old = '\0'; + *new = '\0'; if (hd->oldpath) { diff --git a/pager.c b/pager.c index 4f3b6e75c..c2ef56786 100644 --- a/pager.c +++ b/pager.c @@ -1582,7 +1582,8 @@ static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info, int (*line_info)[ch].type = -1; (*line_info)[ch].search_cnt = -1; (*line_info)[ch].syntax = mutt_mem_malloc(sizeof(struct Syntax)); - ((*line_info)[ch].syntax)[0].first = ((*line_info)[ch].syntax)[0].last = -1; + ((*line_info)[ch].syntax)[0].first = -1; + ((*line_info)[ch].syntax)[0].last = -1; } } @@ -1939,7 +1940,8 @@ static void pager_menu_redraw(struct Menu *pager_menu) memcpy(rd->pager_window, MuttIndexWindow, sizeof(struct MuttWindow)); memcpy(rd->pager_status_window, MuttStatusWindow, sizeof(struct MuttWindow)); - rd->index_status_window->rows = rd->index_window->rows = 0; + rd->index_status_window->rows = 0; + rd->index_window->rows = 0; if (IsHeader(rd->extra) && PagerIndexLines) { @@ -2094,7 +2096,8 @@ static void pager_menu_redraw(struct Menu *pager_menu) do { mutt_window_move(rd->pager_window, 0, 0); - rd->curline = rd->oldtopline = rd->topline; + rd->curline = rd->topline; + rd->oldtopline = rd->topline; rd->lines = 0; rd->force_redraw = false; @@ -2286,7 +2289,8 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e rd.line_info[i].type = -1; rd.line_info[i].search_cnt = -1; rd.line_info[i].syntax = mutt_mem_malloc(sizeof(struct Syntax)); - (rd.line_info[i].syntax)[0].first = (rd.line_info[i].syntax)[0].last = -1; + (rd.line_info[i].syntax)[0].first = -1; + (rd.line_info[i].syntax)[0].last = -1; } mutt_compile_help(helpstr, sizeof(helpstr), MENU_PAGER, PagerHelp); diff --git a/pattern.c b/pattern.c index 2c039bd19..ba6e63503 100644 --- a/pattern.c +++ b/pattern.c @@ -448,9 +448,12 @@ static void adjust_date_range(struct tm *min, struct tm *max) min->tm_mday = max->tm_mday; max->tm_mday = tmp; - min->tm_hour = min->tm_min = min->tm_sec = 0; + min->tm_hour = 0; + min->tm_min = 0; + min->tm_sec = 0; max->tm_hour = 23; - max->tm_min = max->tm_sec = 59; + max->tm_min = 59; + max->tm_sec = 59; } } @@ -523,7 +526,8 @@ static bool eat_date(struct Pattern *pat, struct Buffer *s, struct Buffer *err) exact++; } tm->tm_hour = 23; - tm->tm_min = tm->tm_sec = 59; + tm->tm_min = 59; + tm->tm_sec = 59; /* force negative offset */ get_offset(tm, buffer.data + 1, -1); @@ -532,7 +536,9 @@ static bool eat_date(struct Pattern *pat, struct Buffer *s, struct Buffer *err) { /* start at the beginning of the day in question */ memcpy(&min, &max, sizeof(max)); - min.tm_hour = min.tm_sec = min.tm_min = 0; + min.tm_hour = 0; + min.tm_sec = 0; + min.tm_min = 0; } } else @@ -571,7 +577,9 @@ static bool eat_date(struct Pattern *pat, struct Buffer *s, struct Buffer *err) struct tm *tm = localtime(&now); memcpy(&base_min, &min, sizeof(base_min)); memcpy(&min, tm, sizeof(min)); - min.tm_hour = min.tm_sec = min.tm_min = 0; + min.tm_hour = 0; + min.tm_sec = 0; + min.tm_min = 0; } /* preset max date for relative offsets, @@ -876,7 +884,8 @@ static int eat_range_by_regex(struct Pattern *pat, struct Buffer *s, int kind, mutt_str_strfcpy(err->data, _("No current message"), err->dsize); return RANGE_E_CTX; } - pat->min = pat->max = CTX_MSGNO(Context); + pat->max = CTX_MSGNO(Context); + pat->min = pat->max; } /* Since we don't enforce order, we must swap bounds if they're backward */ diff --git a/pop/pop.c b/pop/pop.c index 8e969d7a4..ade7b0e40 100644 --- a/pop/pop.c +++ b/pop/pop.c @@ -904,7 +904,8 @@ void pop_fetch_mail(void) return; } - url = p = mutt_mem_calloc(strlen(PopHost) + 7, sizeof(char)); + p = mutt_mem_calloc(strlen(PopHost) + 7, sizeof(char)); + url = p; if (url_check_scheme(PopHost) == U_UNKNOWN) { strcpy(url, "pop://"); diff --git a/query.c b/query.c index cecc89f43..b6b317aaf 100644 --- a/query.c +++ b/query.c @@ -369,7 +369,8 @@ static void query_menu(char *buf, size_t buflen, struct Query *results, bool ret for (queryp = results; queryp; queryp = queryp->next) menu->max++; - menu->data = QueryTable = mutt_mem_calloc(menu->max, sizeof(struct Entry)); + QueryTable = mutt_mem_calloc(menu->max, sizeof(struct Entry)); + menu->data = QueryTable; int i; for (i = 0, queryp = results; queryp; queryp = queryp->next, i++) diff --git a/recvattach.c b/recvattach.c index 6049c543a..e4560d697 100644 --- a/recvattach.c +++ b/recvattach.c @@ -108,7 +108,8 @@ static void mutt_update_v2r(struct AttachCtx *actx) { int vindex, rindex, curlevel; - vindex = rindex = 0; + vindex = 0; + rindex = 0; while (rindex < actx->idxlen) { @@ -1132,7 +1133,8 @@ static void mutt_generate_recvattach_list(struct AttachCtx *actx, struct Header for (; m; m = m->next) { - need_secured = secured = 0; + need_secured = 0; + secured = 0; if (((WithCrypto & APPLICATION_SMIME) != 0) && mutt_is_application_smime(m)) { diff --git a/remailer.c b/remailer.c index a07caba9b..611f33b96 100644 --- a/remailer.c +++ b/remailer.c @@ -294,7 +294,8 @@ static void mix_screen_coordinates(struct Remailer **type2_list, struct Coord ** if (c >= MuttIndexWindow->cols) { - oc = c = MIX_HOFFSET; + oc = MIX_HOFFSET; + c = MIX_HOFFSET; r++; } diff --git a/send.c b/send.c index eea50f3a2..26e88bdb1 100644 --- a/send.c +++ b/send.c @@ -203,7 +203,10 @@ static struct Address *remove_user(struct Address *a, bool leave_only) last = last->next; } else - last = top = a; + { + last = a; + top = a; + } a = a->next; last->next = NULL; } @@ -218,7 +221,10 @@ static struct Address *remove_user(struct Address *a, bool leave_only) mutt_addr_free(&tmp); } else - last = top = tmp; + { + last = tmp; + top = tmp; + } } } return top; @@ -246,7 +252,10 @@ static struct Address *find_mailing_lists(struct Address *t, struct Address *c) ptr = ptr->next; } else - ptr = top = mutt_addr_copy(t); + { + top = mutt_addr_copy(t); + ptr = top; + } } } } @@ -1078,7 +1087,10 @@ static int generate_body(FILE *tempfp, struct Header *msg, int flags, last = tmp; } else - last = msg->content = tmp; + { + last = tmp; + msg->content = tmp; + } } } } diff --git a/sendlib.c b/sendlib.c index 840a00926..76bc024eb 100644 --- a/sendlib.c +++ b/sendlib.c @@ -2139,7 +2139,9 @@ int mutt_write_one_header(FILE *fp, const char *tag, const char *value, } } - p = last = line = (char *) v; + p = v; + last = v; + line = v; while (p && *p) { p = strchr(p, '\n'); diff --git a/sidebar.c b/sidebar.c index 94a7b4a34..1dfb1c260 100644 --- a/sidebar.c +++ b/sidebar.c @@ -651,7 +651,8 @@ static bool prepare_sidebar(int page_size) * need to scan for the framing interval */ if (SidebarNewMailOnly) { - TopIndex = BotIndex = -1; + TopIndex = -1; + BotIndex = -1; while (BotIndex < HilIndex) { TopIndex = BotIndex + 1; diff --git a/smtp.c b/smtp.c index 2903368c6..3d1cc860f 100644 --- a/smtp.c +++ b/smtp.c @@ -580,7 +580,7 @@ static int smtp_auth_plain(struct Connection *conn) } /* Check if any elements in SmtpAuthenticators is "plain" */ - for (method = delim = SmtpAuthenticators; + for (method = SmtpAuthenticators, delim = SmtpAuthenticators; *delim && (delim = mutt_str_strchrnul(method, ':')); method = delim + 1) { if (mutt_str_strncasecmp(method, "plain", 5) == 0)