0
0
mirror of https://github.com/vim/vim.git synced 2025-10-09 06:14:17 -04:00

patch 8.2.2922: computing array length is done in various ways

Problem:    Computing array length is done in various ways.
Solution:   Use ARRAY_LENGTH everywhere. (Ken Takata, closes #8305)
This commit is contained in:
K.Takata
2021-06-02 13:28:16 +02:00
committed by Bram Moolenaar
parent b54abeeafb
commit eeec254878
43 changed files with 80 additions and 90 deletions

View File

@@ -1877,7 +1877,7 @@ get_function_name(expand_T *xp, int idx)
return name;
}
}
if (++intidx < (int)(sizeof(global_functions) / sizeof(funcentry_T)))
if (++intidx < (int)ARRAY_LENGTH(global_functions))
{
STRCPY(IObuff, global_functions[intidx].f_name);
STRCAT(IObuff, "(");
@@ -1923,7 +1923,7 @@ find_internal_func_opt(char_u *name, int implemented)
int cmp;
int x;
last = (int)(sizeof(global_functions) / sizeof(funcentry_T)) - 1;
last = (int)ARRAY_LENGTH(global_functions) - 1;
// Find the function name in the table. Binary search.
while (first <= last)