From 054bb272df735008eb8c008b228d0df127d9d00b Mon Sep 17 00:00:00 2001 From: yuyi Date: Tue, 4 Jan 2022 17:34:07 +0800 Subject: [PATCH] cgen: fix const fixed array of reference var using correct pointer (#13023) --- vlib/v/gen/c/cgen.v | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index f9a50da289..98c037d50f 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -1132,15 +1132,8 @@ pub fn (mut g Gen) write_typedef_types() { // .array_fixed { styp := sym.cname // array_fixed_char_300 => char x[300] - mut fixed := styp[12..] len := styp.after('_') - fixed = fixed[..fixed.len - len.len - 1] - if fixed.starts_with('C__') { - fixed = fixed[3..] - } - if fixed.contains('ptr') { - fixed = 'void*' - } + mut fixed := g.typ(info.elem_type) if elem_sym.info is ast.FnType { pos := g.out.len g.write_fn_ptr_decl(&elem_sym.info, '')