From e77a11001e0c2a86f01f2159ae34b13a7d2c6381 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 21 Nov 2021 23:04:30 +0200 Subject: [PATCH] os: make init_os_args_wide (windows), more simillar to the current init_os_args (unix) --- vlib/os/os_windows.c.v | 4 ++-- vlib/v/tests/valgrind/valgrind_test.v | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/vlib/os/os_windows.c.v b/vlib/os/os_windows.c.v index caf8141da1..c7738cdad6 100644 --- a/vlib/os/os_windows.c.v +++ b/vlib/os/os_windows.c.v @@ -95,9 +95,9 @@ struct C._utimbuf { fn C._utime(&char, voidptr) int fn init_os_args_wide(argc int, argv &&byte) []string { - mut args_ := []string{} + mut args_ := []string{len: argc} for i in 0 .. argc { - args_ << unsafe { string_from_wide(&u16(argv[i])) } + args_[i] = unsafe { string_from_wide(&u16(argv[i])) } } return args_ } diff --git a/vlib/v/tests/valgrind/valgrind_test.v b/vlib/v/tests/valgrind/valgrind_test.v index fcbc1494b1..227df9b332 100644 --- a/vlib/v/tests/valgrind/valgrind_test.v +++ b/vlib/v/tests/valgrind/valgrind_test.v @@ -29,7 +29,6 @@ const skip_valgrind_files = [ 'vlib/v/tests/valgrind/fn_with_return_should_free_local_vars.v', 'vlib/v/tests/valgrind/option_simple.v', 'vlib/v/tests/valgrind/string_plus_string_plus.v', - 'vlib/v/tests/valgrind/import_os_and_use_its_constants.v', ] fn vprintln(s string) {