vlib: fix incompatible pointer warning (#6385)

pull/6390/head
Daniel Däschle 2020-09-16 16:40:02 +02:00 committed by GitHub
parent 1bc9063573
commit c960b5979e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -201,9 +201,9 @@ pub:
type VectoredExceptionHandler fn(&ExceptionPointers)u32 type VectoredExceptionHandler fn(&ExceptionPointers)u32
fn C.AddVectoredExceptionHandler(u32, VectoredExceptionHandler) fn C.AddVectoredExceptionHandler(u32, C.PVECTORED_EXCEPTION_HANDLER)
fn add_vectored_exception_handler(handler VectoredExceptionHandler) { fn add_vectored_exception_handler(handler VectoredExceptionHandler) {
C.AddVectoredExceptionHandler(1, handler) C.AddVectoredExceptionHandler(1, C.PVECTORED_EXCEPTION_HANDLER(handler))
} }
[windows_stdcall] [windows_stdcall]

View File

@ -221,7 +221,7 @@ fn C.SendMessageTimeoutW(hWnd voidptr, Msg u32, wParam &u16, lParam &u32, fuFlag
fn C.CreateProcessW(lpApplicationName &u16, lpCommandLine &u16, lpProcessAttributes voidptr, lpThreadAttributes voidptr, bInheritHandles bool, dwCreationFlags u32, lpEnvironment voidptr, lpCurrentDirectory &u16, lpStartupInfo voidptr, lpProcessInformation voidptr) bool fn C.CreateProcessW(lpApplicationName &u16, lpCommandLine &u16, lpProcessAttributes voidptr, lpThreadAttributes voidptr, bInheritHandles bool, dwCreationFlags u32, lpEnvironment voidptr, lpCurrentDirectory &u16, lpStartupInfo voidptr, lpProcessInformation voidptr) bool
fn C.ReadFile(hFile voidptr, lpBuffer voidptr, nNumberOfBytesToRead u32, lpNumberOfBytesRead voidptr, lpOverlapped voidptr) bool fn C.ReadFile(hFile voidptr, lpBuffer voidptr, nNumberOfBytesToRead u32, lpNumberOfBytesRead C.LPDWORD, lpOverlapped voidptr) bool
fn C.GetFileAttributesW(lpFileName byteptr) u32 fn C.GetFileAttributesW(lpFileName byteptr) u32

View File

@ -691,13 +691,13 @@ pub fn get_raw_line() string {
h_input := C.GetStdHandle(std_input_handle) h_input := C.GetStdHandle(std_input_handle)
mut bytes_read := 0 mut bytes_read := 0
if is_atty(0) > 0 { if is_atty(0) > 0 {
C.ReadConsole(h_input, buf, max_line_chars * 2, &bytes_read, 0) C.ReadConsole(h_input, buf, max_line_chars * 2, C.LPDWORD(&bytes_read), 0)
return string_from_wide2(&u16(buf), bytes_read) return string_from_wide2(&u16(buf), bytes_read)
} }
mut offset := 0 mut offset := 0
for { for {
pos := buf + offset pos := buf + offset
res := C.ReadFile(h_input, pos, 1, &bytes_read, 0) res := C.ReadFile(h_input, pos, 1, C.LPDWORD(&bytes_read), 0)
if !res || bytes_read == 0 { if !res || bytes_read == 0 {
break break
} }
@ -734,7 +734,7 @@ pub fn get_raw_stdin() []byte {
mut offset := 0 mut offset := 0
for { for {
pos := buf + offset pos := buf + offset
res := C.ReadFile(h_input, pos, block_bytes, &bytes_read, 0) res := C.ReadFile(h_input, pos, block_bytes, C.LPDWORD(&bytes_read), 0)
offset += bytes_read offset += bytes_read
if !res { if !res {

View File

@ -345,7 +345,7 @@ pub type VectoredExceptionHandler fn(&ExceptionPointers)u32
// fn C.AddVectoredExceptionHandler(u32, VectoredExceptionHandler) // fn C.AddVectoredExceptionHandler(u32, VectoredExceptionHandler)
pub fn add_vectored_exception_handler(first bool, handler VectoredExceptionHandler) { pub fn add_vectored_exception_handler(first bool, handler VectoredExceptionHandler) {
C.AddVectoredExceptionHandler(u32(first), handler) C.AddVectoredExceptionHandler(u32(first), C.PVECTORED_EXCEPTION_HANDLER(handler))
} }
// this is defined in builtin_windows.c.v in builtin // this is defined in builtin_windows.c.v in builtin