use the new &C.Foo(0) cast
parent
2bafd41183
commit
b2b34e18e4
|
@ -488,6 +488,7 @@ fn (p mut Parser) gen_struct_init(typ string, t Type) bool {
|
|||
// TODO tmp hack for 0 pointers init
|
||||
// &User{!} ==> 0
|
||||
if p.tok == .not {
|
||||
p.warn('use `$t.name(0)` instead of `&$t.name{!}`')
|
||||
p.next()
|
||||
p.gen('0')
|
||||
p.check(.rcbr)
|
||||
|
|
|
@ -31,8 +31,8 @@ pub fn ls(path string) ?[]string {
|
|||
if isnil(dir) {
|
||||
return error('ls() couldnt open dir "$path"')
|
||||
}
|
||||
//mut ent := &C.dirent(0)
|
||||
mut ent := &C.dirent{!}
|
||||
mut ent := &C.dirent(0)
|
||||
//mut ent := &C.dirent{!}
|
||||
for {
|
||||
ent = C.readdir(dir)
|
||||
if isnil(ent) {
|
||||
|
|
|
@ -102,7 +102,7 @@ fn C.time(int) C.time_t
|
|||
|
||||
pub fn now() Time {
|
||||
t := C.time(0)
|
||||
mut now := &C.tm{!}
|
||||
mut now := &C.tm(0)
|
||||
now = C.localtime(&t)
|
||||
return convert_ctime(now)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue