mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fix some windows cast warnings
This commit is contained in:
parent
c019dd6f98
commit
49f960aea5
@ -407,7 +407,7 @@ fn posix_wait4_to_exit_status(waitret int) (int,bool) {
|
||||
|
||||
fn vpclose(f voidptr) int {
|
||||
$if windows {
|
||||
return int( C._pclose(f) )
|
||||
return C._pclose(f)
|
||||
}
|
||||
$else {
|
||||
ret , _ := posix_wait4_to_exit_status(C.pclose(f))
|
||||
@ -779,7 +779,7 @@ pub fn executable() string {
|
||||
$if windows {
|
||||
max := 512
|
||||
mut result := &u16(calloc(max*2)) // MAX_PATH * sizeof(wchar_t)
|
||||
len := int(C.GetModuleFileName( 0, result, max ))
|
||||
len := C.GetModuleFileName( 0, result, max )
|
||||
return string_from_wide2(result, len)
|
||||
}
|
||||
$if macos {
|
||||
|
@ -78,7 +78,7 @@ fn init_os_args(argc int, argv &byteptr) []string {
|
||||
mut args := []string
|
||||
mut args_list := &voidptr(0)
|
||||
mut args_count := 0
|
||||
args_list = &voidptr(C.CommandLineToArgvW(C.GetCommandLine(), &args_count))
|
||||
args_list = C.CommandLineToArgvW(C.GetCommandLine(), &args_count)
|
||||
for i := 0; i < args_count; i++ {
|
||||
args << string_from_wide(&u16(args_list[i]))
|
||||
}
|
||||
@ -160,7 +160,7 @@ pub fn get_file_handle(path string) HANDLE {
|
||||
// get_module_filename retrieves the fully qualified path for the file that contains the specified module.
|
||||
// The module must have been loaded by the current process.
|
||||
pub fn get_module_filename(handle HANDLE) ?string {
|
||||
mut sz := int(4096) // Optimized length
|
||||
mut sz := 4096 // Optimized length
|
||||
mut buf := &u16(malloc(4096))
|
||||
for {
|
||||
status := int(C.GetModuleFileNameW(handle, voidptr(&buf), sz))
|
||||
|
Loading…
Reference in New Issue
Block a user