mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fix all Foo{!}
This commit is contained in:
parent
e32cbfcca7
commit
40df0644ca
@ -70,13 +70,13 @@ pub mut:
|
||||
|
||||
// fn new_context(width, height int, use_ortho bool, font_size int) *GG {
|
||||
pub fn new_context(cfg Cfg) &GG {
|
||||
mut window := &glfw.Window{!}
|
||||
mut window := &glfw.Window(0)
|
||||
if cfg.create_window {
|
||||
if cfg.resizable {
|
||||
glfw.window_hint(C.GLFW_RESIZABLE, 1)
|
||||
} else {
|
||||
glfw.window_hint(C.GLFW_RESIZABLE, 0)
|
||||
}
|
||||
}
|
||||
window = glfw.create_window(glfw.WinCfg{
|
||||
title: cfg.window_title
|
||||
width: cfg.width
|
||||
|
@ -73,7 +73,7 @@ fn (req &Request) ssl_do(port int, method, host_name, path string) ?Response {
|
||||
res = C.BIO_set_conn_hostname(web, addr.str)
|
||||
if res != 1 {
|
||||
}
|
||||
ssl := &C.SSL{!}
|
||||
ssl := &C.SSL(0)
|
||||
C.BIO_get_ssl(web, &ssl)
|
||||
if isnil(ssl) {
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ mut:
|
||||
ai_socktype int
|
||||
ai_flags int
|
||||
ai_protocol int
|
||||
ai_addrlen int
|
||||
ai_addrlen int
|
||||
ai_addr voidptr
|
||||
ai_canonname voidptr
|
||||
ai_next voidptr
|
||||
@ -174,9 +174,9 @@ pub fn (s Socket) connect(address string, port int) ?int {
|
||||
hints.ai_canonname = C.NULL
|
||||
hints.ai_addr = C.NULL
|
||||
hints.ai_next = C.NULL
|
||||
|
||||
|
||||
info := &C.addrinfo{!}
|
||||
|
||||
info := &C.addrinfo(0)
|
||||
sport := '$port'
|
||||
info_res := C.getaddrinfo(address.str, sport.str, &hints, &info)
|
||||
if info_res != 0 {
|
||||
|
@ -19,13 +19,13 @@ pub mut:
|
||||
}
|
||||
|
||||
pub fn connect(path string) DB {
|
||||
db := &C.sqlite3{!}
|
||||
db := &C.sqlite3(0)
|
||||
C.sqlite3_open(path.str, &db)
|
||||
return DB {conn: db}
|
||||
}
|
||||
|
||||
pub fn (db DB) q_int(query string) int {
|
||||
stmt := &C.sqlite3_stmt{!}
|
||||
stmt := &C.sqlite3_stmt(0)
|
||||
C.sqlite3_prepare_v2(db.conn, query.str, - 1, &stmt, 0)
|
||||
C.sqlite3_step(stmt)
|
||||
res := C.sqlite3_column_int(stmt, 0)
|
||||
@ -41,7 +41,7 @@ fn C.sqlite3_prepare_v2()
|
||||
fn C.sqlite3_finalize()
|
||||
|
||||
pub fn (db DB) q_string(query string) string {
|
||||
stmt := &C.sqlite3_stmt{!}
|
||||
stmt := &C.sqlite3_stmt(0)
|
||||
C.sqlite3_prepare_v2(db.conn, query.str, - 1, &stmt, 0)
|
||||
C.sqlite3_step(stmt)
|
||||
f := C.sqlite3_column_text(stmt, 0)
|
||||
@ -53,7 +53,7 @@ pub fn (db DB) q_string(query string) string {
|
||||
fn C.sqlite3_column_count(voidptr) int
|
||||
|
||||
pub fn (db DB) exec(query string) []Row {
|
||||
stmt := &C.sqlite3_stmt{!}
|
||||
stmt := &C.sqlite3_stmt(0)
|
||||
C.sqlite3_prepare_v2(db.conn, query.str, - 1, &stmt, 0)
|
||||
nr_cols := C.sqlite3_column_count(stmt)
|
||||
//println('nr cols $nr_cols')
|
||||
@ -62,7 +62,7 @@ pub fn (db DB) exec(query string) []Row {
|
||||
ret := C.sqlite3_step(stmt)
|
||||
if ret != 0x64 {
|
||||
break
|
||||
}
|
||||
}
|
||||
mut row := Row{}
|
||||
for i in 0..nr_cols {
|
||||
val := tos_clone(C.sqlite3_column_text(stmt, i))
|
||||
|
Loading…
Reference in New Issue
Block a user