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)
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 90d7adb..11e3226 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -557,6 +557,27 @@
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 @@
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.
*/