mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
Merge pull request #1698 from elmart/clang-analysis-fixes-6
Fix clang analysis warnings. (6)
This commit is contained in:
commit
742ada0869
@ -6196,15 +6196,17 @@ int makeset(FILE *fd, int opt_flags, int local_only)
|
||||
int pri;
|
||||
|
||||
/*
|
||||
* The options that don't have a default (terminal name, columns, lines)
|
||||
* are never written. Terminal options are also not written.
|
||||
* Some options are never written:
|
||||
* - Options that don't have a default (terminal name, columns, lines).
|
||||
* - Terminal options.
|
||||
* - Hidden options.
|
||||
*
|
||||
* Do the loop over "options[]" twice: once for options with the
|
||||
* P_PRI_MKRC flag and once without.
|
||||
*/
|
||||
for (pri = 1; pri >= 0; --pri) {
|
||||
for (p = &options[0]; !istermoption(p); p++)
|
||||
if (!(p->flags & P_NO_MKRC)
|
||||
&& !istermoption(p)
|
||||
&& ((pri == 1) == ((p->flags & P_PRI_MKRC) != 0))) {
|
||||
/* skip global option when only doing locals */
|
||||
if (p->indir == PV_NONE && !(opt_flags & OPT_GLOBAL))
|
||||
@ -6215,8 +6217,11 @@ int makeset(FILE *fd, int opt_flags, int local_only)
|
||||
if ((opt_flags & OPT_GLOBAL) && (p->flags & P_NOGLOB))
|
||||
continue;
|
||||
|
||||
/* Global values are only written when not at the default value. */
|
||||
varp = get_varp_scope(p, opt_flags);
|
||||
/* Hidden options are never written. */
|
||||
if (!varp)
|
||||
continue;
|
||||
/* Global values are only written when not at the default value. */
|
||||
if ((opt_flags & OPT_GLOBAL) && optval_default(p, varp))
|
||||
continue;
|
||||
|
||||
|
@ -5157,9 +5157,7 @@ get_id_list (
|
||||
regmatch.rm_ic = TRUE;
|
||||
id = 0;
|
||||
for (int i = highlight_ga.ga_len; --i >= 0; ) {
|
||||
if (!vim_regexec(®match, HL_TABLE()[i].sg_name, (colnr_T)0)) {
|
||||
continue;
|
||||
}
|
||||
if (vim_regexec(®match, HL_TABLE()[i].sg_name, (colnr_T)0)) {
|
||||
if (round == 2) {
|
||||
/* Got more items than expected; can happen
|
||||
* when adding items that match:
|
||||
@ -5174,6 +5172,7 @@ get_id_list (
|
||||
++count;
|
||||
id = -1; /* remember that we found one */
|
||||
}
|
||||
}
|
||||
vim_regfree(regmatch.regprog);
|
||||
}
|
||||
}
|
||||
|
@ -1977,6 +1977,7 @@ void win_close_othertab(win_T *win, int free_buf, tabpage_T *tp)
|
||||
tabpage_T *ptp = NULL;
|
||||
int free_tp = FALSE;
|
||||
|
||||
assert(win->w_buffer); // to avoid np dereference warning in next line
|
||||
if (win->w_closing || win->w_buffer->b_closing)
|
||||
return; /* window is already being closed */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user