summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-01-19 14:59:56 +0100
committerBram Moolenaar <Bram@vim.org>2010-01-19 14:59:56 +0100
commit2660c0ea9be48b57b5b7f613fdd6add99c643c80 (patch)
tree4516eeafe1e08e8386f4b1260d3f15ea5bdea75c
parent3ea38ef23944f3d49c126b94708e2d4a540bca42 (diff)
downloadvim-2660c0ea9be48b57b5b7f613fdd6add99c643c80.zip
updated for version 7.2.333
Problem: Warnings from static code analysis. Solution: Small changes to various lines. (Dominique Pelle)
-rw-r--r--src/buffer.c2
-rw-r--r--src/edit.c7
-rw-r--r--src/ex_getln.c3
-rw-r--r--src/fileio.c4
-rw-r--r--src/if_cscope.c2
-rw-r--r--src/netbeans.c8
-rw-r--r--src/ops.c4
-rw-r--r--src/quickfix.c12
-rw-r--r--src/syntax.c1
-rw-r--r--src/ui.c2
-rw-r--r--src/version.c2
11 files changed, 19 insertions, 28 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 2d64bca84..a3cd6be38 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -315,7 +315,7 @@ close_buffer(win, buf, action)
{
#ifdef FEAT_AUTOCMD
int is_curbuf;
- int nwindows = buf->b_nwindows;
+ int nwindows;
#endif
int unload_buf = (action != 0);
int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
diff --git a/src/edit.c b/src/edit.c
index 75b18084f..43058f8b7 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -4048,7 +4048,7 @@ ins_compl_get_exp(ini)
save_p_ic = p_ic;
p_ic = ignorecase(compl_pattern);
- /* Find up to TAG_MANY matches. Avoids that an enourmous number
+ /* Find up to TAG_MANY matches. Avoids that an enormous number
* of matches is found when compl_pattern is empty */
if (find_tags(compl_pattern, &num_matches, &matches,
TAG_REGEXP | TAG_NAMES | TAG_NOIC |
@@ -4219,7 +4219,7 @@ ins_compl_get_exp(ini)
|| IObuff[len - 2] == '!'))))
IObuff[len++] = ' ';
}
- /* copy as much as posible of the new word */
+ /* copy as much as possible of the new word */
if (tmp_ptr - ptr >= IOSIZE - len)
tmp_ptr = ptr + IOSIZE - len - 1;
STRNCPY(IObuff + len, ptr, tmp_ptr - ptr);
@@ -5827,10 +5827,7 @@ internal_format(textwidth, second_indent, flags, format_only, c)
#endif
&& !has_format_option(FO_WRAP))
- {
- textwidth = 0;
break;
- }
if ((startcol = curwin->w_cursor.col) == 0)
break;
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 08a7855e6..d5761f338 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -2193,7 +2193,6 @@ getexmodeline(promptc, cookie, indent)
{
if (ga_grow(&line_ga, 40) == FAIL)
break;
- pend = (char_u *)line_ga.ga_data + line_ga.ga_len;
/* Get one character at a time. Don't use inchar(), it can't handle
* special characters. */
@@ -3314,7 +3313,7 @@ nextwild(xp, type, options)
WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE
|options, type);
vim_free(p1);
- /* longest match: make sure it is not shorter (happens with :help */
+ /* longest match: make sure it is not shorter, happens with :help */
if (p2 != NULL && type == WILD_LONGEST)
{
for (j = 0; j < xp->xp_pattern_len; ++j)
diff --git a/src/fileio.c b/src/fileio.c
index bdc7439ce..0e2d1cca7 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -7072,8 +7072,8 @@ vim_tempname(extra_char)
*/
for (i = 0; i < (int)(sizeof(tempdirs) / sizeof(char *)); ++i)
{
- size_t itmplen;
# ifndef HAVE_MKDTEMP
+ size_t itmplen;
long nr;
long off;
# endif
@@ -7091,7 +7091,6 @@ vim_tempname(extra_char)
else
# endif
add_pathsep(itmp);
- itmplen = STRLEN(itmp);
# ifdef HAVE_MKDTEMP
/* Leave room for filename */
@@ -7104,6 +7103,7 @@ vim_tempname(extra_char)
* otherwise it doesn't matter. The use of mkdir() avoids any
* security problems because of the predictable number. */
nr = (mch_get_pid() + (long)time(NULL)) % 1000000L;
+ itmplen = STRLEN(itmp);
/* Try up to 10000 different values until we find a name that
* doesn't exist. */
diff --git a/src/if_cscope.c b/src/if_cscope.c
index bd90eca87..b2a4ce1a1 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -2069,7 +2069,7 @@ cs_print_tags_priv(matches, cntxts, num_matches)
continue;
(void)strcpy(tbuf, matches[idx]);
- if ((fname = strtok(tbuf, (const char *)"\t")) == NULL)
+ if (strtok(tbuf, (const char *)"\t") == NULL)
continue;
if ((fname = strtok(NULL, (const char *)"\t")) == NULL)
continue;
diff --git a/src/netbeans.c b/src/netbeans.c
index b013d7780..a8a690112 100644
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -873,7 +873,7 @@ nb_parse_cmd(char_u *cmd)
{
#ifdef NBDEBUG
/*
- * This happens because the ExtEd can send a cammand or 2 after
+ * This happens because the ExtEd can send a command or 2 after
* doing a stopDocumentListen command. It doesn't harm anything
* so I'm disabling it except for debugging.
*/
@@ -1174,7 +1174,7 @@ nb_quote(char_u *txt)
break;
}
}
- *q++ = '\0';
+ *q = '\0';
return buf;
}
@@ -3070,7 +3070,7 @@ netbeans_removed(
}
/*
- * Send netbeans an unmodufied command.
+ * Send netbeans an unmodified command.
*/
void
netbeans_unmodified(buf_T *bufp UNUSED)
@@ -3366,7 +3366,7 @@ netbeans_gutter_click(linenr_T lnum)
/*
- * Add a sign of the reqested type at the requested location.
+ * Add a sign of the requested type at the requested location.
*
* Reverse engineering:
* Apparently an annotation is defined the first time it is used in a buffer.
diff --git a/src/ops.c b/src/ops.c
index 5b12e68df..4b32b5733 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -5591,13 +5591,13 @@ x11_export_final_selection()
*/
if (has_mbyte)
{
- char_u *conv_str = str;
vimconv_T vc;
vc.vc_type = CONV_NONE;
if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK)
{
- int intlen = len;
+ int intlen = len;
+ char_u *conv_str;
conv_str = string_convert(&vc, str, &intlen);
len = intlen;
diff --git a/src/quickfix.c b/src/quickfix.c
index 5fc36bc5e..8537a7c5a 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -1899,7 +1899,6 @@ qf_list(eap)
int i;
int idx1 = 1;
int idx2 = -1;
- int need_return = TRUE;
char_u *arg = eap->arg;
int all = eap->forceit; /* if not :cl!, only show
recognised errors */
@@ -1939,13 +1938,9 @@ qf_list(eap)
{
if ((qfp->qf_valid || all) && idx1 <= i && i <= idx2)
{
- if (need_return)
- {
- msg_putchar('\n');
- if (got_int)
- break;
- need_return = FALSE;
- }
+ msg_putchar('\n');
+ if (got_int)
+ break;
fname = NULL;
if (qfp->qf_fnum != 0
@@ -1988,7 +1983,6 @@ qf_list(eap)
IObuff, IOSIZE);
msg_prt_line(IObuff, FALSE);
out_flush(); /* show one line at a time */
- need_return = TRUE;
}
qfp = qfp->qf_next;
diff --git a/src/syntax.c b/src/syntax.c
index 54b8875e9..424605850 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -4167,7 +4167,6 @@ clear_keywtab(ht)
if (!HASHITEM_EMPTY(hi))
{
--todo;
- kp = HI2KE(hi);
for (kp = HI2KE(hi); kp != NULL; kp = kp_next)
{
kp_next = kp->ke_next;
diff --git a/src/ui.c b/src/ui.c
index df8008c84..e9d6beba7 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -2383,7 +2383,7 @@ yank_cut_buffer0(dpy, cbd)
* 'enc' anyway. */
if (has_mbyte)
{
- char_u *conv_buf = buffer;
+ char_u *conv_buf;
vimconv_T vc;
vc.vc_type = CONV_NONE;
diff --git a/src/version.c b/src/version.c
index 91a4685ea..3b22e5c9c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -682,6 +682,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 333,
+/**/
332,
/**/
331,