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

@ -70,7 +70,7 @@ fn restore_codepage() {
fn builtin_init() {
g_original_codepage = C.GetConsoleOutputCP()
C.SetConsoleOutputCP(C.CP_UTF8)
C.SetConsoleOutputCP(C.CP_UTF8)
C.atexit(restore_codepage)
if is_atty(1) > 0 {
C.SetConsoleMode(C.GetStdHandle(C.STD_OUTPUT_HANDLE), C.ENABLE_PROCESSED_OUTPUT | 0x0004) // enable_virtual_terminal_processing
@ -201,9 +201,9 @@ pub:
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) {
C.AddVectoredExceptionHandler(1, handler)
C.AddVectoredExceptionHandler(1, C.PVECTORED_EXCEPTION_HANDLER(handler))
}
[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.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

View File

@ -691,13 +691,13 @@ pub fn get_raw_line() string {
h_input := C.GetStdHandle(std_input_handle)
mut bytes_read := 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)
}
mut offset := 0
for {
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 {
break
}
@ -734,7 +734,7 @@ pub fn get_raw_stdin() []byte {
mut offset := 0
for {
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
if !res {

View File

@ -345,7 +345,7 @@ pub type VectoredExceptionHandler fn(&ExceptionPointers)u32
// fn C.AddVectoredExceptionHandler(u32, 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