# HG changeset patch # User Bram Moolenaar # Date 1326230777 -3600 # Node ID 320cc46d0eb022bfb24d1b636050becc83ac0014 # Parent 373b8b5fee9597d463889b45cba1bc678f1a7ca6 updated for version 7.3.400 Problem: Compiler warnings for shadowed variables. Solution: Remove or rename the variables. diff --git a/src/charset.c b/src/charset.c --- a/src/charset.c +++ b/src/charset.c @@ -463,41 +463,42 @@ str_foldcase(str, orglen, buf, buflen) if (enc_utf8) { int c = utf_ptr2char(STR_PTR(i)); - int ol = utf_ptr2len(STR_PTR(i)); + int olen = utf_ptr2len(STR_PTR(i)); int lc = utf_tolower(c); /* Only replace the character when it is not an invalid * sequence (ASCII character or more than one byte) and * utf_tolower() doesn't return the original character. */ - if ((c < 0x80 || ol > 1) && c != lc) + if ((c < 0x80 || olen > 1) && c != lc) { - int nl = utf_char2len(lc); + int nlen = utf_char2len(lc); /* If the byte length changes need to shift the following * characters forward or backward. */ - if (ol != nl) + if (olen != nlen) { - if (nl > ol) + if (nlen > olen) { - if (buf == NULL ? ga_grow(&ga, nl - ol + 1) == FAIL - : len + nl - ol >= buflen) + if (buf == NULL + ? ga_grow(&ga, nlen - olen + 1) == FAIL + : len + nlen - olen >= buflen) { /* out of memory, keep old char */ lc = c; - nl = ol; + nlen = olen; } } - if (ol != nl) + if (olen != nlen) { if (buf == NULL) { - STRMOVE(GA_PTR(i) + nl, GA_PTR(i) + ol); - ga.ga_len += nl - ol; + STRMOVE(GA_PTR(i) + nlen, GA_PTR(i) + olen); + ga.ga_len += nlen - olen; } else { - STRMOVE(buf + i + nl, buf + i + ol); - len += nl - ol; + STRMOVE(buf + i + nlen, buf + i + olen); + len += nlen - olen; } } } diff --git a/src/digraph.c b/src/digraph.c --- a/src/digraph.c +++ b/src/digraph.c @@ -2080,13 +2080,13 @@ get_digraph(cmdline) /* * Lookup the pair "char1", "char2" in the digraph tables. * If no match, return "char2". - * If "meta" is TRUE and "char1" is a space, return "char2" | 0x80. + * If "meta_char" is TRUE and "char1" is a space, return "char2" | 0x80. */ static int -getexactdigraph(char1, char2, meta) +getexactdigraph(char1, char2, meta_char) int char1; int char2; - int meta; + int meta_char; { int i; int retval = 0; @@ -2159,7 +2159,7 @@ getexactdigraph(char1, char2, meta) if (retval == 0) /* digraph deleted or not found */ { - if (char1 == ' ' && meta) /* --> meta-char */ + if (char1 == ' ' && meta_char) /* --> meta-char */ return (char2 | 0x80); return char2; } @@ -2171,16 +2171,16 @@ getexactdigraph(char1, char2, meta) * Allow for both char1-char2 and char2-char1 */ int -getdigraph(char1, char2, meta) +getdigraph(char1, char2, meta_char) int char1; int char2; - int meta; + int meta_char; { int retval; - if (((retval = getexactdigraph(char1, char2, meta)) == char2) + if (((retval = getexactdigraph(char1, char2, meta_char)) == char2) && (char1 != char2) - && ((retval = getexactdigraph(char2, char1, meta)) == char1)) + && ((retval = getexactdigraph(char2, char1, meta_char)) == char1)) return char2; return retval; } diff --git a/src/edit.c b/src/edit.c --- a/src/edit.c +++ b/src/edit.c @@ -4003,24 +4003,24 @@ ins_compl_add_list(list) ins_compl_add_dict(dict) dict_T *dict; { - dictitem_T *refresh; - dictitem_T *words; + dictitem_T *di_refresh; + dictitem_T *di_words; /* Check for optional "refresh" item. */ compl_opt_refresh_always = FALSE; - refresh = dict_find(dict, (char_u *)"refresh", 7); - if (refresh != NULL && refresh->di_tv.v_type == VAR_STRING) - { - char_u *v = refresh->di_tv.vval.v_string; + di_refresh = dict_find(dict, (char_u *)"refresh", 7); + if (di_refresh != NULL && di_refresh->di_tv.v_type == VAR_STRING) + { + char_u *v = di_refresh->di_tv.vval.v_string; if (v != NULL && STRCMP(v, (char_u *)"always") == 0) compl_opt_refresh_always = TRUE; } /* Add completions from a "words" list. */ - words = dict_find(dict, (char_u *)"words", 5); - if (words != NULL && words->di_tv.v_type == VAR_LIST) - ins_compl_add_list(words->di_tv.vval.v_list); + di_words = dict_find(dict, (char_u *)"words", 5); + if (di_words != NULL && di_words->di_tv.v_type == VAR_LIST) + ins_compl_add_list(di_words->di_tv.vval.v_list); } /* diff --git a/src/eval.c b/src/eval.c --- a/src/eval.c +++ b/src/eval.c @@ -6573,15 +6573,15 @@ list2string(tv, copyID) /* * Join list "l" into a string in "*gap", using separator "sep". - * When "echo" is TRUE use String as echoed, otherwise as inside a List. + * When "echo_style" is TRUE use String as echoed, otherwise as inside a List. * Return FAIL or OK. */ static int -list_join(gap, l, sep, echo, copyID) +list_join(gap, l, sep, echo_style, copyID) garray_T *gap; list_T *l; char_u *sep; - int echo; + int echo_style; int copyID; { int first = TRUE; @@ -6597,7 +6597,7 @@ list_join(gap, l, sep, echo, copyID) else ga_concat(gap, sep); - if (echo) + if (echo_style) s = echo_string(&item->li_tv, &tofree, numbuf, copyID); else s = tv2string(&item->li_tv, &tofree, numbuf, copyID); @@ -17893,7 +17893,7 @@ f_tr(argvars, rettv) typval_T *argvars; typval_T *rettv; { - char_u *instr; + char_u *in_str; char_u *fromstr; char_u *tostr; char_u *p; @@ -17910,7 +17910,7 @@ f_tr(argvars, rettv) char_u buf2[NUMBUFLEN]; garray_T ga; - instr = get_tv_string(&argvars[0]); + in_str = get_tv_string(&argvars[0]); fromstr = get_tv_string_buf_chk(&argvars[1], buf); tostr = get_tv_string_buf_chk(&argvars[2], buf2); @@ -17936,19 +17936,19 @@ error: } /* fromstr and tostr have to contain the same number of chars */ - while (*instr != NUL) + while (*in_str != NUL) { #ifdef FEAT_MBYTE if (has_mbyte) { - inlen = (*mb_ptr2len)(instr); - cpstr = instr; + inlen = (*mb_ptr2len)(in_str); + cpstr = in_str; cplen = inlen; idx = 0; for (p = fromstr; *p != NUL; p += fromlen) { fromlen = (*mb_ptr2len)(p); - if (fromlen == inlen && STRNCMP(instr, p, inlen) == 0) + if (fromlen == inlen && STRNCMP(in_str, p, inlen) == 0) { for (p = tostr; *p != NUL; p += tolen) { @@ -17967,11 +17967,11 @@ error: ++idx; } - if (first && cpstr == instr) + if (first && cpstr == in_str) { /* Check that fromstr and tostr have the same number of * (multi-byte) characters. Done only once when a character - * of instr doesn't appear in fromstr. */ + * of in_str doesn't appear in fromstr. */ first = FALSE; for (p = tostr; *p != NUL; p += tolen) { @@ -17986,18 +17986,18 @@ error: mch_memmove((char *)ga.ga_data + ga.ga_len, cpstr, (size_t)cplen); ga.ga_len += cplen; - instr += inlen; + in_str += inlen; } else #endif { /* When not using multi-byte chars we can do it faster. */ - p = vim_strchr(fromstr, *instr); + p = vim_strchr(fromstr, *in_str); if (p != NULL) ga_append(&ga, tostr[p - fromstr]); else - ga_append(&ga, *instr); - ++instr; + ga_append(&ga, *in_str); + ++in_str; } } diff --git a/src/fold.c b/src/fold.c --- a/src/fold.c +++ b/src/fold.c @@ -1033,10 +1033,10 @@ foldMoveTo(updown, dir, count) * Init the fold info in a new window. */ void -foldInitWin(newwin) - win_T *newwin; +foldInitWin(new_win) + win_T *new_win; { - ga_init2(&newwin->w_folds, (int)sizeof(fold_T), 10); + ga_init2(&new_win->w_folds, (int)sizeof(fold_T), 10); } /* find_wl_entry() {{{2 */ diff --git a/src/getchar.c b/src/getchar.c --- a/src/getchar.c +++ b/src/getchar.c @@ -418,12 +418,12 @@ typeahead_noflush(c) /* * Remove the contents of the stuff buffer and the mapped characters in the - * typeahead buffer (used in case of an error). If 'typeahead' is true, + * typeahead buffer (used in case of an error). If "flush_typeahead" is true, * flush all typeahead characters (used when interrupted by a CTRL-C). */ void -flush_buffers(typeahead) - int typeahead; +flush_buffers(flush_typeahead) + int flush_typeahead; { init_typebuf(); @@ -431,7 +431,7 @@ flush_buffers(typeahead) while (read_stuff(TRUE) != NUL) ; - if (typeahead) /* remove all typeahead */ + if (flush_typeahead) /* remove all typeahead */ { /* * We have to get all characters, because we may delete the first part diff --git a/src/message.c b/src/message.c --- a/src/message.c +++ b/src/message.c @@ -2487,7 +2487,7 @@ do_more_prompt(typed_char) #ifdef FEAT_CON_DIALOG int retval = FALSE; #endif - int scroll; + int toscroll; msgchunk_T *mp_last = NULL; msgchunk_T *mp; int i; @@ -2538,49 +2538,49 @@ do_more_prompt(typed_char) } #endif - scroll = 0; + toscroll = 0; switch (c) { case BS: /* scroll one line back */ case K_BS: case 'k': case K_UP: - scroll = -1; + toscroll = -1; break; case CAR: /* one extra line */ case NL: case 'j': case K_DOWN: - scroll = 1; + toscroll = 1; break; case 'u': /* Up half a page */ - scroll = -(Rows / 2); + toscroll = -(Rows / 2); break; case 'd': /* Down half a page */ - scroll = Rows / 2; + toscroll = Rows / 2; break; case 'b': /* one page back */ case K_PAGEUP: - scroll = -(Rows - 1); + toscroll = -(Rows - 1); break; case ' ': /* one extra page */ case 'f': case K_PAGEDOWN: case K_LEFTMOUSE: - scroll = Rows - 1; + toscroll = Rows - 1; break; case 'g': /* all the way back to the start */ - scroll = -999999; + toscroll = -999999; break; case 'G': /* all the way to the end */ - scroll = 999999; + toscroll = 999999; lines_left = 999999; break; @@ -2633,9 +2633,9 @@ do_more_prompt(typed_char) continue; } - if (scroll != 0) + if (toscroll != 0) { - if (scroll < 0) + if (toscroll < 0) { /* go to start of last line */ if (mp_last == NULL) @@ -2653,7 +2653,7 @@ do_more_prompt(typed_char) if (mp != NULL && mp->sb_prev != NULL) { /* Find line to be displayed at top. */ - for (i = 0; i > scroll; --i) + for (i = 0; i > toscroll; --i) { if (mp == NULL || mp->sb_prev == NULL) break; @@ -2664,7 +2664,7 @@ do_more_prompt(typed_char) mp_last = msg_sb_start(mp_last->sb_prev); } - if (scroll == -1 && screen_ins_lines(0, 0, 1, + if (toscroll == -1 && screen_ins_lines(0, 0, 1, (int)Rows, NULL) == OK) { /* display line at top */ @@ -2680,13 +2680,13 @@ do_more_prompt(typed_char) ++msg_scrolled; } } - scroll = 0; + toscroll = 0; } } else { /* First display any text that we scrolled back. */ - while (scroll > 0 && mp_last != NULL) + while (toscroll > 0 && mp_last != NULL) { /* scroll up, display line at bottom */ msg_scroll_up(); @@ -2694,11 +2694,11 @@ do_more_prompt(typed_char) screen_fill((int)Rows - 2, (int)Rows - 1, 0, (int)Columns, ' ', ' ', 0); mp_last = disp_sb_line((int)Rows - 2, mp_last); - --scroll; + --toscroll; } } - if (scroll <= 0) + if (toscroll <= 0) { /* displayed the requested text, more prompt again */ screen_fill((int)Rows - 1, (int)Rows, 0, @@ -2708,7 +2708,7 @@ do_more_prompt(typed_char) } /* display more text, return to caller */ - lines_left = scroll; + lines_left = toscroll; } break; diff --git a/src/misc2.c b/src/misc2.c --- a/src/misc2.c +++ b/src/misc2.c @@ -1559,7 +1559,7 @@ strup_save(orig) if (enc_utf8) { int c, uc; - int nl; + int newl; char_u *s; c = utf_ptr2char(p); @@ -1568,21 +1568,21 @@ strup_save(orig) /* Reallocate string when byte count changes. This is rare, * thus it's OK to do another malloc()/free(). */ l = utf_ptr2len(p); - nl = utf_char2len(uc); - if (nl != l) + newl = utf_char2len(uc); + if (newl != l) { - s = alloc((unsigned)STRLEN(res) + 1 + nl - l); + s = alloc((unsigned)STRLEN(res) + 1 + newl - l); if (s == NULL) break; mch_memmove(s, res, p - res); - STRCPY(s + (p - res) + nl, p + l); + STRCPY(s + (p - res) + newl, p + l); p = s + (p - res); vim_free(res); res = s; } utf_char2bytes(uc, p); - p += nl; + p += newl; } else if (has_mbyte && (l = (*mb_ptr2len)(p)) > 1) p += l; /* skip multi-byte character */ diff --git a/src/move.c b/src/move.c --- a/src/move.c +++ b/src/move.c @@ -926,8 +926,8 @@ curwin_col_off2() * Also updates curwin->w_leftcol. */ void -curs_columns(scroll) - int scroll; /* when TRUE, may scroll horizontally */ +curs_columns(may_scroll) + int may_scroll; /* when TRUE, may scroll horizontally */ { int diff; int extra; /* offset for first screen line */ @@ -1014,7 +1014,7 @@ curs_columns(scroll) /* No line wrapping: compute curwin->w_leftcol if scrolling is on and line * is not folded. * If scrolling is off, curwin->w_leftcol is assumed to be 0 */ - else if (scroll + else if (may_scroll #ifdef FEAT_FOLDING && !curwin->w_cline_folded #endif diff --git a/src/netbeans.c b/src/netbeans.c --- a/src/netbeans.c +++ b/src/netbeans.c @@ -1395,7 +1395,7 @@ nb_do_cmd( int cmdno, char_u *args) /* points to space before arguments or NUL */ { - int doupdate = 0; + int do_update = 0; long off = 0; nbbuf_T *buf = nb_get_buf(bufno); static int skip = 0; @@ -1600,7 +1600,7 @@ nb_do_cmd( last.lnum, last.col)); del_from_lnum = first.lnum; del_to_lnum = last.lnum; - doupdate = 1; + do_update = 1; /* Get the position of the first byte after the deleted * section. "next" is NULL when deleting to the end of the @@ -1777,7 +1777,7 @@ nb_do_cmd( lnum = lnum_start; /* Loop over the "\n" separated lines of the argument. */ - doupdate = 1; + do_update = 1; while (*args != NUL) { nl = vim_strchr(args, '\n'); @@ -1992,7 +1992,7 @@ nb_do_cmd( EMSG("E640: invalid buffer identifier in initDone"); return FAIL; } - doupdate = 1; + do_update = 1; buf->initDone = TRUE; nb_set_curbuf(buf->bufp); #if defined(FEAT_AUTOCMD) @@ -2081,7 +2081,7 @@ nb_do_cmd( ECMD_HIDE + ECMD_OLDBUF, curwin); buf->bufp = curbuf; buf->initDone = TRUE; - doupdate = 1; + do_update = 1; #if defined(FEAT_TITLE) maketitle(); #endif @@ -2109,7 +2109,7 @@ nb_do_cmd( exarg.forceit = FALSE; dosetvisible = TRUE; goto_buffer(&exarg, DOBUF_FIRST, FORWARD, buf->bufp->b_fnum); - doupdate = 1; + do_update = 1; dosetvisible = FALSE; #ifdef FEAT_GUI @@ -2309,7 +2309,7 @@ nb_do_cmd( buf->bufp->b_fnum, TRUE); buf->bufp = NULL; buf->initDone = FALSE; - doupdate = 1; + do_update = 1; /* =====================================================================*/ } else if (streq((char *)cmd, "setStyle")) /* obsolete... */ @@ -2400,7 +2400,7 @@ nb_do_cmd( return FAIL; } - doupdate = 1; + do_update = 1; cp = (char *)args; serNum = strtol(cp, &cp, 10); @@ -2448,7 +2448,7 @@ nb_do_cmd( nbdebug((" invalid buffer identifier in removeAnno\n")); return FAIL; } - doupdate = 1; + do_update = 1; cp = (char *)args; serNum = strtol(cp, &cp, 10); args = (char_u *)cp; @@ -2493,7 +2493,7 @@ nb_do_cmd( len = strtol(cp, NULL, 10); args = (char_u *)cp; pos = off2pos(buf->bufp, off); - doupdate = 1; + do_update = 1; if (!pos) nbdebug((" no such start pos in %s, %ld\n", cmd, off)); else @@ -2555,7 +2555,7 @@ nb_do_cmd( inAtomic = 0; if (needupdate) { - doupdate = 1; + do_update = 1; needupdate = 0; } /* =====================================================================*/ @@ -2636,18 +2636,18 @@ nb_do_cmd( * Unrecognized command is ignored. */ } - if (inAtomic && doupdate) + if (inAtomic && do_update) { needupdate = 1; - doupdate = 0; + do_update = 0; } /* * Is this needed? I moved the netbeans_Xt_connect() later during startup * and it may no longer be necessary. If its not needed then needupdate - * and doupdate can also be removed. + * and do_update can also be removed. */ - if (buf != NULL && buf->initDone && doupdate) + if (buf != NULL && buf->initDone && do_update) { update_screen(NOT_VALID); setcursor(); diff --git a/src/option.c b/src/option.c --- a/src/option.c +++ b/src/option.c @@ -8584,8 +8584,8 @@ check_redraw(flags) long_u flags; { /* Careful: P_RCLR and P_RALL are a combination of other P_ flags */ - int clear = (flags & P_RCLR) == P_RCLR; - int all = ((flags & P_RALL) == P_RALL || clear); + int doclear = (flags & P_RCLR) == P_RCLR; + int all = ((flags & P_RALL) == P_RALL || doclear); #ifdef FEAT_WINDOWS if ((flags & P_RSTAT) || all) /* mark all status lines dirty */ @@ -8596,7 +8596,7 @@ check_redraw(flags) changed_window_setting(); if (flags & P_RBUF) redraw_curbuf_later(NOT_VALID); - if (clear) + if (doclear) redraw_all_later(CLEAR); else if (all) redraw_all_later(NOT_VALID); diff --git a/src/os_unix.c b/src/os_unix.c --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3884,7 +3884,6 @@ mch_call_shell(cmd, options) char_u *p_shcf_copy = NULL; int i; char_u *p; - char_u *s; int inquote; int pty_master_fd = -1; /* for pty's */ # ifdef FEAT_GUI @@ -3963,6 +3962,8 @@ mch_call_shell(cmd, options) } if (cmd != NULL) { + char_u *s; + if (extra_shell_arg != NULL) argv[argc++] = (char *)extra_shell_arg; @@ -4325,7 +4326,6 @@ mch_call_shell(cmd, options) linenr_T lnum = curbuf->b_op_start.lnum; int written = 0; char_u *lp = ml_get(lnum); - char_u *s; size_t l; close(fromshell_fd); @@ -4339,7 +4339,8 @@ mch_call_shell(cmd, options) len = write(toshell_fd, "", (size_t)1); else { - s = vim_strchr(lp + written, NL); + char_u *s = vim_strchr(lp + written, NL); + len = write(toshell_fd, (char *)lp + written, s == NULL ? l : (size_t)(s - (lp + written))); diff --git a/src/screen.c b/src/screen.c --- a/src/screen.c +++ b/src/screen.c @@ -7849,15 +7849,15 @@ check_for_delay(check_msg_scroll) /* * screen_valid - allocate screen buffers if size changed - * If "clear" is TRUE: clear screen if it has been resized. + * If "doclear" is TRUE: clear screen if it has been resized. * Returns TRUE if there is a valid screen to write to. * Returns FALSE when starting up and screen not initialized yet. */ int -screen_valid(clear) - int clear; +screen_valid(doclear) + int doclear; { - screenalloc(clear); /* allocate screen buffers if size changed */ + screenalloc(doclear); /* allocate screen buffers if size changed */ return (ScreenLines != NULL); } @@ -7872,8 +7872,8 @@ screen_valid(clear) * final size of the shell is needed. */ void -screenalloc(clear) - int clear; +screenalloc(doclear) + int doclear; { int new_row, old_row; #ifdef FEAT_GUI @@ -8069,7 +8069,7 @@ give_up: * (used when resizing the window at the "--more--" prompt or when * executing an external command, for the GUI). */ - if (!clear) + if (!doclear) { (void)vim_memset(new_ScreenLines + new_row * Columns, ' ', (size_t)Columns * sizeof(schar_T)); @@ -8159,7 +8159,7 @@ give_up: screen_Columns = Columns; must_redraw = CLEAR; /* need to clear the screen later */ - if (clear) + if (doclear) screenclear2(); #ifdef FEAT_GUI diff --git a/src/search.c b/src/search.c --- a/src/search.c +++ b/src/search.c @@ -2402,24 +2402,24 @@ check_linecomment(line) { if (vim_strchr(p, ';') != NULL) /* there may be comments */ { - int instr = FALSE; /* inside of string */ + int in_str = FALSE; /* inside of string */ p = line; /* scan from start */ while ((p = vim_strpbrk(p, (char_u *)"\";")) != NULL) { if (*p == '"') { - if (instr) + if (in_str) { if (*(p - 1) != '\\') /* skip escaped quote */ - instr = FALSE; + in_str = FALSE; } else if (p == line || ((p - line) >= 2 /* skip #\" form */ && *(p - 1) != '\\' && *(p - 2) != '#')) - instr = TRUE; + in_str = TRUE; } - else if (!instr && ((p - line) < 2 + else if (!in_str && ((p - line) < 2 || (*(p - 1) != '\\' && *(p - 2) != '#'))) break; /* found! */ ++p; diff --git a/src/spell.c b/src/spell.c --- a/src/spell.c +++ b/src/spell.c @@ -5049,7 +5049,7 @@ static int sug_filltable __ARGS((spellin static int offset2bytes __ARGS((int nr, char_u *buf)); static int bytes2offset __ARGS((char_u **pp)); static void sug_write __ARGS((spellinfo_T *spin, char_u *fname)); -static void mkspell __ARGS((int fcount, char_u **fnames, int ascii, int overwrite, int added_word)); +static void mkspell __ARGS((int fcount, char_u **fnames, int ascii, int over_write, int added_word)); static void spell_message __ARGS((spellinfo_T *spin, char_u *str)); static void init_spellfile __ARGS((void)); @@ -9085,11 +9085,11 @@ close_spellbuf(buf) * and ".spl" is appended to make the output file name. */ static void -mkspell(fcount, fnames, ascii, overwrite, added_word) +mkspell(fcount, fnames, ascii, over_write, added_word) int fcount; char_u **fnames; int ascii; /* -ascii argument given */ - int overwrite; /* overwrite existing output file */ + int over_write; /* overwrite existing output file */ int added_word; /* invoked through "zg" */ { char_u *fname = NULL; @@ -9173,7 +9173,7 @@ mkspell(fcount, fnames, ascii, overwrite { /* Check for overwriting before doing things that may take a lot of * time. */ - if (!overwrite && mch_stat((char *)wfname, &st) >= 0) + if (!over_write && mch_stat((char *)wfname, &st) >= 0) { EMSG(_(e_exists)); goto theend; diff --git a/src/syntax.c b/src/syntax.c --- a/src/syntax.c +++ b/src/syntax.c @@ -4006,17 +4006,17 @@ syn_list_one(id, syncing, link_only) } static void -syn_list_flags(nl, flags, attr) - struct name_list *nl; +syn_list_flags(nlist, flags, attr) + struct name_list *nlist; int flags; int attr; { int i; - for (i = 0; nl[i].flag != 0; ++i) - if (flags & nl[i].flag) - { - msg_puts_attr((char_u *)nl[i].name, attr); + for (i = 0; nlist[i].flag != 0; ++i) + if (flags & nlist[i].flag) + { + msg_puts_attr((char_u *)nlist[i].name, attr); msg_putchar(' '); } } diff --git a/src/tag.c b/src/tag.c --- a/src/tag.c +++ b/src/tag.c @@ -1353,7 +1353,6 @@ find_tags(pat, num_matches, matchesp, fl int match_count = 0; /* number of matches found */ char_u **matches; int mtt; - int len; int help_save; #ifdef FEAT_MULTI_LANG int help_pri = 0; @@ -2235,6 +2234,8 @@ line_read_in: */ if (ga_grow(&ga_match[mtt], 1) == OK) { + int len; + if (help_only) { #ifdef FEAT_MULTI_LANG diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 400, +/**/ 399, /**/ 398, diff --git a/src/window.c b/src/window.c --- a/src/window.c +++ b/src/window.c @@ -683,19 +683,19 @@ win_split(size, flags) } /* - * When "newwin" is NULL: split the current window in two. - * When "newwin" is not NULL: insert this window at the far + * When "new_wp" is NULL: split the current window in two. + * When "new_wp" is not NULL: insert this window at the far * top/left/right/bottom. * return FAIL for failure, OK otherwise */ int -win_split_ins(size, flags, newwin, dir) +win_split_ins(size, flags, new_wp, dir) int size; int flags; - win_T *newwin; + win_T *new_wp; int dir; { - win_T *wp = newwin; + win_T *wp = new_wp; win_T *oldwin; int new_size = size; int i; @@ -718,7 +718,7 @@ win_split_ins(size, flags, newwin, dir) /* add a status line when p_ls == 1 and splitting the first window */ if (lastwin == firstwin && p_ls == 1 && oldwin->w_status_height == 0) { - if (oldwin->w_height <= p_wmh && newwin == NULL) + if (oldwin->w_height <= p_wmh && new_wp == NULL) { EMSG(_(e_noroom)); return FAIL; @@ -751,7 +751,7 @@ win_split_ins(size, flags, newwin, dir) } else available = oldwin->w_width; - if (available < needed && newwin == NULL) + if (available < needed && new_wp == NULL) { EMSG(_(e_noroom)); return FAIL; @@ -815,7 +815,7 @@ win_split_ins(size, flags, newwin, dir) available = oldwin->w_height; needed += p_wmh; } - if (available < needed && newwin == NULL) + if (available < needed && new_wp == NULL) { EMSG(_(e_noroom)); return FAIL; @@ -888,20 +888,20 @@ win_split_ins(size, flags, newwin, dir) p_sb)))) { /* new window below/right of current one */ - if (newwin == NULL) + if (new_wp == NULL) wp = win_alloc(oldwin, FALSE); else win_append(oldwin, wp); } else { - if (newwin == NULL) + if (new_wp == NULL) wp = win_alloc(oldwin->w_prev, FALSE); else win_append(oldwin->w_prev, wp); } - if (newwin == NULL) + if (new_wp == NULL) { if (wp == NULL) return FAIL; @@ -972,10 +972,10 @@ win_split_ins(size, flags, newwin, dir) frp->fr_parent = curfrp; } - if (newwin == NULL) + if (new_wp == NULL) frp = wp->w_frame; else - frp = newwin->w_frame; + frp = new_wp->w_frame; frp->fr_parent = curfrp->fr_parent; /* Insert the new frame at the right place in the frame list. */ @@ -4284,19 +4284,19 @@ win_alloc(after, hidden) win_T *after UNUSED; int hidden UNUSED; { - win_T *newwin; + win_T *new_wp; /* * allocate window structure and linesizes arrays */ - newwin = (win_T *)alloc_clear((unsigned)sizeof(win_T)); - if (newwin != NULL && win_alloc_lines(newwin) == FAIL) - { - vim_free(newwin); - newwin = NULL; - } - - if (newwin != NULL) + new_wp = (win_T *)alloc_clear((unsigned)sizeof(win_T)); + if (new_wp != NULL && win_alloc_lines(new_wp) == FAIL) + { + vim_free(new_wp); + new_wp = NULL; + } + + if (new_wp != NULL) { #ifdef FEAT_AUTOCMD /* Don't execute autocommands while the window is not properly @@ -4309,53 +4309,53 @@ win_alloc(after, hidden) */ #ifdef FEAT_WINDOWS if (!hidden) - win_append(after, newwin); + win_append(after, new_wp); #endif #ifdef FEAT_VERTSPLIT - newwin->w_wincol = 0; - newwin->w_width = Columns; + new_wp->w_wincol = 0; + new_wp->w_width = Columns; #endif /* position the display and the cursor at the top of the file. */ - newwin->w_topline = 1; + new_wp->w_topline = 1; #ifdef FEAT_DIFF - newwin->w_topfill = 0; -#endif - newwin->w_botline = 2; - newwin->w_cursor.lnum = 1; + new_wp->w_topfill = 0; +#endif + new_wp->w_botline = 2; + new_wp->w_cursor.lnum = 1; #ifdef FEAT_SCROLLBIND - newwin->w_scbind_pos = 1; + new_wp->w_scbind_pos = 1; #endif /* We won't calculate w_fraction until resizing the window */ - newwin->w_fraction = 0; - newwin->w_prev_fraction_row = -1; + new_wp->w_fraction = 0; + new_wp->w_prev_fraction_row = -1; #ifdef FEAT_GUI if (gui.in_use) { - gui_create_scrollbar(&newwin->w_scrollbars[SBAR_LEFT], - SBAR_LEFT, newwin); - gui_create_scrollbar(&newwin->w_scrollbars[SBAR_RIGHT], - SBAR_RIGHT, newwin); + gui_create_scrollbar(&new_wp->w_scrollbars[SBAR_LEFT], + SBAR_LEFT, new_wp); + gui_create_scrollbar(&new_wp->w_scrollbars[SBAR_RIGHT], + SBAR_RIGHT, new_wp); } #endif #ifdef FEAT_EVAL /* init w: variables */ - init_var_dict(&newwin->w_vars, &newwin->w_winvar); + init_var_dict(&new_wp->w_vars, &new_wp->w_winvar); #endif #ifdef FEAT_FOLDING - foldInitWin(newwin); + foldInitWin(new_wp); #endif #ifdef FEAT_AUTOCMD unblock_autocmds(); #endif #ifdef FEAT_SEARCH_EXTRA - newwin->w_match_head = NULL; - newwin->w_next_match_id = 4; -#endif - } - return newwin; + new_wp->w_match_head = NULL; + new_wp->w_next_match_id = 4; +#endif + } + return new_wp; } #if defined(FEAT_WINDOWS) || defined(PROTO)