diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-07-26 11:28:05 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-07-29 07:51:50 -0400 |
commit | e6993f24915d164d8cd83eb6dbbb183cf5b8d45e (patch) | |
tree | 1515c16cc4cf1afc73a51112bb43b1e789d62680 /src/nvim/syntax.c | |
parent | ef3cbd91cb9ecf2da41563e4855588049d8649a5 (diff) | |
download | rneovim-e6993f24915d164d8cd83eb6dbbb183cf5b8d45e.tar.gz rneovim-e6993f24915d164d8cd83eb6dbbb183cf5b8d45e.tar.bz2 rneovim-e6993f24915d164d8cd83eb6dbbb183cf5b8d45e.zip |
syntax: use const on copy_id_list() params,vars
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r-- | src/nvim/syntax.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index f14f4a5809..1b802f920c 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -5385,20 +5385,18 @@ get_id_list( /* * Make a copy of an ID list. */ -static short *copy_id_list(short *list) +static int16_t *copy_id_list(const int16_t *const list) { - int len; - int count; - short *retval; - - if (list == NULL) + if (list == NULL) { return NULL; + } - for (count = 0; list[count]; ++count) - ; - len = (count + 1) * sizeof(short); - retval = xmalloc(len); - memmove(retval, list, (size_t)len); + int count; + for (count = 0; list[count]; count++) { + } + const size_t len = (count + 1) * sizeof(int16_t); + int16_t *const retval = xmalloc(len); + memmove(retval, list, len); return retval; } |