Problem: Clang static analyzer gives warnings.
Solution: Avoid the warnings. (Yegappan Lakshmanan, closes #11043)
{
// +=, /=, etc. require an existing variable
semsg(_(e_cannot_use_operator_on_new_variable), eap->arg);
- i = FAIL;
}
else if (vim_strchr((char_u *)"+-*/%.", *expr) != NULL)
{
vim_strncpy(op, expr - len, len);
semsg(_(e_white_space_required_before_and_after_str_at_str),
op, argend);
- i = FAIL;
}
if (eap->skip)
if (skip_quotes && vim_strchr((char_u *)s, '\'') != NULL)
{
char_u buf[100];
- char_u *p = buf;
+ char_u *p;
int quotes = 0;
vim_strncpy(buf, (char_u *)s, 99);
- p = buf;
- for (;;)
+ for (p = buf; ; p = skipdigits(p))
{
// remove single quotes between digits, not in the exponent
if (*p == '\'')
}
if (!vim_isdigit(*p))
break;
- p = skipdigits(p);
}
s = (char *)buf;
f = strtod(s, &s);
# endif
p = add_attr_and_value(p, (char_u *)" guifg=", 7, guifg);
p = add_attr_and_value(p, (char_u *)" guibg=", 7, guibg);
- p = add_attr_and_value(p, (char_u *)" guisp=", 7, guisp);
+ (void)add_attr_and_value(p, (char_u *)" guisp=", 7, guisp);
do_highlight(hlsetBuf, forceit, FALSE);
}
// Store the items in the new table.
- item = 0;
for (item = 0; item < l->lv_len; ++item)
{
listitem_T *lili = ptrs[item];
#ifdef FEAT_NETBEANS_INTG
if (netbeans_active() && one_change)
{
- char_u *ptr = ml_get_buf(curbuf, pos.lnum, FALSE);
+ char_u *ptr;
netbeans_removed(curbuf, pos.lnum, bd.textcol,
(long)bd.textlen);
- // get the line again, it may have been flushed
+ // get the line now, it may have been flushed
ptr = ml_get_buf(curbuf, pos.lnum, FALSE);
netbeans_inserted(curbuf, pos.lnum, bd.textcol,
&ptr[bd.textcol], bd.textlen);
{
for (i = 0; i < num_matches; ++i)
{
- parse_match(matches[i], &tp);
+ if (parse_match(matches[i], &tp) == FAIL)
+ {
+ vim_free(matches[i]);
+ continue;
+ }
+
is_static = test_for_static(&tp);
// Skip pseudo-tag lines.
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 364,
/**/
363,
/**/
r = compile_expr0_ext(&p, cctx, &is_const);
if (lhs.lhs_new_local)
++cctx->ctx_locals.ga_len;
- if (r == FAIL)
- goto theend;
}
+ if (r == FAIL)
+ goto theend;
}
else if (semicolon && var_idx == var_count - 1)
{