diff options
Diffstat (limited to 'src/nvim/spellfile.c')
-rw-r--r-- | src/nvim/spellfile.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c index d7a3efda83..793985f45d 100644 --- a/src/nvim/spellfile.c +++ b/src/nvim/spellfile.c @@ -819,7 +819,7 @@ endOK: // Fill in the wordcount fields for a trie. // Returns the total number of words. -static void tree_count_words(char_u *byts, idx_T *idxs) +static void tree_count_words(const char_u *byts, idx_T *idxs) { int depth; idx_T arridx[MAXWLEN]; @@ -2171,18 +2171,14 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) midword = (char_u *)getroom_save(spin, (char_u *)items[1]); } else if (is_aff_rule(items, itemcnt, "TRY", 2)) { // ignored, we look in the tree for what chars may appear - } - // TODO: remove "RAR" later - else if ((is_aff_rule(items, itemcnt, "RAR", 2) - || is_aff_rule(items, itemcnt, "RARE", 2)) - && aff->af_rare == 0) { + } else if ((is_aff_rule(items, itemcnt, "RAR", 2) // TODO(vim): remove "RAR" later + || is_aff_rule(items, itemcnt, "RARE", 2)) + && aff->af_rare == 0) { aff->af_rare = affitem2flag(aff->af_flagtype, (char_u *)items[1], fname, lnum); - } - // TODO: remove "KEP" later - else if ((is_aff_rule(items, itemcnt, "KEP", 2) - || is_aff_rule(items, itemcnt, "KEEPCASE", 2)) - && aff->af_keepcase == 0) { + } else if ((is_aff_rule(items, itemcnt, "KEP", 2) // TODO(vim): remove "KEP" later + || is_aff_rule(items, itemcnt, "KEEPCASE", 2)) + && aff->af_keepcase == 0) { aff->af_keepcase = affitem2flag(aff->af_flagtype, (char_u *)items[1], fname, lnum); } else if ((is_aff_rule(items, itemcnt, "BAD", 2) @@ -3962,8 +3958,8 @@ static int store_word(spellinfo_T *spin, char_u *word, int flags, int region, co // When "flags" < 0 we are adding to the prefix tree where "flags" is used for // "rare" and "region" is the condition nr. // Returns FAIL when out of memory. -static int tree_add_word(spellinfo_T *spin, char_u *word, wordnode_T *root, int flags, int region, - int affixID) +static int tree_add_word(spellinfo_T *spin, const char_u *word, wordnode_T *root, int flags, + int region, int affixID) { wordnode_T *node = root; wordnode_T *np; @@ -5742,7 +5738,7 @@ static void init_spellfile(void) /// Set the spell character tables from strings in the .spl file. /// /// @param cnt length of "flags" -static void set_spell_charflags(char_u *flags, int cnt, char_u *fol) +static void set_spell_charflags(const char_u *flags, int cnt, char_u *fol) { // We build the new tables here first, so that we can compare with the // previous one. |