mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
use the new &C.Foo(0) cast
This commit is contained in:
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
|
// TODO tmp hack for 0 pointers init
|
||||||
// &User{!} ==> 0
|
// &User{!} ==> 0
|
||||||
if p.tok == .not {
|
if p.tok == .not {
|
||||||
|
p.warn('use `$t.name(0)` instead of `&$t.name{!}`')
|
||||||
p.next()
|
p.next()
|
||||||
p.gen('0')
|
p.gen('0')
|
||||||
p.check(.rcbr)
|
p.check(.rcbr)
|
||||||
|
@ -31,8 +31,8 @@ pub fn ls(path string) ?[]string {
|
|||||||
if isnil(dir) {
|
if isnil(dir) {
|
||||||
return error('ls() couldnt open dir "$path"')
|
return error('ls() couldnt open dir "$path"')
|
||||||
}
|
}
|
||||||
//mut ent := &C.dirent(0)
|
mut ent := &C.dirent(0)
|
||||||
mut ent := &C.dirent{!}
|
//mut ent := &C.dirent{!}
|
||||||
for {
|
for {
|
||||||
ent = C.readdir(dir)
|
ent = C.readdir(dir)
|
||||||
if isnil(ent) {
|
if isnil(ent) {
|
||||||
|
@ -102,7 +102,7 @@ fn C.time(int) C.time_t
|
|||||||
|
|
||||||
pub fn now() Time {
|
pub fn now() Time {
|
||||||
t := C.time(0)
|
t := C.time(0)
|
||||||
mut now := &C.tm{!}
|
mut now := &C.tm(0)
|
||||||
now = C.localtime(&t)
|
now = C.localtime(&t)
|
||||||
return convert_ctime(now)
|
return convert_ctime(now)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user