aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-11-15 11:44:37 -0500
committerJustin M. Keyes <justinkz@gmail.com>2014-11-15 11:44:37 -0500
commitbc812a82f87644e184b17517936fddf6ff1221e3 (patch)
treeca6faf2bbc85d9098b6663d2d236ca761175cb2f /src/nvim/syntax.c
parentb299c011a04e6c14ec7dc9fd50a58f4a9e5afd40 (diff)
parent150b0d66e11dc69b1a4fc3daad3016fa74bee4d9 (diff)
downloadrneovim-bc812a82f87644e184b17517936fddf6ff1221e3.tar.gz
rneovim-bc812a82f87644e184b17517936fddf6ff1221e3.tar.bz2
rneovim-bc812a82f87644e184b17517936fddf6ff1221e3.zip
Merge pull request #1460 from elmart/clang-analysis-fixes-3
Fix clang analysis warnings. (3)
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r--src/nvim/syntax.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index e0c9628985..6c5c0f37b1 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -2851,15 +2851,16 @@ static int syn_regexec(regmmatch_T *rmp, linenr_T lnum, colnr_T col, syn_time_T
{
int r;
proftime_T pt;
+ const int l_syn_time_on = syn_time_on;
- if (syn_time_on) {
+ if (l_syn_time_on) {
pt = profile_start();
}
rmp->rmm_maxcol = syn_buf->b_p_smc;
r = vim_regexec_multi(rmp, syn_win, syn_buf, lnum, col, NULL);
- if (syn_time_on) {
+ if (l_syn_time_on) {
pt = profile_end(pt);
st->total = profile_add(st->total, pt);
if (profile_cmp(pt, st->slowest) < 0) {
@@ -5105,7 +5106,7 @@ get_id_list (
* parse the arguments after "contains"
*/
count = 0;
- while (!ends_excmd(*p)) {
+ do {
for (end = p; *end && !vim_iswhite(*end) && *end != ','; ++end)
;
name = xmalloc((int)(end - p + 3)); /* leave room for "^$" */
@@ -5198,7 +5199,7 @@ get_id_list (
if (*p != ',')
break;
p = skipwhite(p + 1); /* skip comma in between arguments */
- }
+ } while (!ends_excmd(*p));
if (failed)
break;
if (round == 1) {