syntax: use const on syn_list_keywords() variables

This commit is contained in:
Jan Edmund Lazo 2018-07-26 13:30:58 -04:00
parent 9b34b867dd
commit 6f5eadcdac

View File

@ -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. * List or clear the keywords for one syntax group.
* Return TRUE if the header has been printed. * Return TRUE if the header has been printed.
*/ */
static int static int syn_list_keywords(
syn_list_keywords( const int id,
int id, const hashtab_T *const ht,
hashtab_T *ht, int did_header, // header has already been printed
int did_header, /* header has already been printed */ const int attr
int attr
) )
{ {
int outlen; int outlen;
hashitem_T *hi;
keyentry_T *kp;
int todo;
int prev_contained = 0; int prev_contained = 0;
short *prev_next_list = NULL; const int16_t *prev_next_list = NULL;
short *prev_cont_in_list = NULL; const int16_t *prev_cont_in_list = NULL;
int prev_skipnl = 0; int prev_skipnl = 0;
int prev_skipwhite = 0; int prev_skipwhite = 0;
int prev_skipempty = 0; int prev_skipempty = 0;
/* // Unfortunately, this list of keywords is not sorted on alphabet but on
* Unfortunately, this list of keywords is not sorted on alphabet but on // hash value...
* hash value... size_t todo = ht->ht_used;
*/ for (const hashitem_T *hi = ht->ht_array; todo > 0 && !got_int; hi++) {
todo = (int)ht->ht_used;
for (hi = ht->ht_array; todo > 0 && !got_int; ++hi) {
if (HASHITEM_EMPTY(hi)) { if (HASHITEM_EMPTY(hi)) {
continue; continue;
} }
--todo; todo--;
for (kp = HI2KE(hi); kp != NULL && !got_int; kp = kp->ke_next) { for (keyentry_T *kp = HI2KE(hi); kp != NULL && !got_int; kp = kp->ke_next) {
if (kp->k_syn.id == id) { if (kp->k_syn.id == id) {
if (prev_contained != (kp->flags & HL_CONTAINED) if (prev_contained != (kp->flags & HL_CONTAINED)
|| prev_skipnl != (kp->flags & HL_SKIPNL) || prev_skipnl != (kp->flags & HL_SKIPNL)