refactor: remove char_u (#22829)

Closes https://github.com/neovim/neovim/issues/459
This commit is contained in:
dundargoc
2023-04-02 10:11:42 +02:00
committed by GitHub
parent 9084948893
commit d510bfbc8e
40 changed files with 340 additions and 1965 deletions

View File

@@ -349,7 +349,7 @@ local special_vals = nil
lua2typvalt = function(l, processed)
if not special_vals then
special_vals = {
[null_string] = {'VAR_STRING', {v_string=ffi.cast('char_u*', nil)}},
[null_string] = {'VAR_STRING', {v_string=ffi.cast('char*', nil)}},
[null_list] = {'VAR_LIST', {v_list=ffi.cast('list_T*', nil)}},
[null_dict] = {'VAR_DICT', {v_dict=ffi.cast('dict_T*', nil)}},
[nil_value] = {'VAR_SPECIAL', {v_special=eval.kSpecialVarNull}},

View File

@@ -12,7 +12,7 @@ describe('trunc_string', function()
local buflen = 40
local function test_inplace(s, expected, room)
room = room and room or 20
local buf = cimp.xmalloc(ffi.sizeof('char_u') * buflen)
local buf = cimp.xmalloc(ffi.sizeof('char') * buflen)
ffi.C.strcpy(buf, s)
cimp.trunc_string(buf, buf, room, buflen)
eq(expected, ffi.string(buf))
@@ -21,7 +21,7 @@ describe('trunc_string', function()
local function test_copy(s, expected, room)
room = room and room or 20
local buf = cimp.xmalloc(ffi.sizeof('char_u') * buflen)
local buf = cimp.xmalloc(ffi.sizeof('char') * buflen)
local str = cimp.xstrdup(to_cstr(s))
cimp.trunc_string(str, buf, room, buflen)
eq(expected, ffi.string(buf))

View File

@@ -37,7 +37,7 @@ child_call_once(function()
-- requires refactor of UNDO_HASH_SIZE into constant/enum for ffi
--
-- compute a hash for this undofile
buffer_hash = ffi.new('char_u[32]')
buffer_hash = ffi.new('char[32]')
undo.u_compute_hash(file_buffer, buffer_hash)
end)