diff options
author | ZviRackover <zvirack@gmail.com> | 2018-09-02 02:14:47 +0300 |
---|---|---|
committer | ZviRackover <zvirack@gmail.com> | 2018-09-09 10:45:50 +0300 |
commit | 329cfc3303cffd5c9aad7b2ad7f4323354d68b0d (patch) | |
tree | e9abce8472ef283396c7830947c56e1d6154ef86 /src/nvim/spell.c | |
parent | ac13e65ae0ce98516e816ba4fcf468d19e750c30 (diff) | |
download | rneovim-329cfc3303cffd5c9aad7b2ad7f4323354d68b0d.tar.gz rneovim-329cfc3303cffd5c9aad7b2ad7f4323354d68b0d.tar.bz2 rneovim-329cfc3303cffd5c9aad7b2ad7f4323354d68b0d.zip |
lint: clean-up after parent commits
Diffstat (limited to 'src/nvim/spell.c')
-rw-r--r-- | src/nvim/spell.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 92ded29a70..970e50771d 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -3461,8 +3461,9 @@ static void allcap_copy(char_u *word, char_u *wcopy) } else c = SPELL_TOUPPER(c); - if (d - wcopy >= MAXWLEN - MB_MAXBYTES) + if (d - wcopy >= MAXWLEN - MB_MAXBYTES) { break; + } d += utf_char2bytes(c, d); } *d = NUL; @@ -4531,15 +4532,16 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so #endif PROF_STORE(sp->ts_state) sp->ts_state = STATE_UNSWAP; - ++depth; + depth++; fl = mb_char2len(c2); memmove(p, p + n, fl); utf_char2bytes(c, p + fl); stack[depth].ts_fidxtry = sp->ts_fidx + n + fl; - } else + } else { // If this swap doesn't work then SWAP3 won't either. PROF_STORE(sp->ts_state) sp->ts_state = STATE_REP_INI; + } break; case STATE_UNSWAP: @@ -4586,7 +4588,7 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so #endif PROF_STORE(sp->ts_state) sp->ts_state = STATE_UNSWAP3; - ++depth; + depth++; tl = mb_char2len(c3); memmove(p, p + n + fl, tl); utf_char2bytes(c2, p + tl); @@ -5895,8 +5897,9 @@ static void spell_soundfold_sofo(slang_T *slang, char_u *inword, char_u *res) if (c != NUL && c != prevc) { ri += utf_char2bytes(c, res + ri); - if (ri + MB_MAXBYTES > MAXWLEN) + if (ri + MB_MAXBYTES > MAXWLEN) { break; + } prevc = c; } } @@ -6416,10 +6419,11 @@ static void spell_soundfold_wsal(slang_T *slang, char_u *inword, char_u *res) // Convert wide characters in "wres" to a multi-byte string in "res". l = 0; - for (n = 0; n < reslen; ++n) { + for (n = 0; n < reslen; n++) { l += utf_char2bytes(wres[n], res + l); - if (l + MB_MAXBYTES > MAXWLEN) + if (l + MB_MAXBYTES > MAXWLEN) { break; + } } res[l] = NUL; } |