Mercurial > vim
comparison src/userfunc.c @ 29320:a74398c432a4 v9.0.0003
patch 9.0.0003: functions are global while they could be local
Commit: https://github.com/vim/vim/commit/ee47eaceaa148e07b566ff420f9a3c2edde2fa34
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Wed Jun 29 12:55:36 2022 +0100
patch 9.0.0003: functions are global while they could be local
Problem: Functions are global while they could be local.
Solution: Add "static". Add a few tests. (Yegappan Lakshmanan,
closes #10612)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 29 Jun 2022 14:00:03 +0200 |
parents | e391590249a1 |
children | 9f93092fb3cc |
comparison
equal
deleted
inserted
replaced
29319:0f3ce048146b | 29320:a74398c432a4 |
---|---|
30 static funccall_T *previous_funccal = NULL; | 30 static funccall_T *previous_funccal = NULL; |
31 | 31 |
32 static void funccal_unref(funccall_T *fc, ufunc_T *fp, int force); | 32 static void funccal_unref(funccall_T *fc, ufunc_T *fp, int force); |
33 static void func_clear(ufunc_T *fp, int force); | 33 static void func_clear(ufunc_T *fp, int force); |
34 static int func_free(ufunc_T *fp, int force); | 34 static int func_free(ufunc_T *fp, int force); |
35 static char_u *untrans_function_name(char_u *name); | |
35 | 36 |
36 void | 37 void |
37 func_init() | 38 func_init() |
38 { | 39 { |
39 hash_init(&func_hashtab); | 40 hash_init(&func_hashtab); |
4071 * to use the script-local name, return the unmodified name (points into | 4072 * to use the script-local name, return the unmodified name (points into |
4072 * "name"). Otherwise return NULL. | 4073 * "name"). Otherwise return NULL. |
4073 * This can be used to first search for a script-local function and fall back | 4074 * This can be used to first search for a script-local function and fall back |
4074 * to the global function if not found. | 4075 * to the global function if not found. |
4075 */ | 4076 */ |
4076 char_u * | 4077 static char_u * |
4077 untrans_function_name(char_u *name) | 4078 untrans_function_name(char_u *name) |
4078 { | 4079 { |
4079 char_u *p; | 4080 char_u *p; |
4080 | 4081 |
4081 if (*name == K_SPECIAL && in_vim9script()) | 4082 if (*name == K_SPECIAL && in_vim9script()) |