1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vlib: fix incompatible pointer warning (#6385)

This commit is contained in:
Daniel Däschle
2020-09-16 16:40:02 +02:00
committed by GitHub
parent 1bc9063573
commit c960b5979e
4 changed files with 8 additions and 8 deletions

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