aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-07-26 13:30:58 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-07-29 07:51:50 -0400
commit6f5eadcdacca38d815caec6489bf2e064c0e5293 (patch)
treed94428adf8b59e115798bed1d90eab5ac35a3148 /src/nvim/syntax.c
parent9b34b867ddc4c9e458bc108fb14de33ab6c4ee75 (diff)
downloadrneovim-6f5eadcdacca38d815caec6489bf2e064c0e5293.tar.gz
rneovim-6f5eadcdacca38d815caec6489bf2e064c0e5293.tar.bz2
rneovim-6f5eadcdacca38d815caec6489bf2e064c0e5293.zip
syntax: use const on syn_list_keywords() variables
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r--src/nvim/syntax.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 1b802f920c..5a22d03375 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -3790,36 +3790,30 @@ static void put_pattern(char *s, int c, synpat_T *spp, int attr)
* List or clear the keywords for one syntax group.
* Return TRUE if the header has been printed.
*/
-static int
-syn_list_keywords(
- int id,
- hashtab_T *ht,
- int did_header, /* header has already been printed */
- int attr
+static int syn_list_keywords(
+ const int id,
+ const hashtab_T *const ht,
+ int did_header, // header has already been printed
+ const int attr
)
{
int outlen;
- hashitem_T *hi;
- keyentry_T *kp;
- int todo;
int prev_contained = 0;
- short *prev_next_list = NULL;
- short *prev_cont_in_list = NULL;
+ const int16_t *prev_next_list = NULL;
+ const int16_t *prev_cont_in_list = NULL;
int prev_skipnl = 0;
int prev_skipwhite = 0;
int prev_skipempty = 0;
- /*
- * Unfortunately, this list of keywords is not sorted on alphabet but on
- * hash value...
- */
- todo = (int)ht->ht_used;
- for (hi = ht->ht_array; todo > 0 && !got_int; ++hi) {
+ // Unfortunately, this list of keywords is not sorted on alphabet but on
+ // hash value...
+ size_t todo = ht->ht_used;
+ for (const hashitem_T *hi = ht->ht_array; todo > 0 && !got_int; hi++) {
if (HASHITEM_EMPTY(hi)) {
continue;
}
- --todo;
- for (kp = HI2KE(hi); kp != NULL && !got_int; kp = kp->ke_next) {
+ todo--;
+ for (keyentry_T *kp = HI2KE(hi); kp != NULL && !got_int; kp = kp->ke_next) {
if (kp->k_syn.id == id) {
if (prev_contained != (kp->flags & HL_CONTAINED)
|| prev_skipnl != (kp->flags & HL_SKIPNL)