mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
refactor: remove char_u (#22829)
Closes https://github.com/neovim/neovim/issues/459
This commit is contained in:
@@ -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}},
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user