vim-patch:8.1.1891: functions used in one file are global

Problem:    Functions used in one file are global.
Solution:   Add "static". (Yegappan Lakshmanan, closes vim/vim#4840)

5843f5f37b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Jan Edmund Lazo
2025-07-17 23:08:31 -04:00
parent f2d92ba6ca
commit 85bd0b6a03
17 changed files with 25 additions and 43 deletions

View File

@@ -96,9 +96,6 @@ describe('profiling related functions', function()
local function profile_cmp(t1, t2)
return prof.profile_cmp(t1, t2)
end
local function profile_equal(t1, t2)
return prof.profile_equal(t1, t2)
end
local function profile_msg(q)
return ffi.string(prof.profile_msg(q))
end
@@ -110,20 +107,6 @@ describe('profiling related functions', function()
return tonumber(s) + tonumber(us) / 1000000
end
describe('profile_equal', function()
itp('times are equal to themselves', function()
local start = profile_start()
assert.is_true(profile_equal(start, start))
local e = profile_end(start)
assert.is_true(profile_equal(e, e))
end)
itp('times are unequal to others', function()
assert.is_false(profile_equal(profile_start(), profile_start()))
end)
end)
-- this is quite difficult to test, as it would rely on other functions in
-- the profiling package. Those functions in turn will probably be tested
-- using profile_cmp... circular reasoning.
@@ -169,7 +152,6 @@ describe('profiling related functions', function()
describe('profile_zero', function()
itp('returns the same value on each call', function()
eq(0, profile_zero())
assert.is_true(profile_equal(profile_zero(), profile_zero()))
end)
end)
@@ -203,7 +185,7 @@ describe('profiling related functions', function()
describe('profile_setlimit', function()
itp('sets no limit when 0 is passed', function()
eq(true, profile_equal(profile_setlimit(0), profile_zero()))
eq(profile_setlimit(0), profile_zero())
end)
itp('sets a limit in the future otherwise', function()