mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
net: use vmemset(&hints, 0, int(sizeof(hints)))
, instead of zeroing the fields 1 by 1
This commit is contained in:
parent
e42db5bee2
commit
8e0de2036d
@ -173,14 +173,11 @@ pub fn resolve_ipaddrs(addr string, family AddrFamily, typ SocketType) ?[]Addr {
|
||||
// ai_socktype: int(typ)
|
||||
// ai_flags: C.AI_PASSIVE
|
||||
}
|
||||
unsafe { vmemset(&hints, 0, int(sizeof(hints))) }
|
||||
hints.ai_family = int(family)
|
||||
hints.ai_socktype = int(typ)
|
||||
hints.ai_flags = C.AI_PASSIVE
|
||||
hints.ai_protocol = 0
|
||||
hints.ai_addrlen = 0
|
||||
hints.ai_addr = voidptr(0)
|
||||
hints.ai_canonname = voidptr(0)
|
||||
hints.ai_next = voidptr(0)
|
||||
|
||||
results := &C.addrinfo(0)
|
||||
|
||||
sport := '$port'
|
||||
|
Loading…
Reference in New Issue
Block a user