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

checker: define missing C fn args & check C & JS args (#8770)

This commit is contained in:
joe-conigliaro
2021-03-06 01:41:11 +11:00
committed by GitHub
parent ead2ba6004
commit 2d73411396
34 changed files with 358 additions and 284 deletions

View File

@ -4,6 +4,7 @@ import os
#include <sys/ioctl.h>
#include <termios.h> // TIOCGWINSZ
pub struct C.winsize {
pub:
ws_row u16
@ -20,7 +21,7 @@ pub fn get_terminal_size() (int, int) {
return default_columns_size, default_rows_size
}
w := C.winsize{}
C.ioctl(1, C.TIOCGWINSZ, &w)
C.ioctl(1, u64(C.TIOCGWINSZ), &w)
return int(w.ws_col), int(w.ws_row)
}
@ -52,7 +53,7 @@ pub fn get_cursor_position() Coord {
i++
if i >= 15 {
panic('C.getchar() called too many times')
}
}
// state management:
if b == `R` {
break