0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.4045: some global functions are only used in one file

Problem:    Some global functions are only used in one file.
Solution:   Make the functions static. (Yegappan Lakshmanan, closes #9492)
This commit is contained in:
Yegappan Lakshmanan
2022-01-08 18:43:40 +00:00
committed by Bram Moolenaar
parent 7c24dfddc2
commit 782b43d894
11 changed files with 117 additions and 119 deletions

View File

@@ -557,6 +557,27 @@ get_script_item_idx(int sid, char_u *name, int check_writable, cctx_T *cctx)
return -1;
}
static imported_T *
find_imported_in_script(char_u *name, size_t len, int sid)
{
scriptitem_T *si;
int idx;
if (!SCRIPT_ID_VALID(sid))
return NULL;
si = SCRIPT_ITEM(sid);
for (idx = 0; idx < si->sn_imports.ga_len; ++idx)
{
imported_T *import = ((imported_T *)si->sn_imports.ga_data) + idx;
if (len == 0 ? STRCMP(name, import->imp_name) == 0
: STRLEN(import->imp_name) == len
&& STRNCMP(name, import->imp_name, len) == 0)
return import;
}
return NULL;
}
/*
* Find "name" in imported items of the current script or in "cctx" if not
* NULL.
@@ -583,27 +604,6 @@ find_imported(char_u *name, size_t len, cctx_T *cctx)
return find_imported_in_script(name, len, current_sctx.sc_sid);
}
imported_T *
find_imported_in_script(char_u *name, size_t len, int sid)
{
scriptitem_T *si;
int idx;
if (!SCRIPT_ID_VALID(sid))
return NULL;
si = SCRIPT_ITEM(sid);
for (idx = 0; idx < si->sn_imports.ga_len; ++idx)
{
imported_T *import = ((imported_T *)si->sn_imports.ga_data) + idx;
if (len == 0 ? STRCMP(name, import->imp_name) == 0
: STRLEN(import->imp_name) == len
&& STRNCMP(name, import->imp_name, len) == 0)
return import;
}
return NULL;
}
/*
* Free all imported variables.
*/