diff --git a/compiler/cheaders.v b/compiler/cheaders.v index d075e3d2d0..ddc8a5570f 100644 --- a/compiler/cheaders.v +++ b/compiler/cheaders.v @@ -115,7 +115,6 @@ typedef map map_string; //#define ALLOC_INIT(type, ...) (type *)memdup((type[]){ __VA_ARGS__ }, sizeof(type)) //================================== GLOBALS =================================*/ -//int V_ZERO = 0; byteptr g_str_buf; int load_so(byteptr); void reload_so(); diff --git a/compiler/parser.v b/compiler/parser.v index bc8737db81..c27c96aaf3 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -2686,17 +2686,8 @@ fn (p mut Parser) array_init() string { if i == 1 && p.tok == .semicolon { p.check_space(.semicolon) val := p.cgen.cur_line.right(pos) - // p.cgen.cur_line = '' p.cgen.resetln(p.cgen.cur_line.left(pos)) - // Special case for zero - if false && val.trim_space() == '0' { - p.gen('array_repeat( & V_ZERO, ') - } - else { - tmp := p.get_tmp() - p.cgen.insert_before('$typ $tmp = $val;') - p.gen('array_repeat(&$tmp, ') - } + p.gen('array_repeat(& ($typ[]){ $val }, ') p.check_types(p.bool_expression(), 'int') p.gen(', sizeof($typ) )') p.check(.rsbr)